# here-data-blob-v1-client
The `blob` service supports the upload and retrieval of large volumes of data from the storage of a catalog. Each discrete chunk of data is stored as a blob (Binary Large Object). Each blob has its own unique ID (data handle). The data handles can be stored in  services like `metadata`, `index` or `stream`. To get data, use your preferred service to retrieve the data handle of the relevant blobs. Then use the data handle to pull the data using the `blob` service.

Currently, the blob service supports REST API versions v1 and v2. Version v1 should be used to access versioned, index and stream (if the stream payload is larger than 1MB) layers. Version v2 should be used to access the object store layer. Always pick the proper API version from API Lookup to ensure you get back the correct API version response.

If you are writing to a volatile layer, see volatile-blob API definition.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.6
- Package version: 1.2.113
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python >= 3.6

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import here_data_blob_v1_client
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import here_data_blob_v1_client
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import time
import here_data_blob_v1_client
from pprint import pprint
from here_data_blob_v1_client.api import blob_api
from here_data_blob_v1_client.model.blob_init_response import BlobInitResponse
from here_data_blob_v1_client.model.multipart_complete_request import MultipartCompleteRequest
from here_data_blob_v1_client.model.multipart_upload_metadata import MultipartUploadMetadata
from here_data_blob_v1_client.model.multipart_upload_status import MultipartUploadStatus
# Defining the host is optional and defaults to https://use.apilookup.for.a.base.url
# See configuration.py for a list of all supported configuration parameters.
configuration = here_data_blob_v1_client.Configuration(
    host = "https://use.apilookup.for.a.base.url"
)

# 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 Bearer authorization (JWT): Bearer
configuration = here_data_blob_v1_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)


# Enter a context with an instance of the API client
with here_data_blob_v1_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = blob_api.BlobApi(api_client)
    layer_id = "layerId_example" # str | The ID of the layer that the data blob part belongs to. Content of this parameter must refer to a valid layer already configured in the catalog configuration.
data_handle = "dataHandle_example" # str | The data handle (ID) represents an identifier for the data blob which the part belongs to. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
multi_part_token = "multiPartToken_example" # str | The identifier of the multi part upload (token). Content of this parameter must refer to a valid token retrieved when starting the multipart upload.
billing_tag = "billingTag_example" # str | Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases. (optional)

    try:
        # Cancels a multipart upload
        api_instance.cancel_multipart_upload(layer_id, data_handle, multi_part_token, billing_tag=billing_tag)
    except here_data_blob_v1_client.ApiException as e:
        print("Exception when calling BlobApi->cancel_multipart_upload: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *https://use.apilookup.for.a.base.url*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BlobApi* | [**cancel_multipart_upload**](docs/BlobApi.md#cancel_multipart_upload) | **DELETE** /layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken} | Cancels a multipart upload
*BlobApi* | [**check_blob_exists**](docs/BlobApi.md#check_blob_exists) | **HEAD** /layers/{layerId}/data/{dataHandle} | Checks if a data handle exists
*BlobApi* | [**complete_multipart_upload**](docs/BlobApi.md#complete_multipart_upload) | **PUT** /layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken} | Completes a multipart upload
*BlobApi* | [**delete_blob**](docs/BlobApi.md#delete_blob) | **DELETE** /layers/{layerId}/data/{dataHandle} | Deletes a data blob from an index layer.
*BlobApi* | [**get_blob**](docs/BlobApi.md#get_blob) | **GET** /layers/{layerId}/data/{dataHandle} | Gets a blob
*BlobApi* | [**get_multipart_upload_status**](docs/BlobApi.md#get_multipart_upload_status) | **GET** /layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken} | Gets the status of a multipart upload.
*BlobApi* | [**put_blob**](docs/BlobApi.md#put_blob) | **PUT** /layers/{layerId}/data/{dataHandle} | Publishes a data blob
*BlobApi* | [**start_multipart_upload**](docs/BlobApi.md#start_multipart_upload) | **POST** /layers/{layerId}/data/{dataHandle}/multiparts | Starts a multipart upload of a blob and returns URLs for the next multipart upload operations. The URLs contain the upload token.
*BlobApi* | [**upload_part**](docs/BlobApi.md#upload_part) | **POST** /layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken}/parts | Uploads a part


## Documentation For Models

 - [BlobInitResponse](docs/BlobInitResponse.md)
 - [BlobInitResponseCancelLink](docs/BlobInitResponseCancelLink.md)
 - [BlobInitResponseCompleteLink](docs/BlobInitResponseCompleteLink.md)
 - [BlobInitResponseLinks](docs/BlobInitResponseLinks.md)
 - [BlobInitResponseStatusLink](docs/BlobInitResponseStatusLink.md)
 - [BlobInitResponseUploadPartLink](docs/BlobInitResponseUploadPartLink.md)
 - [MultipartCompletePart](docs/MultipartCompletePart.md)
 - [MultipartCompleteRequest](docs/MultipartCompleteRequest.md)
 - [MultipartUploadMetadata](docs/MultipartUploadMetadata.md)
 - [MultipartUploadStatus](docs/MultipartUploadStatus.md)


## Documentation For Authorization


## Bearer

- **Type**: Bearer authentication (JWT)


## Author




## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in here_data_blob_v1_client.apis and here_data_blob_v1_client.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1:
Use specific imports for apis and models like:
- `from here_data_blob_v1_client.api.default_api import DefaultApi`
- `from here_data_blob_v1_client.model.pet import Pet`

Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import here_data_blob_v1_client
from here_data_blob_v1_client.apis import *
from here_data_blob_v1_client.models import *
```

