github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/lakefs_sdk/api/health_check_api.py (about)

     1  # coding: utf-8
     2  
     3  """
     4      lakeFS API
     5  
     6      lakeFS HTTP API
     7  
     8      The version of the OpenAPI document: 1.0.0
     9      Contact: services@treeverse.io
    10      Generated by OpenAPI Generator (https://openapi-generator.tech)
    11  
    12      Do not edit the class manually.
    13  """  # noqa: E501
    14  
    15  
    16  import re  # noqa: F401
    17  import io
    18  import warnings
    19  
    20  try:
    21      from pydantic.v1 import validate_arguments, ValidationError
    22  except ImportError:
    23      from pydantic import validate_arguments, ValidationError
    24  from typing_extensions import Annotated
    25  
    26  
    27  from lakefs_sdk.api_client import ApiClient
    28  from lakefs_sdk.api_response import ApiResponse
    29  from lakefs_sdk.exceptions import (  # noqa: F401
    30      ApiTypeError,
    31      ApiValueError
    32  )
    33  
    34  
    35  class HealthCheckApi(object):
    36      """NOTE: This class is auto generated by OpenAPI Generator
    37      Ref: https://openapi-generator.tech
    38  
    39      Do not edit the class manually.
    40      """
    41  
    42      def __init__(self, api_client=None):
    43          if api_client is None:
    44              api_client = ApiClient.get_default()
    45          self.api_client = api_client
    46  
    47      @validate_arguments
    48      def health_check(self, **kwargs) -> None:  # noqa: E501
    49          """health_check  # noqa: E501
    50  
    51          check that the API server is up and running  # noqa: E501
    52          This method makes a synchronous HTTP request by default. To make an
    53          asynchronous HTTP request, please pass async_req=True
    54  
    55          >>> thread = api.health_check(async_req=True)
    56          >>> result = thread.get()
    57  
    58          :param async_req: Whether to execute the request asynchronously.
    59          :type async_req: bool, optional
    60          :param _request_timeout: timeout setting for this request. If one
    61                                   number provided, it will be total request
    62                                   timeout. It can also be a pair (tuple) of
    63                                   (connection, read) timeouts.
    64          :return: Returns the result object.
    65                   If the method is called asynchronously,
    66                   returns the request thread.
    67          :rtype: None
    68          """
    69          kwargs['_return_http_data_only'] = True
    70          if '_preload_content' in kwargs:
    71              raise ValueError("Error! Please call the health_check_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
    72          return self.health_check_with_http_info(**kwargs)  # noqa: E501
    73  
    74      @validate_arguments
    75      def health_check_with_http_info(self, **kwargs) -> ApiResponse:  # noqa: E501
    76          """health_check  # noqa: E501
    77  
    78          check that the API server is up and running  # noqa: E501
    79          This method makes a synchronous HTTP request by default. To make an
    80          asynchronous HTTP request, please pass async_req=True
    81  
    82          >>> thread = api.health_check_with_http_info(async_req=True)
    83          >>> result = thread.get()
    84  
    85          :param async_req: Whether to execute the request asynchronously.
    86          :type async_req: bool, optional
    87          :param _preload_content: if False, the ApiResponse.data will
    88                                   be set to none and raw_data will store the 
    89                                   HTTP response body without reading/decoding.
    90                                   Default is True.
    91          :type _preload_content: bool, optional
    92          :param _return_http_data_only: response data instead of ApiResponse
    93                                         object with status code, headers, etc
    94          :type _return_http_data_only: bool, optional
    95          :param _request_timeout: timeout setting for this request. If one
    96                                   number provided, it will be total request
    97                                   timeout. It can also be a pair (tuple) of
    98                                   (connection, read) timeouts.
    99          :param _request_auth: set to override the auth_settings for an a single
   100                                request; this effectively ignores the authentication
   101                                in the spec for a single request.
   102          :type _request_auth: dict, optional
   103          :type _content_type: string, optional: force content-type for the request
   104          :return: Returns the result object.
   105                   If the method is called asynchronously,
   106                   returns the request thread.
   107          :rtype: None
   108          """
   109  
   110          _params = locals()
   111  
   112          _all_params = [
   113          ]
   114          _all_params.extend(
   115              [
   116                  'async_req',
   117                  '_return_http_data_only',
   118                  '_preload_content',
   119                  '_request_timeout',
   120                  '_request_auth',
   121                  '_content_type',
   122                  '_headers'
   123              ]
   124          )
   125  
   126          # validate the arguments
   127          for _key, _val in _params['kwargs'].items():
   128              if _key not in _all_params:
   129                  raise ApiTypeError(
   130                      "Got an unexpected keyword argument '%s'"
   131                      " to method health_check" % _key
   132                  )
   133              _params[_key] = _val
   134          del _params['kwargs']
   135  
   136          _collection_formats = {}
   137  
   138          # process the path parameters
   139          _path_params = {}
   140  
   141          # process the query parameters
   142          _query_params = []
   143          # process the header parameters
   144          _header_params = dict(_params.get('_headers', {}))
   145          # process the form parameters
   146          _form_params = []
   147          _files = {}
   148          # process the body parameter
   149          _body_params = None
   150          # authentication setting
   151          _auth_settings = []  # noqa: E501
   152  
   153          _response_types_map = {}
   154  
   155          return self.api_client.call_api(
   156              '/healthcheck', 'GET',
   157              _path_params,
   158              _query_params,
   159              _header_params,
   160              body=_body_params,
   161              post_params=_form_params,
   162              files=_files,
   163              response_types_map=_response_types_map,
   164              auth_settings=_auth_settings,
   165              async_req=_params.get('async_req'),
   166              _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
   167              _preload_content=_params.get('_preload_content', True),
   168              _request_timeout=_params.get('_request_timeout'),
   169              collection_formats=_collection_formats,
   170              _request_auth=_params.get('_request_auth'))