here.platform.api.data_publish_api module#
This module contains a DataPublishApi class to perform API operations.
The HERE API reference documentation used in this module can be found here: Publish API Reference # noqa E501
- class here.platform.api.data_publish_api.DataPublishApi(base_url: str, platform_config: PlatformConfig, application_config: ApplicationConfig, auth: Auth | None, proxies: dict | None = None)[source]#
Bases:
BaseApiThis class provides access to HERE platform Data Publish APIs.
Manage the publishing of data to a catalog. Supports publish to versioned, volatile and stream layer types.
- cancel_publication(publication_id: str, billing_tag: str | None = None, strict: bool = False) bool[source]#
Cancel a publication if it has not yet been submitted.
- Parameters:
publication_id – The ID of the publication to cancel.
billing_tag – A string which is used for grouping billing records.
strict – If the publication doesn’t exist, strict=True will raise a PlatformException while strict=False will not.
- Returns:
True if the publication exists and was cancelled, False if it doesn’t exist.
- Raises:
PlatformException – If platform responds with an HTTP error.
- get_publication(publication_id: str, billing_tag: str | None = None) dict[source]#
Return the details of the specified publication.
- Parameters:
publication_id – The ID of the publication to retrieve.
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.
- init_publication(body: dict, billing_tag: str | None = None) dict[source]#
Initialize a new publication for publishing metadata.
- Parameters:
body – a dictionary with fields to initialize a publication.
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.
- submit_publication(publication_id: str, billing_tag: str | None = None)[source]#
Submit the publication and initiates post processing if necessary.
- Parameters:
publication_id – The ID of the publication to submit.
billing_tag – A string which is used for grouping billing records.
- Raises:
PlatformException – If platform responds with an HTTP error.
- upload_partitions(layer_id: str, publication_id: str, body: dict, billing_tag: str | None = None)[source]#
Upload partitions to the given layer. Depending on the publication type, post processing may be required before the partitions are published. For better performance batch your partitions (e.g. 1000 per request), rather than uploading them individually.
- Parameters:
layer_id – The ID of the layer to publish to.
publication_id – The ID of publication to publish to.
body – a dictionary with publication partitions. Data and DataHandle fields cannot be populated at the same time.
billing_tag – A string which is used for grouping billing records.
- Raises:
PlatformException – If platform responds with an HTTP error.