github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/docs/ExternalApi.md (about)

     1  # lakefs_client.ExternalApi
     2  
     3  All URIs are relative to *http://localhost/api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**create_user_external_principal**](ExternalApi.md#create_user_external_principal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user
     8  [**delete_user_external_principal**](ExternalApi.md#delete_user_external_principal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user
     9  [**external_principal_login**](ExternalApi.md#external_principal_login) | **POST** /auth/external/principal/login | perform a login using an external authenticator
    10  [**get_external_principal**](ExternalApi.md#get_external_principal) | **GET** /auth/external/principals | describe external principal by id
    11  [**list_user_external_principals**](ExternalApi.md#list_user_external_principals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user
    12  
    13  
    14  # **create_user_external_principal**
    15  > create_user_external_principal(user_id, principal_id)
    16  
    17  attach external principal to user
    18  
    19  ### Example
    20  
    21  * Basic Authentication (basic_auth):
    22  * Api Key Authentication (cookie_auth):
    23  * Bearer (JWT) Authentication (jwt_token):
    24  * Api Key Authentication (oidc_auth):
    25  * Api Key Authentication (saml_auth):
    26  
    27  ```python
    28  import time
    29  import lakefs_client
    30  from lakefs_client.api import external_api
    31  from lakefs_client.model.error import Error
    32  from lakefs_client.model.external_principal_creation import ExternalPrincipalCreation
    33  from pprint import pprint
    34  # Defining the host is optional and defaults to http://localhost/api/v1
    35  # See configuration.py for a list of all supported configuration parameters.
    36  configuration = lakefs_client.Configuration(
    37      host = "http://localhost/api/v1"
    38  )
    39  
    40  # The client must configure the authentication and authorization parameters
    41  # in accordance with the API server security policy.
    42  # Examples for each auth method are provided below, use the example that
    43  # satisfies your auth use case.
    44  
    45  # Configure HTTP basic authorization: basic_auth
    46  configuration = lakefs_client.Configuration(
    47      username = 'YOUR_USERNAME',
    48      password = 'YOUR_PASSWORD'
    49  )
    50  
    51  # Configure API key authorization: cookie_auth
    52  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
    53  
    54  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    55  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
    56  
    57  # Configure Bearer authorization (JWT): jwt_token
    58  configuration = lakefs_client.Configuration(
    59      access_token = 'YOUR_BEARER_TOKEN'
    60  )
    61  
    62  # Configure API key authorization: oidc_auth
    63  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
    64  
    65  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    66  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
    67  
    68  # Configure API key authorization: saml_auth
    69  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
    70  
    71  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    72  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
    73  
    74  # Enter a context with an instance of the API client
    75  with lakefs_client.ApiClient(configuration) as api_client:
    76      # Create an instance of the API class
    77      api_instance = external_api.ExternalApi(api_client)
    78      user_id = "userId_example" # str | 
    79      principal_id = "principalId_example" # str | 
    80      external_principal_creation = ExternalPrincipalCreation(
    81          settings=[
    82              ExternalPrincipalSettings(
    83                  key="key_example",
    84              ),
    85          ],
    86      ) # ExternalPrincipalCreation |  (optional)
    87  
    88      # example passing only required values which don't have defaults set
    89      try:
    90          # attach external principal to user
    91          api_instance.create_user_external_principal(user_id, principal_id)
    92      except lakefs_client.ApiException as e:
    93          print("Exception when calling ExternalApi->create_user_external_principal: %s\n" % e)
    94  
    95      # example passing only required values which don't have defaults set
    96      # and optional values
    97      try:
    98          # attach external principal to user
    99          api_instance.create_user_external_principal(user_id, principal_id, external_principal_creation=external_principal_creation)
   100      except lakefs_client.ApiException as e:
   101          print("Exception when calling ExternalApi->create_user_external_principal: %s\n" % e)
   102  ```
   103  
   104  
   105  ### Parameters
   106  
   107  Name | Type | Description  | Notes
   108  ------------- | ------------- | ------------- | -------------
   109   **user_id** | **str**|  |
   110   **principal_id** | **str**|  |
   111   **external_principal_creation** | [**ExternalPrincipalCreation**](ExternalPrincipalCreation.md)|  | [optional]
   112  
   113  ### Return type
   114  
   115  void (empty response body)
   116  
   117  ### Authorization
   118  
   119  [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth)
   120  
   121  ### HTTP request headers
   122  
   123   - **Content-Type**: application/json
   124   - **Accept**: application/json
   125  
   126  
   127  ### HTTP response details
   128  
   129  | Status code | Description | Response headers |
   130  |-------------|-------------|------------------|
   131  **201** | external principal attached successfully |  -  |
   132  **401** | Unauthorized |  -  |
   133  **404** | Resource Not Found |  -  |
   134  **409** | Resource Conflicts With Target |  -  |
   135  **420** | too many requests |  -  |
   136  **0** | Internal Server Error |  -  |
   137  
   138  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   139  
   140  # **delete_user_external_principal**
   141  > delete_user_external_principal(user_id, principal_id)
   142  
   143  delete external principal from user
   144  
   145  ### Example
   146  
   147  * Basic Authentication (basic_auth):
   148  * Api Key Authentication (cookie_auth):
   149  * Bearer (JWT) Authentication (jwt_token):
   150  * Api Key Authentication (oidc_auth):
   151  * Api Key Authentication (saml_auth):
   152  
   153  ```python
   154  import time
   155  import lakefs_client
   156  from lakefs_client.api import external_api
   157  from lakefs_client.model.error import Error
   158  from pprint import pprint
   159  # Defining the host is optional and defaults to http://localhost/api/v1
   160  # See configuration.py for a list of all supported configuration parameters.
   161  configuration = lakefs_client.Configuration(
   162      host = "http://localhost/api/v1"
   163  )
   164  
   165  # The client must configure the authentication and authorization parameters
   166  # in accordance with the API server security policy.
   167  # Examples for each auth method are provided below, use the example that
   168  # satisfies your auth use case.
   169  
   170  # Configure HTTP basic authorization: basic_auth
   171  configuration = lakefs_client.Configuration(
   172      username = 'YOUR_USERNAME',
   173      password = 'YOUR_PASSWORD'
   174  )
   175  
   176  # Configure API key authorization: cookie_auth
   177  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   178  
   179  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   180  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   181  
   182  # Configure Bearer authorization (JWT): jwt_token
   183  configuration = lakefs_client.Configuration(
   184      access_token = 'YOUR_BEARER_TOKEN'
   185  )
   186  
   187  # Configure API key authorization: oidc_auth
   188  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   189  
   190  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   191  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   192  
   193  # Configure API key authorization: saml_auth
   194  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   195  
   196  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   197  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   198  
   199  # Enter a context with an instance of the API client
   200  with lakefs_client.ApiClient(configuration) as api_client:
   201      # Create an instance of the API class
   202      api_instance = external_api.ExternalApi(api_client)
   203      user_id = "userId_example" # str | 
   204      principal_id = "principalId_example" # str | 
   205  
   206      # example passing only required values which don't have defaults set
   207      try:
   208          # delete external principal from user
   209          api_instance.delete_user_external_principal(user_id, principal_id)
   210      except lakefs_client.ApiException as e:
   211          print("Exception when calling ExternalApi->delete_user_external_principal: %s\n" % e)
   212  ```
   213  
   214  
   215  ### Parameters
   216  
   217  Name | Type | Description  | Notes
   218  ------------- | ------------- | ------------- | -------------
   219   **user_id** | **str**|  |
   220   **principal_id** | **str**|  |
   221  
   222  ### Return type
   223  
   224  void (empty response body)
   225  
   226  ### Authorization
   227  
   228  [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth)
   229  
   230  ### HTTP request headers
   231  
   232   - **Content-Type**: Not defined
   233   - **Accept**: application/json
   234  
   235  
   236  ### HTTP response details
   237  
   238  | Status code | Description | Response headers |
   239  |-------------|-------------|------------------|
   240  **204** | external principal detached successfully |  -  |
   241  **401** | Unauthorized |  -  |
   242  **404** | Resource Not Found |  -  |
   243  **420** | too many requests |  -  |
   244  **0** | Internal Server Error |  -  |
   245  
   246  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   247  
   248  # **external_principal_login**
   249  > AuthenticationToken external_principal_login()
   250  
   251  perform a login using an external authenticator
   252  
   253  ### Example
   254  
   255  
   256  ```python
   257  import time
   258  import lakefs_client
   259  from lakefs_client.api import external_api
   260  from lakefs_client.model.authentication_token import AuthenticationToken
   261  from lakefs_client.model.external_login_information import ExternalLoginInformation
   262  from lakefs_client.model.error import Error
   263  from pprint import pprint
   264  # Defining the host is optional and defaults to http://localhost/api/v1
   265  # See configuration.py for a list of all supported configuration parameters.
   266  configuration = lakefs_client.Configuration(
   267      host = "http://localhost/api/v1"
   268  )
   269  
   270  
   271  # Enter a context with an instance of the API client
   272  with lakefs_client.ApiClient() as api_client:
   273      # Create an instance of the API class
   274      api_instance = external_api.ExternalApi(api_client)
   275      external_login_information = ExternalLoginInformation(
   276          token_expiration_duration=1,
   277          identity_request={},
   278      ) # ExternalLoginInformation |  (optional)
   279  
   280      # example passing only required values which don't have defaults set
   281      # and optional values
   282      try:
   283          # perform a login using an external authenticator
   284          api_response = api_instance.external_principal_login(external_login_information=external_login_information)
   285          pprint(api_response)
   286      except lakefs_client.ApiException as e:
   287          print("Exception when calling ExternalApi->external_principal_login: %s\n" % e)
   288  ```
   289  
   290  
   291  ### Parameters
   292  
   293  Name | Type | Description  | Notes
   294  ------------- | ------------- | ------------- | -------------
   295   **external_login_information** | [**ExternalLoginInformation**](ExternalLoginInformation.md)|  | [optional]
   296  
   297  ### Return type
   298  
   299  [**AuthenticationToken**](AuthenticationToken.md)
   300  
   301  ### Authorization
   302  
   303  No authorization required
   304  
   305  ### HTTP request headers
   306  
   307   - **Content-Type**: application/json
   308   - **Accept**: application/json
   309  
   310  
   311  ### HTTP response details
   312  
   313  | Status code | Description | Response headers |
   314  |-------------|-------------|------------------|
   315  **200** | successful external login |  -  |
   316  **400** | Bad Request |  -  |
   317  **401** | Unauthorized |  -  |
   318  **403** | Forbidden |  -  |
   319  **404** | Resource Not Found |  -  |
   320  **420** | too many requests |  -  |
   321  **0** | Internal Server Error |  -  |
   322  
   323  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   324  
   325  # **get_external_principal**
   326  > ExternalPrincipal get_external_principal(principal_id)
   327  
   328  describe external principal by id
   329  
   330  ### Example
   331  
   332  * Basic Authentication (basic_auth):
   333  * Api Key Authentication (cookie_auth):
   334  * Bearer (JWT) Authentication (jwt_token):
   335  * Api Key Authentication (oidc_auth):
   336  * Api Key Authentication (saml_auth):
   337  
   338  ```python
   339  import time
   340  import lakefs_client
   341  from lakefs_client.api import external_api
   342  from lakefs_client.model.external_principal import ExternalPrincipal
   343  from lakefs_client.model.error import Error
   344  from pprint import pprint
   345  # Defining the host is optional and defaults to http://localhost/api/v1
   346  # See configuration.py for a list of all supported configuration parameters.
   347  configuration = lakefs_client.Configuration(
   348      host = "http://localhost/api/v1"
   349  )
   350  
   351  # The client must configure the authentication and authorization parameters
   352  # in accordance with the API server security policy.
   353  # Examples for each auth method are provided below, use the example that
   354  # satisfies your auth use case.
   355  
   356  # Configure HTTP basic authorization: basic_auth
   357  configuration = lakefs_client.Configuration(
   358      username = 'YOUR_USERNAME',
   359      password = 'YOUR_PASSWORD'
   360  )
   361  
   362  # Configure API key authorization: cookie_auth
   363  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   364  
   365  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   366  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   367  
   368  # Configure Bearer authorization (JWT): jwt_token
   369  configuration = lakefs_client.Configuration(
   370      access_token = 'YOUR_BEARER_TOKEN'
   371  )
   372  
   373  # Configure API key authorization: oidc_auth
   374  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   375  
   376  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   377  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   378  
   379  # Configure API key authorization: saml_auth
   380  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   381  
   382  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   383  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   384  
   385  # Enter a context with an instance of the API client
   386  with lakefs_client.ApiClient(configuration) as api_client:
   387      # Create an instance of the API class
   388      api_instance = external_api.ExternalApi(api_client)
   389      principal_id = "principalId_example" # str | 
   390  
   391      # example passing only required values which don't have defaults set
   392      try:
   393          # describe external principal by id
   394          api_response = api_instance.get_external_principal(principal_id)
   395          pprint(api_response)
   396      except lakefs_client.ApiException as e:
   397          print("Exception when calling ExternalApi->get_external_principal: %s\n" % e)
   398  ```
   399  
   400  
   401  ### Parameters
   402  
   403  Name | Type | Description  | Notes
   404  ------------- | ------------- | ------------- | -------------
   405   **principal_id** | **str**|  |
   406  
   407  ### Return type
   408  
   409  [**ExternalPrincipal**](ExternalPrincipal.md)
   410  
   411  ### Authorization
   412  
   413  [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth)
   414  
   415  ### HTTP request headers
   416  
   417   - **Content-Type**: Not defined
   418   - **Accept**: application/json
   419  
   420  
   421  ### HTTP response details
   422  
   423  | Status code | Description | Response headers |
   424  |-------------|-------------|------------------|
   425  **200** | external principal |  -  |
   426  **401** | Unauthorized |  -  |
   427  **404** | Resource Not Found |  -  |
   428  **420** | too many requests |  -  |
   429  **0** | Internal Server Error |  -  |
   430  
   431  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   432  
   433  # **list_user_external_principals**
   434  > ExternalPrincipalList list_user_external_principals(user_id)
   435  
   436  list user external policies attached to a user
   437  
   438  ### Example
   439  
   440  * Basic Authentication (basic_auth):
   441  * Api Key Authentication (cookie_auth):
   442  * Bearer (JWT) Authentication (jwt_token):
   443  * Api Key Authentication (oidc_auth):
   444  * Api Key Authentication (saml_auth):
   445  
   446  ```python
   447  import time
   448  import lakefs_client
   449  from lakefs_client.api import external_api
   450  from lakefs_client.model.error import Error
   451  from lakefs_client.model.external_principal_list import ExternalPrincipalList
   452  from pprint import pprint
   453  # Defining the host is optional and defaults to http://localhost/api/v1
   454  # See configuration.py for a list of all supported configuration parameters.
   455  configuration = lakefs_client.Configuration(
   456      host = "http://localhost/api/v1"
   457  )
   458  
   459  # The client must configure the authentication and authorization parameters
   460  # in accordance with the API server security policy.
   461  # Examples for each auth method are provided below, use the example that
   462  # satisfies your auth use case.
   463  
   464  # Configure HTTP basic authorization: basic_auth
   465  configuration = lakefs_client.Configuration(
   466      username = 'YOUR_USERNAME',
   467      password = 'YOUR_PASSWORD'
   468  )
   469  
   470  # Configure API key authorization: cookie_auth
   471  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   472  
   473  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   474  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   475  
   476  # Configure Bearer authorization (JWT): jwt_token
   477  configuration = lakefs_client.Configuration(
   478      access_token = 'YOUR_BEARER_TOKEN'
   479  )
   480  
   481  # Configure API key authorization: oidc_auth
   482  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   483  
   484  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   485  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   486  
   487  # Configure API key authorization: saml_auth
   488  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   489  
   490  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   491  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   492  
   493  # Enter a context with an instance of the API client
   494  with lakefs_client.ApiClient(configuration) as api_client:
   495      # Create an instance of the API class
   496      api_instance = external_api.ExternalApi(api_client)
   497      user_id = "userId_example" # str | 
   498      prefix = "prefix_example" # str | return items prefixed with this value (optional)
   499      after = "after_example" # str | return items after this value (optional)
   500      amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
   501  
   502      # example passing only required values which don't have defaults set
   503      try:
   504          # list user external policies attached to a user
   505          api_response = api_instance.list_user_external_principals(user_id)
   506          pprint(api_response)
   507      except lakefs_client.ApiException as e:
   508          print("Exception when calling ExternalApi->list_user_external_principals: %s\n" % e)
   509  
   510      # example passing only required values which don't have defaults set
   511      # and optional values
   512      try:
   513          # list user external policies attached to a user
   514          api_response = api_instance.list_user_external_principals(user_id, prefix=prefix, after=after, amount=amount)
   515          pprint(api_response)
   516      except lakefs_client.ApiException as e:
   517          print("Exception when calling ExternalApi->list_user_external_principals: %s\n" % e)
   518  ```
   519  
   520  
   521  ### Parameters
   522  
   523  Name | Type | Description  | Notes
   524  ------------- | ------------- | ------------- | -------------
   525   **user_id** | **str**|  |
   526   **prefix** | **str**| return items prefixed with this value | [optional]
   527   **after** | **str**| return items after this value | [optional]
   528   **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100
   529  
   530  ### Return type
   531  
   532  [**ExternalPrincipalList**](ExternalPrincipalList.md)
   533  
   534  ### Authorization
   535  
   536  [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth)
   537  
   538  ### HTTP request headers
   539  
   540   - **Content-Type**: Not defined
   541   - **Accept**: application/json
   542  
   543  
   544  ### HTTP response details
   545  
   546  | Status code | Description | Response headers |
   547  |-------------|-------------|------------------|
   548  **200** | external principals list |  -  |
   549  **401** | Unauthorized |  -  |
   550  **404** | Resource Not Found |  -  |
   551  **420** | too many requests |  -  |
   552  **0** | Internal Server Error |  -  |
   553  
   554  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   555