ScalarDL HashStore コマンドリファレンス
注記
このページは英語版のページが機械翻訳されたものです。英語版との間に矛盾または不一致がある場合は、英語版を正としてください。
このページでは、ScalarDL HashStore とやりとりするためのクライアントコマンドである scalardl-hashstore について説明します。
コマンドの概要
- HashStore のブートストラップ
bootstrap: HashStore を使用するために必要な ID と事前定義されたコントラクトを登録してブートストラップを実行します。
- オブジェクトの管理
get-object: HashStore からオブジェクトを取得します。put-object: HashStore にオブジェクトを保存します。compare-object-versions: オブジェクトのバージョンを比較します。
- コレクションの管理
create-collection: 新しいコレクションを作成します。get-collection: HashStore からコレクションを取得します。add-to-collection: オブジェクトをコレクションに追加します。remove-from-collection: コレクションからオブジェクトを削除します。get-collection-history: コレクションの履歴を取得します。
- 台帳の検証
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
オブジェクトをコレクションに追加します。