Exemplo n.º 1
0
 def default_configuration_from_auth(**auth):
     """ set Configuration class defaults based on provided auth """
     configuration = Configuration()
     if auth.get('api_key'):
         configuration.api_key = {
             'authorization': "Bearer %s" % auth.pop('api_key')
         }
     for k, v in auth.items():
         setattr(configuration, k, v)
     Configuration.set_default(configuration)
Exemplo n.º 2
0
 def __init__(self, websocket, **kwargs):
     self.websocket = websocket
     self.cols = int(kwargs.get('cols', 80))
     self.rows = int(kwargs.get('rows', 24))
     self.need_auth = bool(kwargs.get('need_auth', True))
     self.auth_ok = not self.need_auth
     conf = Configuration()
     conf.host = KUBERNETES_API_SERVER_URL
     conf.verify_ssl = False
     conf.api_key = {"authorization": "Bearer " + KUBERNETES_CLUSTER_TOKEN}
     self.api_client = core_v1_api.CoreV1Api(ApiClient(conf))
     self.api_response = None
Exemplo n.º 3
0
def get_kubernetes_api_client():
    conf = Configuration()
    conf.host = KUBERNETES_API_SERVER_URL
    conf.verify_ssl = False
    conf.api_key = {"authorization": "Bearer " + KUBERNETES_CLUSTER_TOKEN}
    return ApiClient(conf)