View on GitHub

lakeFS

lakeFS - Data version control for your data lake | Git for data

lakefs_sdk.RepositoriesApi

All URIs are relative to /api/v1

Method HTTP request Description
create_repository POST /repositories create repository
delete_gc_rules DELETE /repositories/{repository}/settings/gc_rules  
delete_repository DELETE /repositories/{repository} delete repository
dump_status GET /repositories/{repository}/dump Status of a repository dump task
dump_submit POST /repositories/{repository}/dump Backup the repository metadata (tags, commits, branches) and save the backup to the object store.
get_branch_protection_rules GET /repositories/{repository}/settings/branch_protection get branch protection rules
get_gc_rules GET /repositories/{repository}/settings/gc_rules get repository GC rules
get_repository GET /repositories/{repository} get repository
get_repository_metadata GET /repositories/{repository}/metadata get repository metadata
list_repositories GET /repositories list repositories
restore_status GET /repositories/{repository}/restore Status of a restore request
restore_submit POST /repositories/{repository}/restore Restore repository from a dump in the object store
set_branch_protection_rules PUT /repositories/{repository}/settings/branch_protection  
set_gc_rules PUT /repositories/{repository}/settings/gc_rules  

create_repository

Repository create_repository(repository_creation, bare=bare)

create repository

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.repository import Repository
from lakefs_sdk.models.repository_creation import RepositoryCreation
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.RepositoriesApi(api_client)
    repository_creation = lakefs_sdk.RepositoryCreation() # RepositoryCreation | 
    bare = False # bool | If true, create a bare repository with no initial commit and branch (optional) (default to False)

    try:
        # create repository
        api_response = api_instance.create_repository(repository_creation, bare=bare)
        print("The response of RepositoriesApi->create_repository:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->create_repository: %s\n" % e)

Parameters

Name Type Description Notes
repository_creation RepositoryCreation    
bare bool If true, create a bare repository with no initial commit and branch [optional] [default to False]

Return type

Repository

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
201 repository -
400 Validation Error -
401 Unauthorized -
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_gc_rules

delete_gc_rules(repository)

Example

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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        api_instance.delete_gc_rules(repository)
    except Exception as e:
        print("Exception when calling RepositoriesApi->delete_gc_rules: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 deleted garbage collection rules successfully -
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]

delete_repository

delete_repository(repository, force=force)

delete repository

Example

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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    force = False # bool | Bypass read-only protection and delete the repository (optional) (default to False)

    try:
        # delete repository
        api_instance.delete_repository(repository, force=force)
    except Exception as e:
        print("Exception when calling RepositoriesApi->delete_repository: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
force bool Bypass read-only protection and delete the repository [optional] [default to False]

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 repository deleted 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]

dump_status

RepositoryDumpStatus dump_status(repository, task_id)

Status of a repository dump task

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.repository_dump_status import RepositoryDumpStatus
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    task_id = 'task_id_example' # str | 

    try:
        # Status of a repository dump task
        api_response = api_instance.dump_status(repository, task_id)
        print("The response of RepositoriesApi->dump_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->dump_status: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
task_id str    

Return type

RepositoryDumpStatus

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 dump task status -
400 Validation Error -
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]

dump_submit

TaskInfo dump_submit(repository)

