local catalog copy
local catalog copy
The OLP CLI supports the following:
- copy create creates a local copy of a catalog
- copy update updates an existing local copy of a catalog
local catalog copy create
Creates a local catalog by copying the configuration and data from a catalog hosted on the platform. Data is typically filtered to create smaller copies suitable for local development and testing.
olp local catalog copy create <catalog HRN> [command options]Required parameters:
<catalog HRN>The HRN of the catalog to copy.
Optional parameters:
--configuration-onlyCopies the catalog configuration but leaves the local catalog empty.--copy-schemasDownloads the schema bundles locally. This is useful for offline inspection.--include <layer wildcard> [<layer wildcard 2> ...]Specifies a subset of layers you want to copy. By default all layers are copied. Special wildcards can be used to indicate all layers with a given layer type and/or partitioning scheme:- layer ID, for example: topology-geometry
- [layer-type:partitioning-scheme], for example: [versioned:heretile]
- [layer-type], for example: [stream]
- [partitioning-scheme], for example: [generic]
--exclude <layer wildcard> [<layer wildcard 2> ...]Specifies the layers that should not be copied. This is typically used instead of--includeto copy all but some layers. Wildcards are supported.--filter <layer wildcard>=<filter-name>:<filter-configuration> [<layer wildcard 2>=<filter-name>:<filter-configuration> ...]Specifies the filtering options to be used when the layer partitions are copied, with the format<layer wildcard>=<filter-name>:<filter-configuration>. The following filters are supported:list:<partition1>,<partition2>,..., for example: layer-a=list:a,b,c.regex:<partition-regex>, for example: layer-b=regex:^20147700.bounding-box:<north>,<south>,<east>,<west>[:<tilelevel1>,<tilelevel2>,...[:<heretile|mercator|nds|mos|native>], for example: [heretile]=bounding-box:52.67551,52.33826,13.76116,13.08835. Tile levels are optional if the layer configuration is configured with the proper tile levels (HERE Tile layers only). The tiling scheme isheretileby default.query:<rsql-query>(index layers only), for example [index]=query:length=gt=100.glob:<glob-pattern>, for example [objectstore]=glob:folder/*.txt.
--id <local catalog ID>Specifies the ID of the local catalog. It is the original catalog ID by default.--index-since <timestamp ms>The initial timestamp used to query index layers in milliseconds since the epoch. 0 by default.--minimum-version <catalog version>The first metadata version that should be copied. All catalog versions since that version will be copied. By default it is the value of--version.--version <catalog version>The last metadata version that should be copied. All versions from--minimum-versionto--versionwill be copied. It has no effect if--configuration-onlyis used. By default it is the latest version of the catalog.--stream-limit <number>Maximum number of partitions to be copied from stream layers.--stream-timeout <timeout s>Timeout in seconds for the copy of stream partitions.--forceForce overwriting if the local catalog exists and the copy configuration differs. An existing local copy is always preserved if the copy parameters have not changed.--credentials <path to credentials file>The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.--profile <profile name>The name of the credentials profile to use from theolpcli.inifile.--quietDisplays empty output with no additional information.--scope <project HRN>Specifies the project HRN to use as the scope in the request. The value specified with--scopeoverrides any value forhere.token.scopeprovided in the credentials file used for the command.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp local catalog copy create hrn:here:data::org:catalog-exampleOutput:
Source catalog: hrn:here:data::org:catalog-example
Syncing index changes since 1970-01-01 01:00:00.0
Local catalog hrn:local:data:::catalog-example createdExample with custom local catalog ID:
olp local catalog copy create hrn:here:data::org:catalog-example --id copy-of-catalog-exampleOutput:
Source catalog: hrn:here:data::org:catalog-example
Syncing index changes since 1970-01-01 01:00:00.0
Local catalog hrn:local:data:::copy-of-catalog-example createdExample with additional parameters:
olp local catalog copy create hrn:here:data::org:catalog-example \
--include layer-a layer-b \
--filter [generic]=list:partition1,partition2 \
[heretile]=bounding-box:52.67551,52.33826,13.386303,13.08835olp local catalog copy create hrn:here:data::org:catalog-example ^
--include layer-a layer-b ^
--filter [generic]=list:partition1,partition2 ^
[heretile]=bounding-box:52.67551,52.33826,13.386303,13.08835Output:
Source catalog: hrn:here:data::org:catalog-example
Included layers: layer-a layer-b
Using filter: [heretile] => BoundingBoxFilter(13.08835,52.33826,13.386303,52.67551,HereTile,ArrayBuffer())
Using filter: [generic] => ListFilter(Set(partition1,partition2))
catalog-example: syncing version 1
layer-a: 50% [===============> ] 1/2 (0:00:00 / 0:00:00)
layer-a: 100% [===============================] 2/2 (0:00:00 / 0:00:00)
layer-b: 4% [=> ] 1/25 (0:00:00 / 0:00:00)
layer-b: 8% [==> ] 2/25 (0:00:00 / 0:00:02)
layer-b: 100% [=============================] 25/25 (0:00:00 / 0:00:00)
Completed sync up to version 1
Local catalog hrn:local:data:::catalog-example createdlocal catalog copy update
Updates a local catalog copy by pulling configuration and data changes. The filters setup with
olp local catalog copy create are automatically used.
olp local catalog copy update <catalog ID or local catalog HRN> [command options]Required parameters:
Either the following must be specified:
<local catalog ID>The catalog ID of an existing local catalog copy.<local catalog HRN>The local HRN of an existing local catalog copy.
Optional parameters:
--configuration-onlyCopies the catalog configuration but leaves the local catalog empty.--copy-schemasDownloads the schema bundles locally. This is useful for offline inspection.--version <catalog version>The last metadata version that should be copied. All versions from--minimum-versionto--versionwill be copied. It has no effect if--configuration-onlyis used. By default, it is the latest version of the catalog.--stream-limit <number>Maximum number of partitions to be copied from stream layers.--stream-timeout <timeout s>Timeout in seconds for the copy of stream partitions.--credentials <path to credentials file>The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.--profile <profile name>The name of the credentials profile to use from theolpcli.inifile.--quietDisplays empty output with no additional information.--scope <project HRN>Specifies the project HRN to use as the scope in the request. The value specified with--scopeoverrides any value forhere.token.scopeprovided in the credentials file used for the command.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp local catalog copy update hrn:local:data:::catalog-exampleOutput:
Catalog hrn:local:data:::catalog-example has been updatedExample with additional parameters:
olp local catalog copy update hrn:local:data:::catalog-example --version 10Output:
Catalog hrn:local:data:::catalog-example has been updatedUpdated 22 days ago