github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/api/health_api.py (about)

     1  # coding: utf-8
     2  
     3  """
     4      Bacalhau API
     5  
     6      This page is the reference of the Bacalhau REST API. Project docs are available at https://docs.bacalhau.org/. Find more information about Bacalhau at https://github.com/filecoin-project/bacalhau.  # noqa: E501
     7  
     8      OpenAPI spec version: 0.3.22.post4
     9      Contact: team@bacalhau.org
    10      Generated by: https://github.com/swagger-api/swagger-codegen.git
    11  """
    12  
    13  
    14  from __future__ import absolute_import
    15  
    16  import re  # noqa: F401
    17  
    18  # python 2 and python 3 compatibility library
    19  import six
    20  
    21  from bacalhau_apiclient.api_client import ApiClient
    22  
    23  
    24  class HealthApi(object):
    25      """NOTE: This class is auto generated by the swagger code generator program.
    26  
    27      Do not edit the class manually.
    28      Ref: https://github.com/swagger-api/swagger-codegen
    29      """
    30  
    31      def __init__(self, api_client=None):
    32          if api_client is None:
    33              api_client = ApiClient()
    34          self.api_client = api_client
    35  
    36      def api_serverdebug(self, **kwargs):  # noqa: E501
    37          """Returns debug information on what the current node is doing.  # noqa: E501
    38  
    39          This method makes a synchronous HTTP request by default. To make an
    40          asynchronous HTTP request, please pass async_req=True
    41          >>> thread = api.api_serverdebug(async_req=True)
    42          >>> result = thread.get()
    43  
    44          :param async_req bool
    45          :return: str
    46                   If the method is called asynchronously,
    47                   returns the request thread.
    48          """
    49          kwargs['_return_http_data_only'] = True
    50          if kwargs.get('async_req'):
    51              return self.api_serverdebug_with_http_info(**kwargs)  # noqa: E501
    52          else:
    53              (data) = self.api_serverdebug_with_http_info(**kwargs)  # noqa: E501
    54              return data
    55  
    56      def api_serverdebug_with_http_info(self, **kwargs):  # noqa: E501
    57          """Returns debug information on what the current node is doing.  # noqa: E501
    58  
    59          This method makes a synchronous HTTP request by default. To make an
    60          asynchronous HTTP request, please pass async_req=True
    61          >>> thread = api.api_serverdebug_with_http_info(async_req=True)
    62          >>> result = thread.get()
    63  
    64          :param async_req bool
    65          :return: str
    66                   If the method is called asynchronously,
    67                   returns the request thread.
    68          """
    69  
    70          all_params = []  # noqa: E501
    71          all_params.append('async_req')
    72          all_params.append('_return_http_data_only')
    73          all_params.append('_preload_content')
    74          all_params.append('_request_timeout')
    75  
    76          params = locals()
    77          for key, val in six.iteritems(params['kwargs']):
    78              if key not in all_params:
    79                  raise TypeError(
    80                      "Got an unexpected keyword argument '%s'"
    81                      " to method api_serverdebug" % key
    82                  )
    83              params[key] = val
    84          del params['kwargs']
    85  
    86          collection_formats = {}
    87  
    88          path_params = {}
    89  
    90          query_params = []
    91  
    92          header_params = {}
    93  
    94          form_params = []
    95          local_var_files = {}
    96  
    97          body_params = None
    98          # HTTP header `Accept`
    99          header_params['Accept'] = self.api_client.select_header_accept(
   100              ['application/json'])  # noqa: E501
   101  
   102          # Authentication setting
   103          auth_settings = []  # noqa: E501
   104  
   105          return self.api_client.call_api(
   106              '/debug', 'GET',
   107              path_params,
   108              query_params,
   109              header_params,
   110              body=body_params,
   111              post_params=form_params,
   112              files=local_var_files,
   113              response_type='str',  # noqa: E501
   114              auth_settings=auth_settings,
   115              async_req=params.get('async_req'),
   116              _return_http_data_only=params.get('_return_http_data_only'),
   117              _preload_content=params.get('_preload_content', True),
   118              _request_timeout=params.get('_request_timeout'),
   119              collection_formats=collection_formats)
   120  
   121      def debug(self, **kwargs):  # noqa: E501
   122          """Returns debug information on what the current node is doing.  # noqa: E501
   123  
   124          This method makes a synchronous HTTP request by default. To make an
   125          asynchronous HTTP request, please pass async_req=True
   126          >>> thread = api.debug(async_req=True)
   127          >>> result = thread.get()
   128  
   129          :param async_req bool
   130          :return: str
   131                   If the method is called asynchronously,
   132                   returns the request thread.
   133          """
   134          kwargs['_return_http_data_only'] = True
   135          if kwargs.get('async_req'):
   136              return self.debug_with_http_info(**kwargs)  # noqa: E501
   137          else:
   138              (data) = self.debug_with_http_info(**kwargs)  # noqa: E501
   139              return data
   140  
   141      def debug_with_http_info(self, **kwargs):  # noqa: E501
   142          """Returns debug information on what the current node is doing.  # noqa: E501
   143  
   144          This method makes a synchronous HTTP request by default. To make an
   145          asynchronous HTTP request, please pass async_req=True
   146          >>> thread = api.debug_with_http_info(async_req=True)
   147          >>> result = thread.get()
   148  
   149          :param async_req bool
   150          :return: str
   151                   If the method is called asynchronously,
   152                   returns the request thread.
   153          """
   154  
   155          all_params = []  # noqa: E501
   156          all_params.append('async_req')
   157          all_params.append('_return_http_data_only')
   158          all_params.append('_preload_content')
   159          all_params.append('_request_timeout')
   160  
   161          params = locals()
   162          for key, val in six.iteritems(params['kwargs']):
   163              if key not in all_params:
   164                  raise TypeError(
   165                      "Got an unexpected keyword argument '%s'"
   166                      " to method debug" % key
   167                  )
   168              params[key] = val
   169          del params['kwargs']
   170  
   171          collection_formats = {}
   172  
   173          path_params = {}
   174  
   175          query_params = []
   176  
   177          header_params = {}
   178  
   179          form_params = []
   180          local_var_files = {}
   181  
   182          body_params = None
   183          # HTTP header `Accept`
   184          header_params['Accept'] = self.api_client.select_header_accept(
   185              ['application/json'])  # noqa: E501
   186  
   187          # Authentication setting
   188          auth_settings = []  # noqa: E501
   189  
   190          return self.api_client.call_api(
   191              '/requester/debug', 'GET',
   192              path_params,
   193              query_params,
   194              header_params,
   195              body=body_params,
   196              post_params=form_params,
   197              files=local_var_files,
   198              response_type='str',  # noqa: E501
   199              auth_settings=auth_settings,
   200              async_req=params.get('async_req'),
   201              _return_http_data_only=params.get('_return_http_data_only'),
   202              _preload_content=params.get('_preload_content', True),
   203              _request_timeout=params.get('_request_timeout'),
   204              collection_formats=collection_formats)