A simple Kubernetes Python API
Project description
Kubernetes Python API
This repository contains a simple Kubernetes Python API (Kube API). This API is built using the Official Python client library (Official API) for kubernetes
Loading the Configurations
A configuration file is required for calling the APIs. There are two ways for loading configurations:
- Set the "KUBERNETES_CONFIG" environment variable to the path of the configuration file. The configurations will be loaded automatically.
- Explicitly call
config.load_configuration(config_file_path).
Handling Exceptions
The official API raises exceptions when there is an error. Kube API will catch the ApiException and return an error message instead. This is implemented by wrapping the function calls to the official API using the api_request() function in utils.py.
When there is an error calling the official API, Kube API will return a JSON response containing the body of the ApiException (which is a dictionary-like object), plus three (3) additional fields:
- status, the status returned in the ApiException
- error, the reason of the error
- headers, the header of the ApiException
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kube_api-0.1.65.tar.gz.
File metadata
- Download URL: kube_api-0.1.65.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a11a7c4984509d8c841f08c1920bb0a1a42b0954b406f1ec0c0aea6eaa65a81a
|
|
| MD5 |
d3328f585791e98a48b1357998057342
|
|
| BLAKE2b-256 |
823bc4dcd7303976ef0937441379a70990ef0316fa7112a049dbf8bc6bce4f20
|
File details
Details for the file kube_api-0.1.65-py3-none-any.whl.
File metadata
- Download URL: kube_api-0.1.65-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be5aad51b1a06d859eddd4e71301a7c14e7e866ca728e6482bcdcbdf4498c731
|
|
| MD5 |
ca444a22a1de4da420085036651c5192
|
|
| BLAKE2b-256 |
4a83f5b09ef68dc680d4780ca8cc27836c37dfbf67f39846de3fc0ec51c609e8
|