Skip to content

Latest commit

 

History

History
179 lines (122 loc) · 5.48 KB

File metadata and controls

179 lines (122 loc) · 5.48 KB

hotdata.UploadsApi

All URIs are relative to https://api.hotdata.dev

Method HTTP request Description
list_uploads GET /v1/files List uploads
upload_file POST /v1/files Upload file

list_uploads

ListUploadsResponse list_uploads(status=status)

List uploads

Example

  • Api Key Authentication (WorkspaceId):
  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.list_uploads_response import ListUploadsResponse
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
    host = "https://api.hotdata.dev"
)

# 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 API key authorization: WorkspaceId
configuration.api_key['WorkspaceId'] = os.environ["API_KEY"]

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

# Configure Bearer authorization: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.UploadsApi(api_client)
    status = 'status_example' # str | Filter by upload status (optional)

    try:
        # List uploads
        api_response = api_instance.list_uploads(status=status)
        print("The response of UploadsApi->list_uploads:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UploadsApi->list_uploads: %s\n" % e)

Parameters

Name Type Description Notes
status str Filter by upload status [optional]

Return type

ListUploadsResponse

Authorization

WorkspaceId, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of uploads -

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

upload_file

UploadResponse upload_file(body)

Upload file

Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., text/csv, application/json, application/parquet). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to POST /v1/datasets to create a queryable table.

Example

  • Api Key Authentication (WorkspaceId):
  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.upload_response import UploadResponse
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
    host = "https://api.hotdata.dev"
)

# 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 API key authorization: WorkspaceId
configuration.api_key['WorkspaceId'] = os.environ["API_KEY"]

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

# Configure Bearer authorization: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.UploadsApi(api_client)
    body = None # bytearray | 

    try:
        # Upload file
        api_response = api_instance.upload_file(body)
        print("The response of UploadsApi->upload_file:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UploadsApi->upload_file: %s\n" % e)

Parameters

Name Type Description Notes
body bytearray

Return type

UploadResponse

Authorization

WorkspaceId, BearerAuth

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 File uploaded -
400 Invalid request -

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