Catalog Operations

In this section we review the most used catalog-level operations provided by the SDK. Full details on all methods can be found in the API documentation.

  • Creating, updating, and deleting catalogs is done at the platform level. See Platform Operations section for details.
  • For details on how to write to different layer types of a catalog see Write to Catalog Layers section.

For all code examples below, assume the following was executed prior:

from here.platform import Platform
platform = Platform()
hrn = "hrn:here:data::olp-here:your-catalog"
catalog = platform.get_catalog(hrn=hrn)

Get Catalog Details

Get catalog details given hrn of the catalog.

catalog_details = catalog.get_details()

Get Catalog First Version

Gets the first version of the catalog available on the platform.

catalog_first_version = catalog.first_version()

Get Catalog Latest Version

Gets the latest version of the catalog available on the platform.

catalog_latest_version = catalog.latest_version()

List Catalog Versions

Gets the list of all catalog versions available on the platform.

catalog_versions = catalog.list_versions()

Catalog Has Layer

Check if a catalog has a layer of given layer ID. It will return True or False depending on whether the catalog has that layer.

result = catalog.has_layer(layer_id=layer_id)

Catalog Get Layer

Gets a Layer object for the given layer ID.

layer = catalog.get_layer(layer_id=layer_id)

Catalog Delete Layer

Deletes the layer of the catalog.

catalog.delete_layer(layer_id=layer_id)

Catalog Grant Access

Grants access to a catalog to an entity.

entity_type = "sample-entity-type"
entity_id = "sample-entity-id"
action = "sample-action"
catalog.grant_access(entity_type=entity_type,entity_id=entity_id,action=action)

Catalog Revoke Access

Revokes access to a catalog from an entity.

entity_type = "sample-entity-type"
entity_id = "sample-entity-id"
action = "sample-action"
catalog.revoke_access(entity_type=entity_type,entity_id=entity_id,action=action)

Share Catalog

Share a catalog with an entity.

entity_type = "sample-entity-type"
entity_id = "sample-entity-id"
catalog.share(entity_type=entity_type,entity_id=entity_id)

Open Catalog in Portal

Open the catalog page on the HERE platform portal.

catalog.open_in_portal()

results matching ""

    No results matching ""