View on GitHub

lakeFS

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

lakefs_client.ImportApi

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

Method HTTP request Description
import_cancel DELETE /repositories/{repository}/branches/{branch}/import cancel ongoing import
import_start POST /repositories/{repository}/branches/{branch}/import import data from object store
import_status GET /repositories/{repository}/branches/{branch}/import get import status

import_cancel

import_cancel(repository, branch, id)

cancel ongoing import

Example

import time
import lakefs_client
from lakefs_client.api import import_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'
)

# Configure API key authorization: oidc_auth
configuration.api_key['oidc_auth'] = 'YOUR_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'] = 'YOUR_API_KEY'

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

# 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 = import_api.ImportApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    id = "id_example" # str | Unique identifier of the import process

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

Parameters

Name Type Description Notes
repository str    
branch str    
id str Unique identifier of the import process  

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, jwt_token, oidc_auth, saml_auth

HTTP request headers

HTTP response details

Status code Description Response headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -

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

import_start

ImportCreationResponse import_start(repository, branch, import_creation)

import data from object store

Example

import time
import lakefs_client
from lakefs_client.api import import_api
from lakefs_client.model.import_creation import ImportCreation
from lakefs_client.model.error import Error
from lakefs_client.model.import_creation_response import ImportCreationResponse
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'
)

# Configure API key authorization: oidc_auth
configuration.api_key['oidc_auth'] = 'YOUR_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'] = 'YOUR_API_KEY'

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

# 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 = import_api.ImportApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    import_creation = ImportCreation(
        paths=[
            ImportLocation(
                type="common_prefix",
                path="s3://my-bucket/production/collections/",
                destination="collections/",
            ),
        ],
        commit=CommitCreation(
            message="message_example",
            metadata={
                "key": "key_example",
            },
            date=1,
            allow_empty=False,
            force=False,
        ),
        force=False,
    ) # ImportCreation | 

    # example passing only required values which don't have defaults set
    try:
        # import data from object store
        api_response = api_instance.import_start(repository, branch, import_creation)
        pprint(api_response)
    except lakefs_client.ApiException as e:
        print("Exception when calling ImportApi->import_start: %s\n" % e)

Parameters

Name Type Description Notes
repository str    
branch str    
import_creation ImportCreation    

Return type

ImportCreationResponse

Authorization

basic_auth, cookie_auth, jwt_token, oidc_auth, saml_auth

HTTP request headers

HTTP response details

Status code Description Response headers
202 Import started -
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]

import_status

ImportStatus import_status(repository, branch, id)

get import status

Example

import time
import lakefs_client
from lakefs_client.api import import_api
from lakefs_client.model.import_status import ImportStatus
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'
)

# Configure API key authorization: oidc_auth
configuration.api_key['oidc_auth'] = 'YOUR_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'] = 'YOUR_API_KEY'

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

# 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 = import_api.ImportApi(api_client)
    repository = "repository_example" # str | 
    branch = "branch_example" # str | 
    id = "id_example" # str | Unique identifier of the import process

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

Parameters

Name Type Description Notes
repository str    
branch str    
id str Unique identifier of the import process  

Return type

ImportStatus

Authorization

basic_auth, cookie_auth, jwt_token, oidc_auth, saml_auth

HTTP request headers

HTTP response details

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