GuidesChangelogData Inspector Library API Reference
Guides

catalog layer object

catalog layer object

The OLP CLI supports the following:

  • get a blob from an object store layer
  • put a blob to an object store layer
  • copy a blob in an object store layer
  • delete a blob from an object store layer
  • list object store items from an object store layer

catalog layer object get

Downloads the blob that is specified with the --key or --filter parameter in the catalog object store layer. The command retrieves the blob content into the standard output or stores it to the specified directory in case of using --output parameter.

olp catalog layer object get <catalog HRN> <layer ID> \
    [command options]
olp catalog layer object get <catalog HRN> <layer ID> ^
    [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --key <object key> The key of the object to get. Cannot be used with the --filter parameter.
  • --filter <glob-pattern> The filter for getting only the objects matching it, for example folder/*.txt. Cannot be used with the --key parameter.
  • --range <byte range> Downloads the specified bytes range of an object (for example, bytes=0-, bytes=10-200). The parameter value must conform to the pattern bytes={rangeStart | required}-{rangeEnd | optional}. Either {rangeStart} or both values should be provided. The parameter is available only in combination with the --key parameter. For more information about the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
  • --output <path to dir> The output directory to store the downloaded data. Files are created with the identical names. If the specified directory doesn't exist, it is automatically created.
  • --delimiter <character> A delimiter used for printing stream data to the standard output (for example, \n to print each changeset in the new line). Default delimiter is empty.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays 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 --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below downloads the blob content under the key someDir/someObject from the object store layer objectstore-layer1 in catalog1 into the standard output.

olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject
olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject

Output:

Blob content example

Example:

The command below downloads the blob under the key someDir/someObject from the object store layer objectstore-layer1 in catalog1 to the specified output file.

olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject > PATH/TO/OUTPUT_FILE
olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject > PATH/TO/OUTPUT_FILE

Example:

To download the range of bytes from the blob, specify an optional parameter --range. For example, use the following command to download bytes from 10 to 100:

olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject --range bytes=10-100
olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject --range bytes=10-100

Output:

Note that the downloaded content will be printed to standard output:

Blob content example

catalog layer object put

Uploads the file under the specified key to the object store layer.

olp catalog layer object put <catalog HRN> <layer ID> \
    --key <object key> [command options]
olp catalog layer object put <catalog HRN> <layer ID> ^
    --key <object key> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.
  • --key <object key> The key of the object for which the upload operation has been initiated.

Optional parameters:

  • --data <path to input file> The input file for the object store data. If no file is specified, the command reads the data from the standard output.
  • --content-type <content type> The content type of the data that is to be uploaded, such as application/json and text/plain. The default value is application/octet-stream.
  • --content-encoding <encoding type> The content encoding of the data that is to be uploaded. If this parameter is specified, the OLP CLI will compress data using the specified algorithm and upload compressed data to the object store layer. The only available encoding type is gzip. The default value is Uncompressed, which means no compression. When you execute the olp catalog layer object get command, the OLP CLI will automatically return uncompressed data.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays 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 --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below uploads the data from the specified input file to the object store layer objectstore-layer1 in catalog1 under the object key someDir/someObject with the application/json content type of the data and the gzip content encoding format.

olp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject --data <input_file_path> --content-type application/json --content-encoding gzip
olp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject --data <input_file_path> --content-type application/json --content-encoding gzip

Output:

Uploaded the BLOB to objectstore-layer1 object store layer

Example:

The command below reads from the standard output the piped data from the specified input file and uploads the data to the object store layer objectstore-layer1 in catalog1 under the object key someDir/someObject.

olp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject < PATH/TO/INPUT_FILE
olp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject < PATH/TO/INPUT_FILE

Output:

Uploaded the BLOB to objectstore-layer1 object store layer

Example:

OLP CLI lets you chain both get and put commands, as get retrieves content into the standard output. For more information, see catalog layer object get.

The command below downloads the blob under the key someDir/someObject from the object store layer objectstore-layer1 in catalog1 and uploads the data to the object store layer objectstore-layer2 in catalog2 under the object key someDir/someOtherObject.

olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject | olp catalog layer object put hrn:here:data::org:catalog2 \
   objectstore-layer2 --key someDir/someOtherObject
olp catalog layer partition get hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject | olp catalog layer object put hrn:here:data::org:catalog2 ^
   objectstore-layer2 --key someDir/someOtherObject

Output:

Uploaded the BLOB to objectstore-layer1 object store layer

catalog layer object copy

Copies the blob under the specified source key to the destination key in the object store layer.

olp catalog layer object copy <catalog HRN> <layer ID> \
    --source <source object key> --key <object key> [command options]
olp catalog layer object copy <catalog HRN> <layer ID> ^
    --source <source object key> --key <object key> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.
  • --source <source object key> The source key of the object for which the copy operation has been initiated.
  • --key <object key> The destination key for which the copy operation has been initiated.

Optional parameters:

  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays 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 --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below copies the blob in the object store layer objectstore-layer1 in catalog1 from the source object key someDir/someObject to the destination key someDir/destinationObject.

olp catalog layer object copy hrn:here:data::org:catalog1 objectstore-layer1 \
   --source someDir/someObject --key someDir/destinationObject
olp catalog layer object copy hrn:here:data::org:catalog1 objectstore-layer1 ^
   --source someDir/someObject --key someDir/destinationObject

Output:

Object someDir/someObject has been successfully copied to someDir/destinationObject

catalog layer object delete

Deletes the blob under the specified key from the object store layer.

olp catalog layer object delete <catalog HRN> <layer ID> \
    --key <object key> [command options]
olp catalog layer object delete <catalog HRN> <layer ID> ^
    --key <object key> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.
  • --key <object key> The key of the object for which the delete operation has been initiated.

Optional parameters:

  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays 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 --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below deletes the blob from the object store layer objectstore-layer1 in catalog1 under the object key someDir/someObject.

olp catalog layer object delete hrn:here:data::org:catalog1 objectstore-layer1 \
   --key someDir/someObject
olp catalog layer object delete hrn:here:data::org:catalog1 objectstore-layer1 ^
   --key someDir/someObject

Output:

Object someDir/someObject has been successfully deleted

catalog layer object list

Lists object store items from the object store layer under the specified parent key.

olp catalog layer object list <catalog HRN> <layer ID> \
    --key <parent key> [command options]
olp catalog layer object list <catalog HRN> <layer ID> ^
    --key <parent key> [command options]

Object store item properties:

  • name The name of the object store item. The part of descendant prefix of the object key matching the parent key if specified. If parent key not specified, first part of the object key displayed. Contains either common prefix of the objects stored in object store layer, or full object key.
  • keyType The type of the prefix specified in the name property. Available keyType set of values:
    • commonPrefix The name of the object store item contains the common prefix under the parent key or first part of the object key.
    • object The name of the object store item contains full key of the object.
  • lastModified The date when the object has been modified. Available only for items of the object type.
  • size The size of the object. Available only for items of the object type.

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --key <parent key> The parent key of the object items for which the list operation has been initiated.
  • --deep Lists items recursively from the specified parent key.
  • --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 the olpcli.ini file.
  • --json Displays the command result in JSON format.
  • --quiet Displays partition names, each on a new line.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below lists all object store items from layer1 in the catalog catalog1.

olp catalog layer object list hrn:here:data::org:catalog1 layer1

Output:

name                 keyType           lastModified          size
tmpDir               commonPrefix

Use olp catalog layer object get <catalog HRN> <layer ID> --key=<objectKey> to read BLOBs from the object store layer

Example:

The command below lists all object store items from layer1 in the catalog catalog1 that match the common parent key prefix tempDir/commonPrefix.

olp catalog layer object list hrn:here:data::org:catalog1 layer1 --key tempDir/commonPrefix

Output:

name                             keyType      lastModified                      size
tmpDir/commonPrefix/file1        object       2020-07-21T13:28:02.769Z          48
tmpDir/commonPrefix/file2        object       2020-07-21T13:28:07.423Z          48

Total size: 96 B
Use olp catalog layer object get <catalog HRN> <layer ID> --key=<objectKey> to read BLOBs from the object store layer