- .github
- devel
- doc
-
examples
-
dynamic-client
-
notebooks
-
watch
-
yaml_dir
- README.md
- __init__.py
- annotate_deployment.py
- api_discovery.py
- apply_from_dict.py
- apply_from_directory.py
- apply_from_single_file.py
- cluster_scoped_custom_object.py
- cronjob_crud.py
- deployment_create.py
- deployment_crud.py
- duration-gep2257.py
- in_cluster_config.py
- ingress_create.py
- job_crud.py
- multiple_clusters.py
- namespaced_custom_object.py
- node_labels.py
- out_of_cluster_config.py
- pick_kube_config_context.py
- pod_config_list.py
- pod_exec.py
- pod_portforward.py
- remote_cluster.py
- rollout-daemonset.py
- rollout-statefulset.py
-
dynamic-client
- kubernetes
- scripts
- .gitignore
- CHANGELOG.md
- CONTRIBUTING.md
- LICENSE
- MANIFEST.in
- OWNERS
- README.md
- SECURITY_CONTACTS
- code-of-conduct.md
- codecov.yml
- requirements.txt
- setup.cfg
- setup.py
- test-requirements.txt
- tox.ini
Explanation
This code defines a class ApiregistrationApi
that provides an interface for interacting with the Kubernetes apiregistration API.
Class Initialization:
- The constructor
__init__
initializes an instance of theApiregistrationApi
class. - It takes an optional
api_client
parameter. If not provided, it uses the defaultApiClient
. - The
api_client
is used for making API calls to the Kubernetes server.
get_api_group
Method:
- This method retrieves information about the apiregistration API group.
- It makes a GET request to the
/apis/apiregistration.k8s.io/
endpoint. - It doesn’t require any parameters.
- It returns a
V1APIGroup
object representing the API group information.
get_api_group_with_http_info
Method:
- This method is similar to
get_api_group
, but it also returns the HTTP status code and headers of the response. - It also doesn’t require any parameters.
- It returns a tuple containing the
V1APIGroup
object, the HTTP status code, and the headers.
Key Features:
- Auto-generated: This class is automatically generated from an OpenAPI specification for the apiregistration API.
- Synchronous and asynchronous calls: Methods can be called synchronously or asynchronously using the
async_req
parameter. - Error handling: The
ApiClient
class handles potential errors during API calls, and exceptions are raised accordingly. - Authentication: The
auth_settings
parameter specifies the authentication mechanism to be used for API calls (in this case, BearerToken). - HTTP request parameters: The methods allow specifying additional parameters for the HTTP request, such as headers, query parameters, and body data.
Usage:
To use the ApiregistrationApi
class, first create an instance:
api = ApiregistrationApi()
Then, call the methods to interact with the API:
api_group = api.get_api_group()
print(api_group)
or
api_group, status_code, headers = api.get_api_group_with_http_info()
print(api_group)
print(status_code)
print(headers)
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph