kubernetes.client.configuration module

Kubernetes

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: release-1.36 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

class kubernetes.client.configuration.APIKeyAuthSetting

Bases: dict

in: str
key: str
type: Literal['api_key']
value: str | None
class kubernetes.client.configuration.AuthSettings

Bases: dict

BearerToken: APIKeyAuthSetting
class kubernetes.client.configuration.BasicAuthSetting

Bases: dict

in: Literal['header']
key: Literal['Authorization']
type: Literal['basic']
value: str | None
class kubernetes.client.configuration.BearerAuthSetting

Bases: dict

in: Literal['header']
key: Literal['Authorization']
type: Literal['bearer']
value: str
class kubernetes.client.configuration.BearerFormatAuthSetting

Bases: dict

format: Literal['JWT']
in: Literal['header']
key: Literal['Authorization']
type: Literal['bearer']
value: str
class kubernetes.client.configuration.Configuration(host: str | None = None, api_key: Dict[str, str] | None = None, api_key_prefix: Dict[str, str] | None = None, username: str | None = None, password: str | None = None, access_token: str | None = None, server_index: int | None = None, server_variables: Dict[str, str] | None = None, server_operation_index: Dict[int, int] | None = None, server_operation_variables: Dict[int, Dict[str, str]] | None = None, ignore_operation_servers: bool = False, ssl_ca_cert: str | None = None, retries: int | Retry | None = None, ca_cert_data: str | bytes | None = None, cert_file: str | None = None, key_file: str | None = None, verify_ssl: bool = True, assert_hostname: bool | None = None, tls_server_name: str | None = None, connection_pool_maxsize: int | None = None, proxy: str | None = None, no_proxy: str | None = None, proxy_headers: Any | None = None, safe_chars_for_path_param: str = '', client_side_validation: bool = True, socket_options: Any | None = None, datetime_format: str = '%Y-%m-%dT%H:%M:%S.%f%z', date_format: str = '%Y-%m-%d', *, debug: bool | None = None)

Bases: object

This class contains various settings of the API client.

param host:

Base url.

:param ignore_operation_servers

Boolean to ignore operation servers for the API client. Config will use host as the base url regardless of the operation servers.

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 access_token:

Access token.

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 verify_ssl:

bool - Set this to false to skip verifying SSL certificate when calling API from https server.

param ssl_ca_cert:

str - the path to a file of concatenated CA certificates in PEM format.

param retries:

int | urllib3.util.retry.Retry - Retry configuration.

param ca_cert_data:

verify the peer using concatenated CA certificate data in PEM (str) or DER (bytes) format.

param cert_file:

the path to a client certificate file, for mTLS.

param key_file:

the path to a client key file, for mTLS.

param assert_hostname:

Set this to True/False to enable/disable SSL hostname verification.

param tls_server_name:

SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server.

param connection_pool_maxsize:

Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync.

param proxy:

Proxy URL.

param no_proxy:

Comma-separated hosts that bypass the proxy.

param proxy_headers:

Proxy headers.

param safe_chars_for_path_param:

Safe characters for path parameter encoding.

param client_side_validation:

Enable client-side validation. Default True.

param socket_options:

Options to pass down to the underlying urllib3 socket.

param datetime_format:

Datetime format string for serialization.

param date_format:

Date format string for serialization.

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

access_token

Access token

assert_hostname

Set this to True/False to enable/disable SSL hostname verification.

auth_settings() AuthSettings

Gets Auth Settings dict for api client.

Returns:

The Auth Settings information dict.

ca_cert_data

Set this to verify the peer using PEM (str) or DER (bytes) certificate data.

cert_file

client certificate file

connection_pool_maxsize

urllib3 connection pool’s maximum number of connections saved per pool. None in the constructor is coerced to cpu_count * 5.

date_format

date format

datetime_format

datetime format

property debug: bool

Debug status

Parameters:

value – The debug status, True or False.

Type:

bool

get_api_key_with_prefix(identifier: str, alias: str | None = None) str | None

Gets API key (with prefix if set).

Parameters:
  • identifier – The identifier of apiKey.

  • alias – The alternative identifier of apiKey.

Returns:

The token for api key authentication.

get_basic_auth_token() str | None

Gets HTTP basic authentication header (string).

Returns:

The token for basic HTTP authentication.

classmethod get_default() Self

Return the shared default configuration, creating it if needed.

Returns:

The configuration object.

classmethod get_default_copy() Self

Return a copy of the configured default, or a new configuration.

get_host_from_settings(index: int | None, variables: Dict[str, str] | None = None, servers: List[HostSetting] | None = None) str

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

get_host_settings() List[HostSetting]

Gets an array of host settings

Returns:

An array of host settings

property host: str

Return generated host.

ignore_operation_servers

Ignore operation servers

key_file

client key file

logger

Logging Settings

property logger_file: str | None

Debug file location

logger_file_handler: FileHandler | None

Log file handler

property logger_format: str

Log format

logger_stream_handler

Log stream handler

no_proxy

Hosts that bypass the proxy

password

Password for HTTP basic authentication

proxy

Proxy URL

proxy_headers

Proxy headers

refresh_api_key_hook

function hook to refresh API key if expired

retries

Retry configuration

safe_chars_for_path_param

Safe chars for path_param

server_operation_index

Default server index

server_operation_variables

Default server variables

classmethod set_default(default: Self | None) None

Store a copy as the default configuration.

Later changes to default do not affect the stored configuration. get_default returns the stored object, while get_default_copy returns a copy of it.

Parameters:

default – object of Configuration

socket_options

Options to pass down to the underlying urllib3 socket

ssl_ca_cert

Set this to customize the certificate file to verify the peer.

temp_folder_path

Temp file folder for downloading files

tls_server_name

SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.

to_debug_report() str

Gets the essential information for debugging.

Returns:

The report for debugging.

username

Username for HTTP basic authentication

verify_ssl

SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.

class kubernetes.client.configuration.GenericAuthSetting

Bases: dict

in: str
key: str
type: str
value: str
class kubernetes.client.configuration.HTTPSignatureAuthSetting

Bases: dict

in: Literal['header']
key: Literal['Authorization']
type: Literal['http-signature']
value: None
class kubernetes.client.configuration.HostSetting

Bases: TypedDict

description: str
url: str
variables: NotRequired[Dict[str, HostSettingVariable]]
class kubernetes.client.configuration.HostSettingVariable

Bases: TypedDict

default_value: str
description: str
enum_values: List[str]
class kubernetes.client.configuration.OAuth2AuthSetting

Bases: dict

in: Literal['header']
key: Literal['Authorization']
type: Literal['oauth2']
value: str