View on GitHub

lakeFS

Git-like capabilities for your object storage

lakefs_client.BranchesApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
create_branch POST /repositories/{repository}/branches create branch
delete_branch DELETE /repositories/{repository}/branches/{branch} delete branch
diff_branch GET /repositories/{repository}/branches/{branch}/diff diff branch
get_branch GET /repositories/{repository}/branches/{branch} get branch
list_branches GET /repositories/{repository}/branches list branches
reset_branch PUT /repositories/{repository}/branches/{branch} reset branch
revert_branch POST /repositories/{repository}/branches/{branch}/revert revert

create_branch

str create_branch(repository, branch_creation)

create branch

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.branch_creation import BranchCreation
from lakefs_client.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch_creation = BranchCreation(
        name="name_example",
        source="source_example",
    ) # BranchCreation | 

    # example passing only required values which don't have defaults set
    try:
        # create branch
        api_response = api_instance.create_branch(repository, branch_creation)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->create_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch_creation BranchCreation    

Return type

str

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
201 reference -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Resource Conflicts With Target -
0 Internal Server Error -

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

delete_branch

delete_branch(repository, branch)

delete branch

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 

    # example passing only required values which don't have defaults set
    try:
        # delete branch
        api_instance.delete_branch(repository, branch)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->delete_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 branch deleted successfully -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

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

diff_branch

DiffList diff_branch(repository, branch)

diff branch

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.diff_list import DiffList
from lakefs_client.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    after = "after_example" # str | return items after this value (optional)
    amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
    prefix = "prefix_example" # str | return items prefixed with this value (optional)
    delimiter = "delimiter_example" # str | delimiter used to group common prefixes by (optional)

    # example passing only required values which don't have defaults set
    try:
        # diff branch
        api_response = api_instance.diff_branch(repository, branch)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->diff_branch: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # diff branch
        api_response = api_instance.diff_branch(repository, branch, after=after, amount=amount, prefix=prefix, delimiter=delimiter)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->diff_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
after str return items after this value [optional]
amount int how many items to return [optional] if omitted the server will use the default value of 100
prefix str return items prefixed with this value [optional]
delimiter str delimiter used to group common prefixes by [optional]

Return type

DiffList

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 diff of branch uncommitted changes -
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

Ref get_branch(repository, branch)

get branch

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.error import Error
from lakefs_client.model.ref import Ref
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 

    # example passing only required values which don't have defaults set
    try:
        # get branch
        api_response = api_instance.get_branch(repository, branch)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->get_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    

Return type

Ref

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 branch -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

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

list_branches

RefList list_branches(repository)

list branches

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.error import Error
from lakefs_client.model.ref_list import RefList
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_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) if omitted the server will use the default value of 100

    # example passing only required values which don't have defaults set
    try:
        # list branches
        api_response = api_instance.list_branches(repository)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->list_branches: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # list branches
        api_response = api_instance.list_branches(repository, prefix=prefix, after=after, amount=amount)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->list_branches: %s\n" % e)

Parameters

Name Type Description Notes
repository 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] if omitted the server will use the default value of 100

Return type

RefList

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 branch list -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

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

reset_branch

reset_branch(repository, branch, reset_creation)

reset branch

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.reset_creation import ResetCreation
from lakefs_client.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    reset_creation = ResetCreation(
        type="object",
        path="path_example",
    ) # ResetCreation | 

    # example passing only required values which don't have defaults set
    try:
        # reset branch
        api_instance.reset_branch(repository, branch, reset_creation)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->reset_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
reset_creation ResetCreation    

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 reset successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

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

revert_branch

revert_branch(repository, branch, revert_creation)

revert

Example

import time
import lakefs_client
from lakefs_client.api import branches_api
from lakefs_client.model.revert_creation import RevertCreation
from lakefs_client.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = lakefs_client.Configuration(
    host = "http://localhost/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_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure API key authorization: cookie_auth
configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie_auth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwt_token
configuration = lakefs_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with lakefs_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = branches_api.BranchesApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    revert_creation = RevertCreation(
        ref="ref_example",
        parent_number=1,
    ) # RevertCreation | 

    # example passing only required values which don't have defaults set
    try:
        # revert
        api_instance.revert_branch(repository, branch, revert_creation)
    except lakefs_client.ApiException as e:
        print("Exception when calling BranchesApi->revert_branch: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
revert_creation RevertCreation    

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
204 revert successful -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -

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