[#550] cli: make get-op-log meta pretty formatted
All checks were successful
Build / Build Components (1.19) (pull_request) Successful in 2m1s
Build / Build Components (1.20) (pull_request) Successful in 1m49s
Tests and linters / Lint (pull_request) Successful in 1m44s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m9s
Tests and linters / Tests with -race (pull_request) Successful in 5m6s
Tests and linters / Staticcheck (pull_request) Successful in 2m21s
Vulncheck / Vulncheck (pull_request) Successful in 1m0s
Tests and linters / Tests (1.20) (pull_request) Successful in 15m30s
All checks were successful
Build / Build Components (1.19) (pull_request) Successful in 2m1s
Build / Build Components (1.20) (pull_request) Successful in 1m49s
Tests and linters / Lint (pull_request) Successful in 1m44s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m9s
Tests and linters / Tests with -race (pull_request) Successful in 5m6s
Tests and linters / Staticcheck (pull_request) Successful in 2m21s
Vulncheck / Vulncheck (pull_request) Successful in 1m0s
Tests and linters / Tests (1.20) (pull_request) Successful in 15m30s
Close #550 Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
parent
b8052c794e
commit
0287d91378
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key"
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key"
|
||||||
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
||||||
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/pilorama"
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/tree"
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/tree"
|
||||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -75,7 +76,15 @@ func getOpLog(cmd *cobra.Command, _ []string) {
|
||||||
cmd.Println("Parent ID: ", o.GetParentId())
|
cmd.Println("Parent ID: ", o.GetParentId())
|
||||||
|
|
||||||
cmd.Println("\tChild ID: ", o.GetChildId())
|
cmd.Println("\tChild ID: ", o.GetChildId())
|
||||||
cmd.Printf("\tMeta: %s\n", o.GetMeta())
|
|
||||||
|
m := &pilorama.Meta{}
|
||||||
|
err = m.FromBytes(o.GetMeta())
|
||||||
|
commonCmd.ExitOnErr(cmd, "could not unmarshal meta: %w", err)
|
||||||
|
cmd.Printf("\tMeta:\n")
|
||||||
|
cmd.Printf("\t\tTime: %d\n", m.Time)
|
||||||
|
for _, item := range m.Items {
|
||||||
|
cmd.Printf("\t\t%s: %s\n", item.Key, item.Value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !errors.Is(err, io.EOF) {
|
if !errors.Is(err, io.EOF) {
|
||||||
commonCmd.ExitOnErr(cmd, "get op log response stream: %w", err)
|
commonCmd.ExitOnErr(cmd, "get op log response stream: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue