forked from TrueCloudLab/frostfs-node
Embed https://git.frostfs.info/dkirillov/policy-reader tool to 'frostfs-adm morph ape' command Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
33 lines
836 B
Go
33 lines
836 B
Go
package raw
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var Cmd = &cobra.Command{
|
|
Use: "raw",
|
|
Short: "FrostFS policy contract raw reader",
|
|
Long: "Helps reading policy information from contact in FrostFS network",
|
|
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
|
|
_ = viper.BindPFlag(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
|
},
|
|
}
|
|
|
|
const (
|
|
policyHashFlag = "policy-hash"
|
|
)
|
|
|
|
func init() {
|
|
Cmd.PersistentFlags().String(policyHashFlag, "policy.frostfs", "NNS name or script hash of policy contract")
|
|
|
|
Cmd.AddCommand(listTargetsCmd)
|
|
initListTargetsCmd()
|
|
|
|
Cmd.AddCommand(listChainNamesCmd)
|
|
initListChainNamesCmd()
|
|
|
|
Cmd.AddCommand(listChainsByPrefixCmd)
|
|
initListChainsByPrefixCmd()
|
|
}
|