Backup the repository metadata (tags, commits, branches) and save the backup to the object store.

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.task_info import TaskInfo
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        # Backup the repository metadata (tags, commits, branches) and save the backup to the object store.
        api_response = api_instance.dump_submit(repository)
        print("The response of RepositoriesApi->dump_submit:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->dump_submit: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

TaskInfo

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
202 dump task information -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_branch_protection_rules

List[BranchProtectionRule] get_branch_protection_rules(repository)

get branch protection rules

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        # get branch protection rules
        api_response = api_instance.get_branch_protection_rules(repository)
        print("The response of RepositoriesApi->get_branch_protection_rules:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->get_branch_protection_rules: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

List[BranchProtectionRule]

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 branch protection rules * ETag -
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]

get_gc_rules

GarbageCollectionRules get_gc_rules(repository)

get repository GC rules

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        # get repository GC rules
        api_response = api_instance.get_gc_rules(repository)
        print("The response of RepositoriesApi->get_gc_rules:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->get_gc_rules: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

GarbageCollectionRules

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 repository GC rules -
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]

get_repository

Repository get_repository(repository)

get repository

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.repository import Repository
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        # get repository
        api_response = api_instance.get_repository(repository)
        print("The response of RepositoriesApi->get_repository:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->get_repository: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

Repository

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 repository -
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]

get_repository_metadata

Dict[str, str] get_repository_metadata(repository)

get repository metadata

Example

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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 

    try:
        # get repository metadata
        api_response = api_instance.get_repository_metadata(repository)
        print("The response of RepositoriesApi->get_repository_metadata:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->get_repository_metadata: %s\n" % e)

Parameters

Name Type Description Notes
repository str    

Return type

Dict[str, str]

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 repository metadata -
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_repositories

RepositoryList list_repositories(prefix=prefix, after=after, amount=amount)

list repositories

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.repository_list import RepositoryList
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.RepositoriesApi(api_client)
    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 repositories
        api_response = api_instance.list_repositories(prefix=prefix, after=after, amount=amount)
        print("The response of RepositoriesApi->list_repositories:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->list_repositories: %s\n" % e)

Parameters

Name Type Description Notes
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

RepositoryList

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 repository list -
401 Unauthorized -
420 too many requests -
0 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

restore_status

RepositoryRestoreStatus restore_status(repository, task_id)

Status of a restore request

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    task_id = 'task_id_example' # str | 

    try:
        # Status of a restore request
        api_response = api_instance.restore_status(repository, task_id)
        print("The response of RepositoriesApi->restore_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->restore_status: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
task_id str    

Return type

RepositoryRestoreStatus

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 restore task status -
400 Validation Error -
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]

restore_submit

TaskInfo restore_submit(repository, refs_restore)

Restore repository from a dump in the object store

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.refs_restore import RefsRestore
from lakefs_sdk.models.task_info import TaskInfo
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    refs_restore = lakefs_sdk.RefsRestore() # RefsRestore | 

    try:
        # Restore repository from a dump in the object store
        api_response = api_instance.restore_submit(repository, refs_restore)
        print("The response of RepositoriesApi->restore_submit:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RepositoriesApi->restore_submit: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
refs_restore RefsRestore    

Return type

TaskInfo

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
202 restore task created -
400 Validation Error -
403 Forbidden -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

set_branch_protection_rules

set_branch_protection_rules(repository, branch_protection_rule, if_match=if_match)

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    branch_protection_rule = [lakefs_sdk.BranchProtectionRule()] # List[BranchProtectionRule] | 
    if_match = 'if_match_example' # str | if provided, the branch protection rules will be updated only if the current ETag match the provided value (optional)

    try:
        api_instance.set_branch_protection_rules(repository, branch_protection_rule, if_match=if_match)
    except Exception as e:
        print("Exception when calling RepositoriesApi->set_branch_protection_rules: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch_protection_rule List[BranchProtectionRule]    
if_match str if provided, the branch protection rules will be updated only if the current ETag match the provided value [optional]

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 branch protection rule created successfully -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
412 Precondition Failed -
420 too many requests -
0 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

set_gc_rules

set_gc_rules(repository, garbage_collection_rules)

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules
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.RepositoriesApi(api_client)
    repository = 'repository_example' # str | 
    garbage_collection_rules = lakefs_sdk.GarbageCollectionRules() # GarbageCollectionRules | 

    try:
        api_instance.set_gc_rules(repository, garbage_collection_rules)
    except Exception as e:
        print("Exception when calling RepositoriesApi->set_gc_rules: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
garbage_collection_rules GarbageCollectionRules    

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 set garbage collection rules successfully -
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]