メインコンテンツまでスキップ
バージョン: 3.12

ScalarDL HashStore コマンドリファレンス

注記

このページは英語版のページが機械翻訳されたものです。英語版との間に矛盾または不一致がある場合は、英語版を正としてください。

このページでは、ScalarDL HashStore とやりとりするためのクライアントコマンドである scalardl-hashstore について説明します。

コマンドの概要

  • HashStore のブートストラップ
    • bootstrap: HashStore を使用するために必要な ID と事前定義されたコントラクトを登録してブートストラップを実行します。
  • オブジェクトの管理
    • get-object: HashStore からオブジェクトを取得します。
    • put-object: HashStore にオブジェクトを保存します。
    • compare-object-versions: オブジェクトのバージョンを比較します。
  • コレクションの管理
  • 台帳の検証
    • validate-ledger: HashStore 内の指定されたオブジェクトまたはコレクションを検証します。

bootstrap

HashStore を使用するために必要な ID と事前定義されたコントラクトを登録してブートストラップを実行します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。

共通ユーティリティオプションも利用できます。

scalardl-hashstore bootstrap --properties client.properties

get-object

HashStore からオブジェクトを取得します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--object-id取得するオブジェクトの ID。

共通ユーティリティオプションも利用できます。

scalardl-hashstore get-object --properties client.properties --object-id foo

put-object

HashStore にオブジェクトを保存します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--object-id保存するオブジェクトの ID。
--hashオブジェクトのハッシュ値。
--metadataオプションのメタデータ (JSON 文字列)。
--put-to-mutableミュータブルデータベースに対するオプションの Put 操作 (JSON 文字列)。

共通ユーティリティオプションも利用できます。

ハッシュ値を持つオブジェクトを保存します。

scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c

メタデータを持つオブジェクトを保存します。

scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c --metadata '{"note": "updated"}'

compare-object-versions

オブジェクトのバージョンを比較します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--object-idバージョンを比較するオブジェクトの ID。
--versions比較するオブジェクトのバージョン (JSON 配列)。
--all台帳に保存されているすべてのバージョンを含めて比較します。
--verbose詳細な検証情報を表示します。

共通ユーティリティオプションも利用できます。

引数で指定された最新バージョンを比較します。

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]'

HashStore に保存されているすべてのバージョンを比較します。

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]' --all

詳細出力で比較します。

scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}]' --verbose

create-collection

新しいコレクションを作成します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--collection-id作成するコレクションの ID。
--object-idsコレクションに含めるオブジェクト ID。

共通ユーティリティオプションも利用できます。

空のコレクションを作成します。

scalardl-hashstore create-collection --properties client.properties --collection-id audit_set

初期オブジェクトを含むコレクションを作成します。

scalardl-hashstore create-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2

get-collection

HashStore からコレクションを取得します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--collection-id取得するコレクションの ID。

共通ユーティリティオプションも利用できます。

scalardl-hashstore get-collection --properties client.properties --collection-id audit_set

add-to-collection

オブジェクトをコレクションに追加します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--collection-idコレクションの ID。
--object-idsコレクションに追加するオブジェクト ID。
--forceコレクションに既に存在する重複オブジェクト ID の検証をスキップします。

共通ユーティリティオプションも利用できます。

オブジェクトをコレクションに追加します。

scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --object-ids object4

force オプションを使用してオブジェクトを追加します。

scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --force

remove-from-collection

コレクションからオブジェクトを削除します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--collection-idコレクションの ID。
--object-idsコレクションから削除するオブジェクト ID。
--forceコレクションに存在しないオブジェクト ID の検証をスキップします。

共通ユーティリティオプションも利用できます。

コレクションからオブジェクトを削除します。

scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2

force オプションを使用してオブジェクトを削除します。

scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --force

get-collection-history

コレクションの履歴を取得します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--collection-idコレクションの ID。
--limit取得する最新の履歴エントリの最大数。

共通ユーティリティオプションも利用できます。

コレクションのすべての履歴を取得します。

scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set

コレクションの限定された履歴を取得します。

scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set --limit 10

validate-ledger

HashStore 内の指定されたオブジェクトまたはコレクションを検証します。

オプション

オプション説明
--config, --properties.properties 形式の設定ファイル。
--object-id検証するオブジェクトの ID。
--collection-id検証するコレクションの ID。
--start-age検証範囲の開始世代。
--end-age検証範囲の終了世代。

共通ユーティリティオプションも利用できます。

すべての世代のオブジェクトを検証します。

scalardl-hashstore validate-ledger --properties client.properties --object-id foo

世代 0 から世代 10 までのオブジェクトのみを検証します。

scalardl-hashstore validate-ledger --properties client.properties --object-id foo --start-age 0 --end-age 10

すべての世代のコレクションを検証します。

scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set

世代 0 から世代 5 までのコレクションのみを検証します。

scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set --start-age 0 --end-age 5

共通ユーティリティオプション

上記のすべてのコマンドで、以下のオプションを使用できます。

オプション説明
-g, --use-gatewayゲートウェイを使用するオプション。
-h, --helpコマンドのヘルプメッセージを表示します。
--stacktraceJava スタックトレースを stderr ストリームに出力します。