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

     1  """
     2      lakeFS API
     3  
     4      lakeFS HTTP API  # noqa: E501
     5  
     6      The version of the OpenAPI document: 1.0.0
     7      Contact: services@treeverse.io
     8      Generated by: https://openapi-generator.tech
     9  """
    10  
    11  
    12  import re  # noqa: F401
    13  import sys  # noqa: F401
    14  
    15  from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint
    16  from lakefs_client.model_utils import (  # noqa: F401
    17      check_allowed_values,
    18      check_validations,
    19      date,
    20      datetime,
    21      file_type,
    22      none_type,
    23      validate_and_convert_types
    24  )
    25  from lakefs_client.model.action_run import ActionRun
    26  from lakefs_client.model.action_run_list import ActionRunList
    27  from lakefs_client.model.error import Error
    28  from lakefs_client.model.hook_run_list import HookRunList
    29  
    30  
    31  class ActionsApi(object):
    32      """NOTE: This class is auto generated by OpenAPI Generator
    33      Ref: https://openapi-generator.tech
    34  
    35      Do not edit the class manually.
    36      """
    37  
    38      def __init__(self, api_client=None):
    39          if api_client is None:
    40              api_client = ApiClient()
    41          self.api_client = api_client
    42          self.get_run_endpoint = _Endpoint(
    43              settings={
    44                  'response_type': (ActionRun,),
    45                  'auth': [
    46                      'basic_auth',
    47                      'cookie_auth',
    48                      'jwt_token',
    49                      'oidc_auth',
    50                      'saml_auth'
    51                  ],
    52                  'endpoint_path': '/repositories/{repository}/actions/runs/{run_id}',
    53                  'operation_id': 'get_run',
    54                  'http_method': 'GET',
    55                  'servers': None,
    56              },
    57              params_map={
    58                  'all': [
    59                      'repository',
    60                      'run_id',
    61                  ],
    62                  'required': [
    63                      'repository',
    64                      'run_id',
    65                  ],
    66                  'nullable': [
    67                  ],
    68                  'enum': [
    69                  ],
    70                  'validation': [
    71                  ]
    72              },
    73              root_map={
    74                  'validations': {
    75                  },
    76                  'allowed_values': {
    77                  },
    78                  'openapi_types': {
    79                      'repository':
    80                          (str,),
    81                      'run_id':
    82                          (str,),
    83                  },
    84                  'attribute_map': {
    85                      'repository': 'repository',
    86                      'run_id': 'run_id',
    87                  },
    88                  'location_map': {
    89                      'repository': 'path',
    90                      'run_id': 'path',
    91                  },
    92                  'collection_format_map': {
    93                  }
    94              },
    95              headers_map={
    96                  'accept': [
    97                      'application/json'
    98                  ],
    99                  'content_type': [],
   100              },
   101              api_client=api_client
   102          )
   103          self.get_run_hook_output_endpoint = _Endpoint(
   104              settings={
   105                  'response_type': (file_type,),
   106                  'auth': [
   107                      'basic_auth',
   108                      'cookie_auth',
   109                      'jwt_token',
   110                      'oidc_auth',
   111                      'saml_auth'
   112                  ],
   113                  'endpoint_path': '/repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output',
   114                  'operation_id': 'get_run_hook_output',
   115                  'http_method': 'GET',
   116                  'servers': None,
   117              },
   118              params_map={
   119                  'all': [
   120                      'repository',
   121                      'run_id',
   122                      'hook_run_id',
   123                  ],
   124                  'required': [
   125                      'repository',
   126                      'run_id',
   127                      'hook_run_id',
   128                  ],
   129                  'nullable': [
   130                  ],
   131                  'enum': [
   132                  ],
   133                  'validation': [
   134                  ]
   135              },
   136              root_map={
   137                  'validations': {
   138                  },
   139                  'allowed_values': {
   140                  },
   141                  'openapi_types': {
   142                      'repository':
   143                          (str,),
   144                      'run_id':
   145                          (str,),
   146                      'hook_run_id':
   147                          (str,),
   148                  },
   149                  'attribute_map': {
   150                      'repository': 'repository',
   151                      'run_id': 'run_id',
   152                      'hook_run_id': 'hook_run_id',
   153                  },
   154                  'location_map': {
   155                      'repository': 'path',
   156                      'run_id': 'path',
   157                      'hook_run_id': 'path',
   158                  },
   159                  'collection_format_map': {
   160                  }
   161              },
   162              headers_map={
   163                  'accept': [
   164                      'application/octet-stream',
   165                      'application/json'
   166                  ],
   167                  'content_type': [],
   168              },
   169              api_client=api_client
   170          )
   171          self.list_repository_runs_endpoint = _Endpoint(
   172              settings={
   173                  'response_type': (ActionRunList,),
   174                  'auth': [
   175                      'basic_auth',
   176                      'cookie_auth',
   177                      'jwt_token',
   178                      'oidc_auth',
   179                      'saml_auth'
   180                  ],
   181                  'endpoint_path': '/repositories/{repository}/actions/runs',
   182                  'operation_id': 'list_repository_runs',
   183                  'http_method': 'GET',
   184                  'servers': None,
   185              },
   186              params_map={
   187                  'all': [
   188                      'repository',
   189                      'after',
   190                      'amount',
   191                      'branch',
   192                      'commit',
   193                  ],
   194                  'required': [
   195                      'repository',
   196                  ],
   197                  'nullable': [
   198                  ],
   199                  'enum': [
   200                  ],
   201                  'validation': [
   202                      'amount',
   203                  ]
   204              },
   205              root_map={
   206                  'validations': {
   207                      ('amount',): {
   208  
   209                          'inclusive_maximum': 1000,
   210                          'inclusive_minimum': -1,
   211                      },
   212                  },
   213                  'allowed_values': {
   214                  },
   215                  'openapi_types': {
   216                      'repository':
   217                          (str,),
   218                      'after':
   219                          (str,),
   220                      'amount':
   221                          (int,),
   222                      'branch':
   223                          (str,),
   224                      'commit':
   225                          (str,),
   226                  },
   227                  'attribute_map': {
   228                      'repository': 'repository',
   229                      'after': 'after',
   230                      'amount': 'amount',
   231                      'branch': 'branch',
   232                      'commit': 'commit',
   233                  },
   234                  'location_map': {
   235                      'repository': 'path',
   236                      'after': 'query',
   237                      'amount': 'query',
   238                      'branch': 'query',
   239                      'commit': 'query',
   240                  },
   241                  'collection_format_map': {
   242                  }
   243              },
   244              headers_map={
   245                  'accept': [
   246                      'application/json'
   247                  ],
   248                  'content_type': [],
   249              },
   250              api_client=api_client
   251          )
   252          self.list_run_hooks_endpoint = _Endpoint(
   253              settings={
   254                  'response_type': (HookRunList,),
   255                  'auth': [
   256                      'basic_auth',
   257                      'cookie_auth',
   258                      'jwt_token',
   259                      'oidc_auth',
   260                      'saml_auth'
   261                  ],
   262                  'endpoint_path': '/repositories/{repository}/actions/runs/{run_id}/hooks',
   263                  'operation_id': 'list_run_hooks',
   264                  'http_method': 'GET',
   265                  'servers': None,
   266              },
   267              params_map={
   268                  'all': [
   269                      'repository',
   270                      'run_id',
   271                      'after',
   272                      'amount',
   273                  ],
   274                  'required': [
   275                      'repository',
   276                      'run_id',
   277                  ],
   278                  'nullable': [
   279                  ],
   280                  'enum': [
   281                  ],
   282                  'validation': [
   283                      'amount',
   284                  ]
   285              },
   286              root_map={
   287                  'validations': {
   288                      ('amount',): {
   289  
   290                          'inclusive_maximum': 1000,
   291                          'inclusive_minimum': -1,
   292                      },
   293                  },
   294                  'allowed_values': {
   295                  },
   296                  'openapi_types': {
   297                      'repository':
   298                          (str,),
   299                      'run_id':
   300                          (str,),
   301                      'after':
   302                          (str,),
   303                      'amount':
   304                          (int,),
   305                  },
   306                  'attribute_map': {
   307                      'repository': 'repository',
   308                      'run_id': 'run_id',
   309                      'after': 'after',
   310                      'amount': 'amount',
   311                  },
   312                  'location_map': {
   313                      'repository': 'path',
   314                      'run_id': 'path',
   315                      'after': 'query',
   316                      'amount': 'query',
   317                  },
   318                  'collection_format_map': {
   319                  }
   320              },
   321              headers_map={
   322                  'accept': [
   323                      'application/json'
   324                  ],
   325                  'content_type': [],
   326              },
   327              api_client=api_client
   328          )
   329  
   330      def get_run(
   331          self,
   332          repository,
   333          run_id,
   334          **kwargs
   335      ):
   336          """get a run  # noqa: E501
   337  
   338          This method makes a synchronous HTTP request by default. To make an
   339          asynchronous HTTP request, please pass async_req=True
   340  
   341          >>> thread = api.get_run(repository, run_id, async_req=True)
   342          >>> result = thread.get()
   343  
   344          Args:
   345              repository (str):
   346              run_id (str):
   347  
   348          Keyword Args:
   349              _return_http_data_only (bool): response data without head status
   350                  code and headers. Default is True.
   351              _preload_content (bool): if False, the urllib3.HTTPResponse object
   352                  will be returned without reading/decoding response data.
   353                  Default is True.
   354              _request_timeout (int/float/tuple): timeout setting for this request. If
   355                  one number provided, it will be total request timeout. It can also
   356                  be a pair (tuple) of (connection, read) timeouts.
   357                  Default is None.
   358              _check_input_type (bool): specifies if type checking
   359                  should be done one the data sent to the server.
   360                  Default is True.
   361              _check_return_type (bool): specifies if type checking
   362                  should be done one the data received from the server.
   363                  Default is True.
   364              _host_index (int/None): specifies the index of the server
   365                  that we want to use.
   366                  Default is read from the configuration.
   367              async_req (bool): execute request asynchronously
   368  
   369          Returns:
   370              ActionRun
   371                  If the method is called asynchronously, returns the request
   372                  thread.
   373          """
   374          kwargs['async_req'] = kwargs.get(
   375              'async_req', False
   376          )
   377          kwargs['_return_http_data_only'] = kwargs.get(
   378              '_return_http_data_only', True
   379          )
   380          kwargs['_preload_content'] = kwargs.get(
   381              '_preload_content', True
   382          )
   383          kwargs['_request_timeout'] = kwargs.get(
   384              '_request_timeout', None
   385          )
   386          kwargs['_check_input_type'] = kwargs.get(
   387              '_check_input_type', True
   388          )
   389          kwargs['_check_return_type'] = kwargs.get(
   390              '_check_return_type', True
   391          )
   392          kwargs['_host_index'] = kwargs.get('_host_index')
   393          kwargs['repository'] = \
   394              repository
   395          kwargs['run_id'] = \
   396              run_id
   397          return self.get_run_endpoint.call_with_http_info(**kwargs)
   398  
   399      def get_run_hook_output(
   400          self,
   401          repository,
   402          run_id,
   403          hook_run_id,
   404          **kwargs
   405      ):
   406          """get run hook output  # noqa: E501
   407  
   408          This method makes a synchronous HTTP request by default. To make an
   409          asynchronous HTTP request, please pass async_req=True
   410  
   411          >>> thread = api.get_run_hook_output(repository, run_id, hook_run_id, async_req=True)
   412          >>> result = thread.get()
   413  
   414          Args:
   415              repository (str):
   416              run_id (str):
   417              hook_run_id (str):
   418  
   419          Keyword Args:
   420              _return_http_data_only (bool): response data without head status
   421                  code and headers. Default is True.
   422              _preload_content (bool): if False, the urllib3.HTTPResponse object
   423                  will be returned without reading/decoding response data.
   424                  Default is True.
   425              _request_timeout (int/float/tuple): timeout setting for this request. If
   426                  one number provided, it will be total request timeout. It can also
   427                  be a pair (tuple) of (connection, read) timeouts.
   428                  Default is None.
   429              _check_input_type (bool): specifies if type checking
   430                  should be done one the data sent to the server.
   431                  Default is True.
   432              _check_return_type (bool): specifies if type checking
   433                  should be done one the data received from the server.
   434                  Default is True.
   435              _host_index (int/None): specifies the index of the server
   436                  that we want to use.
   437                  Default is read from the configuration.
   438              async_req (bool): execute request asynchronously
   439  
   440          Returns:
   441              file_type
   442                  If the method is called asynchronously, returns the request
   443                  thread.
   444          """
   445          kwargs['async_req'] = kwargs.get(
   446              'async_req', False
   447          )
   448          kwargs['_return_http_data_only'] = kwargs.get(
   449              '_return_http_data_only', True
   450          )
   451          kwargs['_preload_content'] = kwargs.get(
   452              '_preload_content', True
   453          )
   454          kwargs['_request_timeout'] = kwargs.get(
   455              '_request_timeout', None
   456          )
   457          kwargs['_check_input_type'] = kwargs.get(
   458              '_check_input_type', True
   459          )
   460          kwargs['_check_return_type'] = kwargs.get(
   461              '_check_return_type', True
   462          )
   463          kwargs['_host_index'] = kwargs.get('_host_index')
   464          kwargs['repository'] = \
   465              repository
   466          kwargs['run_id'] = \
   467              run_id
   468          kwargs['hook_run_id'] = \
   469              hook_run_id
   470          return self.get_run_hook_output_endpoint.call_with_http_info(**kwargs)
   471  
   472      def list_repository_runs(
   473          self,
   474          repository,
   475          **kwargs
   476      ):
   477          """list runs  # noqa: E501
   478  
   479          This method makes a synchronous HTTP request by default. To make an
   480          asynchronous HTTP request, please pass async_req=True
   481  
   482          >>> thread = api.list_repository_runs(repository, async_req=True)
   483          >>> result = thread.get()
   484  
   485          Args:
   486              repository (str):
   487  
   488          Keyword Args:
   489              after (str): return items after this value. [optional]
   490              amount (int): how many items to return. [optional] if omitted the server will use the default value of 100
   491              branch (str): [optional]
   492              commit (str): [optional]
   493              _return_http_data_only (bool): response data without head status
   494                  code and headers. Default is True.
   495              _preload_content (bool): if False, the urllib3.HTTPResponse object
   496                  will be returned without reading/decoding response data.
   497                  Default is True.
   498              _request_timeout (int/float/tuple): timeout setting for this request. If
   499                  one number provided, it will be total request timeout. It can also
   500                  be a pair (tuple) of (connection, read) timeouts.
   501                  Default is None.
   502              _check_input_type (bool): specifies if type checking
   503                  should be done one the data sent to the server.
   504                  Default is True.
   505              _check_return_type (bool): specifies if type checking
   506                  should be done one the data received from the server.
   507                  Default is True.
   508              _host_index (int/None): specifies the index of the server
   509                  that we want to use.
   510                  Default is read from the configuration.
   511              async_req (bool): execute request asynchronously
   512  
   513          Returns:
   514              ActionRunList
   515                  If the method is called asynchronously, returns the request
   516                  thread.
   517          """
   518          kwargs['async_req'] = kwargs.get(
   519              'async_req', False
   520          )
   521          kwargs['_return_http_data_only'] = kwargs.get(
   522              '_return_http_data_only', True
   523          )
   524          kwargs['_preload_content'] = kwargs.get(
   525              '_preload_content', True
   526          )
   527          kwargs['_request_timeout'] = kwargs.get(
   528              '_request_timeout', None
   529          )
   530          kwargs['_check_input_type'] = kwargs.get(
   531              '_check_input_type', True
   532          )
   533          kwargs['_check_return_type'] = kwargs.get(
   534              '_check_return_type', True
   535          )
   536          kwargs['_host_index'] = kwargs.get('_host_index')
   537          kwargs['repository'] = \
   538              repository
   539          return self.list_repository_runs_endpoint.call_with_http_info(**kwargs)
   540  
   541      def list_run_hooks(
   542          self,
   543          repository,
   544          run_id,
   545          **kwargs
   546      ):
   547          """list run hooks  # noqa: E501
   548  
   549          This method makes a synchronous HTTP request by default. To make an
   550          asynchronous HTTP request, please pass async_req=True
   551  
   552          >>> thread = api.list_run_hooks(repository, run_id, async_req=True)
   553          >>> result = thread.get()
   554  
   555          Args:
   556              repository (str):
   557              run_id (str):
   558  
   559          Keyword Args:
   560              after (str): return items after this value. [optional]
   561              amount (int): how many items to return. [optional] if omitted the server will use the default value of 100
   562              _return_http_data_only (bool): response data without head status
   563                  code and headers. Default is True.
   564              _preload_content (bool): if False, the urllib3.HTTPResponse object
   565                  will be returned without reading/decoding response data.
   566                  Default is True.
   567              _request_timeout (int/float/tuple): timeout setting for this request. If
   568                  one number provided, it will be total request timeout. It can also
   569                  be a pair (tuple) of (connection, read) timeouts.
   570                  Default is None.
   571              _check_input_type (bool): specifies if type checking
   572                  should be done one the data sent to the server.
   573                  Default is True.
   574              _check_return_type (bool): specifies if type checking
   575                  should be done one the data received from the server.
   576                  Default is True.
   577              _host_index (int/None): specifies the index of the server
   578                  that we want to use.
   579                  Default is read from the configuration.
   580              async_req (bool): execute request asynchronously
   581  
   582          Returns:
   583              HookRunList
   584                  If the method is called asynchronously, returns the request
   585                  thread.
   586          """
   587          kwargs['async_req'] = kwargs.get(
   588              'async_req', False
   589          )
   590          kwargs['_return_http_data_only'] = kwargs.get(
   591              '_return_http_data_only', True
   592          )
   593          kwargs['_preload_content'] = kwargs.get(
   594              '_preload_content', True
   595          )
   596          kwargs['_request_timeout'] = kwargs.get(
   597              '_request_timeout', None
   598          )
   599          kwargs['_check_input_type'] = kwargs.get(
   600              '_check_input_type', True
   601          )
   602          kwargs['_check_return_type'] = kwargs.get(
   603              '_check_return_type', True
   604          )
   605          kwargs['_host_index'] = kwargs.get('_host_index')
   606          kwargs['repository'] = \
   607              repository
   608          kwargs['run_id'] = \
   609              run_id
   610          return self.list_run_hooks_endpoint.call_with_http_info(**kwargs)
   611