Skip to content

lakefs_enterprise_sdk.StagingApi

All URIs are relative to /api/v1

Method HTTP request Description
get_physical_address GET /repositories/{repository}/branches/{branch}/staging/backing generate an address to which the client can upload an object
link_physical_address PUT /repositories/{repository}/branches/{branch}/staging/backing associate staging on this physical address with a path

get_physical_address

StagingLocation get_physical_address(repository, branch, path, presign=presign)

generate an address to which the client can upload an object

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):
    import time
    import os
    import lakefs_enterprise_sdk
    from lakefs_enterprise_sdk.models.staging_location import StagingLocation
    from lakefs_enterprise_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_enterprise_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_enterprise_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_enterprise_sdk.Configuration(
        access_token = os.environ["BEARER_TOKEN"]
    )
    
    # Enter a context with an instance of the API client
    with lakefs_enterprise_sdk.ApiClient(configuration) as api_client:
        # Create an instance of the API class
        api_instance = lakefs_enterprise_sdk.StagingApi(api_client)
        repository = 'repository_example' # str | 
        branch = 'branch_example' # str | 
        path = 'path_example' # str | relative to the branch
        presign = True # bool |  (optional)
    
        try:
            # generate an address to which the client can upload an object
            api_response = api_instance.get_physical_address(repository, branch, path, presign=presign)
            print("The response of StagingApi->get_physical_address:\n")
            pprint(api_response)
        except Exception as e:
            print("Exception when calling StagingApi->get_physical_address: %s\n" % e)
    

Parameters

Name Type Description Notes
repository str
branch str
path str relative to the branch
presign bool [optional]

Return type

StagingLocation

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 physical address for staging area -
400 Bad Request -
401 Unauthorized -
404 Resource Not Found -
429 too many requests -
0 Internal Server Error -

link_physical_address

ObjectStats link_physical_address(repository, branch, path, staging_metadata, if_none_match=if_none_match, if_match=if_match)

associate staging on this physical address with a path

Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace.

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):
    import time
    import os
    import lakefs_enterprise_sdk
    from lakefs_enterprise_sdk.models.object_stats import ObjectStats
    from lakefs_enterprise_sdk.models.staging_metadata import StagingMetadata
    from lakefs_enterprise_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_enterprise_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_enterprise_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_enterprise_sdk.Configuration(
        access_token = os.environ["BEARER_TOKEN"]
    )
    
    # Enter a context with an instance of the API client
    with lakefs_enterprise_sdk.ApiClient(configuration) as api_client:
        # Create an instance of the API class
        api_instance = lakefs_enterprise_sdk.StagingApi(api_client)
        repository = 'repository_example' # str | 
        branch = 'branch_example' # str | 
        path = 'path_example' # str | relative to the branch
        staging_metadata = lakefs_enterprise_sdk.StagingMetadata() # StagingMetadata | 
        if_none_match = '*' # str | Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. (optional)
        if_match = '2e9ec317e197e02e4264d128c2e7e681' # str | Set to the object's ETag to atomically allow operations only if the object's current ETag matches the provided value. (optional)
    
        try:
            # associate staging on this physical address with a path
            api_response = api_instance.link_physical_address(repository, branch, path, staging_metadata, if_none_match=if_none_match, if_match=if_match)
            print("The response of StagingApi->link_physical_address:\n")
            pprint(api_response)
        except Exception as e:
            print("Exception when calling StagingApi->link_physical_address: %s\n" % e)
    

Parameters

Name Type Description Notes
repository str
branch str
path str relative to the branch
staging_metadata StagingMetadata
if_none_match str Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. [optional]
if_match str Set to the object's ETag to atomically allow operations only if the object's current ETag matches the provided value. [optional]

Return type

ObjectStats

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
200 object metadata -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Internal Server Error -
409 conflict with a commit, try here -
412 Precondition Failed -
429 too many requests -
501 Not Implemented -
0 Internal Server Error -