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--filterparameter.--filter <glob-pattern>The filter for getting only the objects matching it, for example folder/*.txt. Cannot be used with the--keyparameter.--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 patternbytes={rangeStart | required}-{rangeEnd | optional}. Either{rangeStart}or both values should be provided. The parameter is available only in combination with the--keyparameter. 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,\nto print each changeset in the new line). Default delimiter is empty.--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:
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/someObjectolp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObjectOutput:
Blob content exampleExample:
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_FILEolp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObject > PATH/TO/OUTPUT_FILEExample:
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-100olp catalog layer object get hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObject --range bytes=10-100Output:
Note that the downloaded content will be printed to standard output:
Blob content examplecatalog 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 asapplication/jsonandtext/plain. The default value isapplication/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 isgzip. The default value isUncompressed, which means no compression. When you execute theolp catalog layer object getcommand, the OLP CLI will automatically return uncompressed data.--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:
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 gzipolp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObject --data <input_file_path> --content-type application/json --content-encoding gzipOutput:
Uploaded the BLOB to objectstore-layer1 object store layerExample:
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_FILEolp catalog layer object put hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObject < PATH/TO/INPUT_FILEOutput:
Uploaded the BLOB to objectstore-layer1 object store layerExample:
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/someOtherObjectolp 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/someOtherObjectOutput:
Uploaded the BLOB to objectstore-layer1 object store layercatalog 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 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:
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/destinationObjectolp catalog layer object copy hrn:here:data::org:catalog1 objectstore-layer1 ^
--source someDir/someObject --key someDir/destinationObjectOutput:
Object someDir/someObject has been successfully copied to someDir/destinationObjectcatalog 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 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:
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/someObjectolp catalog layer object delete hrn:here:data::org:catalog1 objectstore-layer1 ^
--key someDir/someObjectOutput:
Object someDir/someObject has been successfully deletedcatalog 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:
nameThe 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.keyTypeThe type of the prefix specified in thenameproperty. AvailablekeyTypeset of values:commonPrefixThe name of the object store item contains the common prefix under the parent key or first part of the object key.objectThe name of the object store item contains full key of the object.
lastModifiedThe date when the object has been modified. Available only for items of theobjecttype.sizeThe size of the object. Available only for items of theobjecttype.
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.--deepLists 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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--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:
The command below lists all object store items from layer1 in the catalog
catalog1.
olp catalog layer object list hrn:here:data::org:catalog1 layer1Output:
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 layerExample:
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/commonPrefixOutput:
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 layerUpdated 22 days ago