View on GitHub

lakeFS

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

lakefs_sdk.ObjectsApi

All URIs are relative to /api/v1

Method HTTP request Description
copy_object POST /repositories/{repository}/branches/{branch}/objects/copy create a copy of an object
delete_object DELETE /repositories/{repository}/branches/{branch}/objects delete object. Missing objects will not return a NotFound error.
delete_objects POST /repositories/{repository}/branches/{branch}/objects/delete delete objects. Missing objects will not return a NotFound error.
get_object GET /repositories/{repository}/refs/{ref}/objects get object content
get_underlying_properties GET /repositories/{repository}/refs/{ref}/objects/underlyingProperties get object properties on underlying storage
head_object HEAD /repositories/{repository}/refs/{ref}/objects check if object exists
list_objects GET /repositories/{repository}/refs/{ref}/objects/ls list objects under a given prefix
stat_object GET /repositories/{repository}/refs/{ref}/objects/stat get object metadata
upload_object POST /repositories/{repository}/branches/{branch}/objects  

copy_object

ObjectStats copy_object(repository, branch, dest_path, object_copy_creation)

create a copy of an object

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation
from lakefs_sdk.models.object_stats import ObjectStats
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    branch = 'branch_example' # str | destination branch for the copy
    dest_path = 'dest_path_example' # str | destination path relative to the branch
    object_copy_creation = lakefs_sdk.ObjectCopyCreation() # ObjectCopyCreation | 

    try:
        # create a copy of an object
        api_response = api_instance.copy_object(repository, branch, dest_path, object_copy_creation)
        print("The response of ObjectsApi->copy_object:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->copy_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str destination branch for the copy  
dest_path str destination path relative to the branch  
object_copy_creation ObjectCopyCreation    

Return type

ObjectStats

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
201 Copy object response -
400 Validation Error -
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_object

delete_object(repository, branch, path, force=force)

delete object. Missing objects will not return a NotFound error.

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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    branch = 'branch_example' # str | 
    path = 'path_example' # str | relative to the branch
    force = False # bool |  (optional) (default to False)

    try:
        # delete object. Missing objects will not return a NotFound error.
        api_instance.delete_object(repository, branch, path, force=force)
    except Exception as e:
        print("Exception when calling ObjectsApi->delete_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
path str relative to the branch  
force bool   [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 object deleted 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_objects

ObjectErrorList delete_objects(repository, branch, path_list, force=force)

delete objects. Missing objects will not return a NotFound error.

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.object_error_list import ObjectErrorList
from lakefs_sdk.models.path_list import PathList
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    branch = 'branch_example' # str | 
    path_list = lakefs_sdk.PathList() # PathList | 
    force = False # bool |  (optional) (default to False)

    try:
        # delete objects. Missing objects will not return a NotFound error.
        api_response = api_instance.delete_objects(repository, branch, path_list, force=force)
        print("The response of ObjectsApi->delete_objects:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->delete_objects: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
path_list PathList    
force bool   [optional] [default to False]

Return type

ObjectErrorList

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 Delete objects response -
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_object

bytearray get_object(repository, ref, path, range=range, if_none_match=if_none_match, presign=presign)

get object content

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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    ref = 'ref_example' # str | a reference (could be either a branch or a commit ID)
    path = 'path_example' # str | relative to the ref
    range = 'bytes=0-1023' # str | Byte range to retrieve (optional)
    if_none_match = '33a64df551425fcc55e4d42a148795d9f25f89d4' # str | Returns response only if the object does not have a matching ETag (optional)
    presign = True # bool |  (optional)

    try:
        # get object content
        api_response = api_instance.get_object(repository, ref, path, range=range, if_none_match=if_none_match, presign=presign)
        print("The response of ObjectsApi->get_object:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->get_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
ref str a reference (could be either a branch or a commit ID)  
path str relative to the ref  
range str Byte range to retrieve [optional]
if_none_match str Returns response only if the object does not have a matching ETag [optional]
presign bool   [optional]

Return type

bytearray

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 object content * Content-Length -
* Last-Modified -
* ETag -
206 partial object content * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
302 Redirect to a pre-signed URL for the object * Location - redirect to S3
304 Content not modified -
401 Unauthorized -
404 Resource Not Found -
410 object expired -
416 Requested Range Not Satisfiable -
420 too many requests -
0 Internal Server Error -

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

get_underlying_properties

UnderlyingObjectProperties get_underlying_properties(repository, ref, path)

get object properties on underlying storage

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    ref = 'ref_example' # str | a reference (could be either a branch or a commit ID)
    path = 'path_example' # str | relative to the branch

    try:
        # get object properties on underlying storage
        api_response = api_instance.get_underlying_properties(repository, ref, path)
        print("The response of ObjectsApi->get_underlying_properties:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->get_underlying_properties: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
ref str a reference (could be either a branch or a commit ID)  
path str relative to the branch  

Return type

UnderlyingObjectProperties

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 object metadata on underlying storage -
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]

head_object

head_object(repository, ref, path, range=range)

check if object exists

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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    ref = 'ref_example' # str | a reference (could be either a branch or a commit ID)
    path = 'path_example' # str | relative to the ref
    range = 'bytes=0-1023' # str | Byte range to retrieve (optional)

    try:
        # check if object exists
        api_instance.head_object(repository, ref, path, range=range)
    except Exception as e:
        print("Exception when calling ObjectsApi->head_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
ref str a reference (could be either a branch or a commit ID)  
path str relative to the ref  
range str Byte range to retrieve [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
200 object exists * Content-Length -
* Last-Modified -
* ETag -
206 partial object content info * Content-Length -
* Content-Range -
* Last-Modified -
* ETag -
401 Unauthorized -
404 object not found -
410 object expired -
416 Requested Range Not Satisfiable -
420 too many requests -
0 internal server error -

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

list_objects

ObjectStatsList list_objects(repository, ref, user_metadata=user_metadata, presign=presign, after=after, amount=amount, delimiter=delimiter, prefix=prefix)

list objects under a given prefix

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.object_stats_list import ObjectStatsList
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    ref = 'ref_example' # str | a reference (could be either a branch or a commit ID)
    user_metadata = True # bool |  (optional) (default to True)
    presign = True # bool |  (optional)
    after = 'after_example' # str | return items after this value (optional)
    amount = 100 # int | how many items to return (optional) (default to 100)
    delimiter = 'delimiter_example' # str | delimiter used to group common prefixes by (optional)
    prefix = 'prefix_example' # str | return items prefixed with this value (optional)

    try:
        # list objects under a given prefix
        api_response = api_instance.list_objects(repository, ref, user_metadata=user_metadata, presign=presign, after=after, amount=amount, delimiter=delimiter, prefix=prefix)
        print("The response of ObjectsApi->list_objects:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->list_objects: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
ref str a reference (could be either a branch or a commit ID)  
user_metadata bool   [optional] [default to True]
presign bool   [optional]
after str return items after this value [optional]
amount int how many items to return [optional] [default to 100]
delimiter str delimiter used to group common prefixes by [optional]
prefix str return items prefixed with this value [optional]

Return type

ObjectStatsList

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

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

stat_object

ObjectStats stat_object(repository, ref, path, user_metadata=user_metadata, presign=presign)

get object metadata

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.object_stats import ObjectStats
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    ref = 'ref_example' # str | a reference (could be either a branch or a commit ID)
    path = 'path_example' # str | relative to the branch
    user_metadata = True # bool |  (optional) (default to True)
    presign = True # bool |  (optional)

    try:
        # get object metadata
        api_response = api_instance.stat_object(repository, ref, path, user_metadata=user_metadata, presign=presign)
        print("The response of ObjectsApi->stat_object:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->stat_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
ref str a reference (could be either a branch or a commit ID)  
path str relative to the branch  
user_metadata bool   [optional] [default to True]
presign bool   [optional]

Return type

ObjectStats

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
200 object metadata -
401 Unauthorized -
404 Resource Not Found -
400 Bad Request -
410 object gone (but partial metadata may be available) -
420 too many requests -
0 Internal Server Error -

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

upload_object

ObjectStats upload_object(repository, branch, path, if_none_match=if_none_match, storage_class=storage_class, force=force, content=content)

Example

import time
import os
import lakefs_sdk
from lakefs_sdk.models.object_stats import ObjectStats
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.ObjectsApi(api_client)
    repository = 'repository_example' # str | 
    branch = 'branch_example' # str | 
    path = 'path_example' # str | relative to the branch
    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)
    storage_class = 'storage_class_example' # str | Deprecated, this capability will not be supported in future releases. (optional)
    force = False # bool |  (optional) (default to False)
    content = None # bytearray | Only a single file per upload which must be named \\\"content\\\". (optional)

    try:
        api_response = api_instance.upload_object(repository, branch, path, if_none_match=if_none_match, storage_class=storage_class, force=force, content=content)
        print("The response of ObjectsApi->upload_object:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ObjectsApi->upload_object: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
path str relative to the branch  
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]
storage_class str Deprecated, this capability will not be supported in future releases. [optional]
force bool   [optional] [default to False]
content bytearray Only a single file per upload which must be named \\"content\\". [optional]

Return type

ObjectStats

Authorization

basic_auth, cookie_auth, oidc_auth, saml_auth, jwt_token

HTTP request headers

HTTP response details

Status code Description Response headers
201 object metadata -
400 Validation Error -
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]