lakefs_sdk.ExternalApi
All URIs are relative to /api/v1
Method | HTTP request | Description |
---|---|---|
create_user_external_principal | POST /auth/users/{userId}/external/principals | attach external principal to user |
delete_user_external_principal | DELETE /auth/users/{userId}/external/principals | delete external principal from user |
external_principal_login | POST /auth/external/principal/login | perform a login using an external authenticator |
get_external_principal | GET /auth/external/principals | describe external principal by id |
list_user_external_principals | GET /auth/users/{userId}/external/principals/ls | list user external policies attached to a user |
create_user_external_principal
create_user_external_principal(user_id, principal_id, external_principal_creation=external_principal_creation)
attach external principal to user
Example
- Basic Authentication (basic_auth):
- Api Key Authentication (cookie_auth):
- Api Key Authentication (oidc_auth):
- Api Key Authentication (saml_auth):
- Bearer (JWT) Authentication (jwt_token): ```python import time import os import lakefs_sdk from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.rest import ApiException from pprint import pprint
Defining the host is optional and defaults to /api/v1
See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_sdk.Configuration( host = “/api/v1” )
The client must configure the authentication and authorization parameters
in accordance with the API server security policy.
Examples for each auth method are provided below, use the example that
satisfies your auth use case.
Configure HTTP basic authorization: basic_auth
configuration = lakefs_sdk.Configuration( username = os.environ[“USERNAME”], password = os.environ[“PASSWORD”] )
Configure API key authorization: cookie_auth
configuration.api_key[‘cookie_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘cookie_auth’] = ‘Bearer’
Configure API key authorization: oidc_auth
configuration.api_key[‘oidc_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘oidc_auth’] = ‘Bearer’
Configure API key authorization: saml_auth
configuration.api_key[‘saml_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘saml_auth’] = ‘Bearer’
Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_sdk.Configuration( access_token = os.environ[“BEARER_TOKEN”] )
Enter a context with an instance of the API client
with lakefs_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lakefs_sdk.ExternalApi(api_client) user_id = ‘user_id_example’ # str | principal_id = ‘principal_id_example’ # str | external_principal_creation = lakefs_sdk.ExternalPrincipalCreation() # ExternalPrincipalCreation | (optional)
try:
# attach external principal to user
api_instance.create_user_external_principal(user_id, principal_id, external_principal_creation=external_principal_creation)
except Exception as e:
print("Exception when calling ExternalApi->create_user_external_principal: %s\n" % e) ```
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | str | ||
principal_id | str | ||
external_principal_creation | ExternalPrincipalCreation | [optional] |
Return type
void (empty response body)
Authorization
basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | external principal attached successfully | - |
401 | Unauthorized | - |
404 | Resource Not Found | - |
409 | Resource Conflicts With Target | - |
420 | too many requests | - |
0 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_user_external_principal
delete_user_external_principal(user_id, principal_id)
delete external principal from user
Example
- Basic Authentication (basic_auth):
- Api Key Authentication (cookie_auth):
- Api Key Authentication (oidc_auth):
- Api Key Authentication (saml_auth):
- Bearer (JWT) Authentication (jwt_token): ```python import time import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint
Defining the host is optional and defaults to /api/v1
See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_sdk.Configuration( host = “/api/v1” )
The client must configure the authentication and authorization parameters
in accordance with the API server security policy.
Examples for each auth method are provided below, use the example that
satisfies your auth use case.
Configure HTTP basic authorization: basic_auth
configuration = lakefs_sdk.Configuration( username = os.environ[“USERNAME”], password = os.environ[“PASSWORD”] )
Configure API key authorization: cookie_auth
configuration.api_key[‘cookie_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘cookie_auth’] = ‘Bearer’
Configure API key authorization: oidc_auth
configuration.api_key[‘oidc_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘oidc_auth’] = ‘Bearer’
Configure API key authorization: saml_auth
configuration.api_key[‘saml_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘saml_auth’] = ‘Bearer’
Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_sdk.Configuration( access_token = os.environ[“BEARER_TOKEN”] )
Enter a context with an instance of the API client
with lakefs_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lakefs_sdk.ExternalApi(api_client) user_id = ‘user_id_example’ # str | principal_id = ‘principal_id_example’ # str |
try:
# delete external principal from user
api_instance.delete_user_external_principal(user_id, principal_id)
except Exception as e:
print("Exception when calling ExternalApi->delete_user_external_principal: %s\n" % e) ```
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | str | ||
principal_id | str |
Return type
void (empty response body)
Authorization
basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | external principal detached successfully | - |
401 | Unauthorized | - |
404 | Resource Not Found | - |
420 | too many requests | - |
0 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
external_principal_login
AuthenticationToken external_principal_login(external_login_information=external_login_information)
perform a login using an external authenticator
Example
import time
import os
import lakefs_sdk
from lakefs_sdk.models.authentication_token import AuthenticationToken
from lakefs_sdk.models.external_login_information import ExternalLoginInformation
from lakefs_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_sdk.Configuration(
host = "/api/v1"
)
# Enter a context with an instance of the API client
with lakefs_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lakefs_sdk.ExternalApi(api_client)
external_login_information = lakefs_sdk.ExternalLoginInformation() # ExternalLoginInformation | (optional)
try:
# perform a login using an external authenticator
api_response = api_instance.external_principal_login(external_login_information=external_login_information)
print("The response of ExternalApi->external_principal_login:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExternalApi->external_principal_login: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
external_login_information | ExternalLoginInformation | [optional] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful external login | - |
400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
420 | too many requests | - |
0 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_external_principal
ExternalPrincipal get_external_principal(principal_id)
describe external principal by id
Example
- Basic Authentication (basic_auth):
- Api Key Authentication (cookie_auth):
- Api Key Authentication (oidc_auth):
- Api Key Authentication (saml_auth):
- Bearer (JWT) Authentication (jwt_token): ```python import time import os import lakefs_sdk from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.rest import ApiException from pprint import pprint
Defining the host is optional and defaults to /api/v1
See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_sdk.Configuration( host = “/api/v1” )
The client must configure the authentication and authorization parameters
in accordance with the API server security policy.
Examples for each auth method are provided below, use the example that
satisfies your auth use case.
Configure HTTP basic authorization: basic_auth
configuration = lakefs_sdk.Configuration( username = os.environ[“USERNAME”], password = os.environ[“PASSWORD”] )
Configure API key authorization: cookie_auth
configuration.api_key[‘cookie_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘cookie_auth’] = ‘Bearer’
Configure API key authorization: oidc_auth
configuration.api_key[‘oidc_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘oidc_auth’] = ‘Bearer’
Configure API key authorization: saml_auth
configuration.api_key[‘saml_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘saml_auth’] = ‘Bearer’
Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_sdk.Configuration( access_token = os.environ[“BEARER_TOKEN”] )
Enter a context with an instance of the API client
with lakefs_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lakefs_sdk.ExternalApi(api_client) principal_id = ‘principal_id_example’ # str |
try:
# describe external principal by id
api_response = api_instance.get_external_principal(principal_id)
print("The response of ExternalApi->get_external_principal:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExternalApi->get_external_principal: %s\n" % e) ```
Parameters
Name | Type | Description | Notes |
---|---|---|---|
principal_id | str |
Return type
Authorization
basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | external principal | - |
401 | Unauthorized | - |
404 | Resource Not Found | - |
420 | too many requests | - |
0 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list_user_external_principals
ExternalPrincipalList list_user_external_principals(user_id, prefix=prefix, after=after, amount=amount)
list user external policies attached to a user
Example
- Basic Authentication (basic_auth):
- Api Key Authentication (cookie_auth):
- Api Key Authentication (oidc_auth):
- Api Key Authentication (saml_auth):
- Bearer (JWT) Authentication (jwt_token): ```python import time import os import lakefs_sdk from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.rest import ApiException from pprint import pprint
Defining the host is optional and defaults to /api/v1
See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_sdk.Configuration( host = “/api/v1” )
The client must configure the authentication and authorization parameters
in accordance with the API server security policy.
Examples for each auth method are provided below, use the example that
satisfies your auth use case.
Configure HTTP basic authorization: basic_auth
configuration = lakefs_sdk.Configuration( username = os.environ[“USERNAME”], password = os.environ[“PASSWORD”] )
Configure API key authorization: cookie_auth
configuration.api_key[‘cookie_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘cookie_auth’] = ‘Bearer’
Configure API key authorization: oidc_auth
configuration.api_key[‘oidc_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘oidc_auth’] = ‘Bearer’
Configure API key authorization: saml_auth
configuration.api_key[‘saml_auth’] = os.environ[“API_KEY”]
Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
configuration.api_key_prefix[‘saml_auth’] = ‘Bearer’
Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_sdk.Configuration( access_token = os.environ[“BEARER_TOKEN”] )
Enter a context with an instance of the API client
with lakefs_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lakefs_sdk.ExternalApi(api_client) user_id = ‘user_id_example’ # str | prefix = ‘prefix_example’ # str | return items prefixed with this value (optional) after = ‘after_example’ # str | return items after this value (optional) amount = 100 # int | how many items to return (optional) (default to 100)
try:
# list user external policies attached to a user
api_response = api_instance.list_user_external_principals(user_id, prefix=prefix, after=after, amount=amount)
print("The response of ExternalApi->list_user_external_principals:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExternalApi->list_user_external_principals: %s\n" % e) ```
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | str | ||
prefix | str | return items prefixed with this value | [optional] |
after | str | return items after this value | [optional] |
amount | int | how many items to return | [optional] [default to 100] |
Return type
Authorization
basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | external principals list | - |
401 | Unauthorized | - |
404 | Resource Not Found | - |
420 | too many requests | - |
0 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]