Object Store

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 parameter in the catalog object store layer. The command retrieves the blob content into the standard output.

Linux
Windows
olp catalog layer object get <catalog HRN> <layer ID> \
    --key <object key> [command options]
olp catalog layer object get <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 to get.

Optional parameters:

  • --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. For more information about the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
  • --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.

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

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.

Linux
Windows
olp catalog layer object get hrn:here:data::myrealm:catalog1 objectstore-layer1 \
   --key someDir/someObject > <output_file_path>
olp catalog layer object get hrn:here:data::myrealm:catalog1 objectstore-layer1 ^
   --key someDir/someObject > <output_file_path>

Example:

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

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

catalog layer object put

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

Linux
Windows
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, such as gzip and compress. If this parameter is specified, the data is compressed by the specified algorithm. The default value is Uncompressed, which means no compression.
  • --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.

Linux
Windows
olp catalog layer object put hrn:here:data::myrealm: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::myrealm:catalog1 objectstore-layer1 ^
   --key someDir/someObject --data <input_file_path> --content-type application/json --content-encoding gzip

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.

Linux
Windows
olp catalog layer object put hrn:here:data::myrealm:catalog1 objectstore-layer1 \
   --key someDir/someObject < <input_file_path>
olp catalog layer object put hrn:here:data::myrealm:catalog1 objectstore-layer1 ^
   --key someDir/someObject < <input_file_path>

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.

Example:

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.

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

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

catalog layer object copy

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

Linux
Windows
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.

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

catalog layer object delete

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

Linux
Windows
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.

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

catalog layer object list

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

Linux
Windows
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.
  • --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's 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::myrealm:catalog1 layer1

Output:


Available object store items:

name                                    keyType                       lastModified                                      size
tmpDir                                  commonPrefix

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::myrealm:catalog1 layer1 --key tempDir/commonPrefix

Output:


Available object store items:

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

results matching ""

    No results matching ""