This module contains a DataIngestApi class to perform API operations.

The HERE API reference documentation used in this module can be found here: Ingest API Reference # noqa E501

class here.platform.api.data_ingest_api.DataIngestApi(base_url: str, platform_config: PlatformConfig, application_config: ApplicationConfig, auth: Auth | None, proxies: dict | None = None)[source]#

Bases: BaseApi

This class provides access to HERE platform Data Ingest APIs.

The ingestion service provides the way to submit data to stream layers using REST API.

ingest_data(layer_id: str, body: bytes, checksum_header: str | None = None, traceid_header: str | None = None, message_key_header: str | None = None, billing_tag: str | None = None) dict[source]#

Send streaming data to a specified layer in the Platform.

Parameters:
  • layer_id – The ID of the layer where you want the data ingested.

  • body – data to be uploaded in bytes.

  • checksum_header – A base64 encoded SHA-256 hash you can provide for validation against the calculated value on the request body hash. This verifies the integrity of your request and prevents modification by a third party.It will be created by the service if not provided. A SHA-256 hash consists of 256 bits or 64 chars.

  • traceid_header – A unique message ID, such as a UUID. This can be included in the request if you want to use an ID that you define. If you do not include an ID, one will be generated during ingestion and included in the response. You can use this ID to track your request and identify the message in the catalog.

  • message_key_header – A unique message ID, such as a UUID. This can be included in the request if you want to use an ID that you define. If you do not include an ID, X-HERE-TraceId will be used instead. You can use this ID to specify the partition for the message in the data catalog.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.

ingest_partitions(layer_id: str, partitions: Dict[str, Any], traceid_header: str | None = None, billing_tag: str | None = None) dict[source]#

Upload partitions data to a specified layer in the Platform.

Parameters:
  • layer_id – The ID of the layer where you want the data ingested.

  • partitions – partitions to be uploaded .

  • traceid_header – A unique message ID, such as a UUID. This can be included in the request if you want to use an ID that you define. If you do not include an ID, one will be generated during ingestion and included in the response. You can use this ID to track your request and identify the message in the catalog.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.

ingest_sdii(layer_id: str, body: bytes, checksum_header: str | None = None, traceid_header: str | None = None, message_key_header: str | None = None, billing_tag: str | None = None) dict[source]#

Consume individual SDII messages and SDII MessageLists. The endpoint automatically breaks SDII MessageLists down and stores the data as individual SDII messages. Note that this endpoint does not support compression. If you are sending data to stream layer that has compression enabled, you must use the /layers/<layerID> endpoint and all compression and decompression must be handled by your application.

Parameters:
  • layer_id – The ID of the publication to retrieve.

  • body – data to be uploaded in bytes.

  • checksum_header – A base64 encoded SHA-256 hash you can provide for validation against the calculated value on the request body hash. This verifies the integrity of your request and prevents modification by a third party.It will be created by the service if not provided. A SHA-256 hash consists of 256 bits or 64 chars.

  • traceid_header – A unique message ID, such as a UUID. This can be included in the request if you want to use an ID that you define. If you do not include an ID, one will be generated during ingestion and included in the response. You can use this ID to track your request and identify the message in the catalog.

  • message_key_header – A unique message ID, such as a UUID. This can be included in the request if you want to use an ID that you define. If you do not include an ID, X-HERE-TraceId will be used instead. You can use this ID to specify the partition for the message in the data catalog.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.