[#932] adm: Move cmd morph ape to ape package

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-02-01 10:20:17 +03:00
parent ba00fc4971
commit bee3741f4e
4 changed files with 25 additions and 18 deletions

View file

@ -1,4 +1,4 @@
package morph
package ape
import (
"bytes"
@ -33,11 +33,6 @@ const (
)
var (
apeCmd = &cobra.Command{
Use: "ape",
Short: "Section for APE configuration commands",
}
addRuleChainCmd = &cobra.Command{
Use: "add-rule-chain",
Short: "Add rule chain",
@ -90,7 +85,7 @@ var (
)
func initAddRuleChainCmd() {
apeCmd.AddCommand(addRuleChainCmd)
Cmd.AddCommand(addRuleChainCmd)
addRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
addRuleChainCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
@ -109,7 +104,7 @@ func initAddRuleChainCmd() {
}
func initRemoveRuleChainCmd() {
apeCmd.AddCommand(removeRuleChainCmd)
Cmd.AddCommand(removeRuleChainCmd)
removeRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
removeRuleChainCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
@ -123,7 +118,7 @@ func initRemoveRuleChainCmd() {
}
func initListRuleChainsCmd() {
apeCmd.AddCommand(listRuleChainsCmd)
Cmd.AddCommand(listRuleChainsCmd)
listRuleChainsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
listRuleChainsCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
@ -135,7 +130,7 @@ func initListRuleChainsCmd() {
}
func initSetAdminCmd() {
apeCmd.AddCommand(setAdminCmd)
Cmd.AddCommand(setAdminCmd)
setAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
setAdminCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
@ -144,7 +139,7 @@ func initSetAdminCmd() {
}
func initGetAdminCmd() {
apeCmd.AddCommand(getAdminCmd)
Cmd.AddCommand(getAdminCmd)
getAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
getAdminCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)

View file

@ -1,4 +1,4 @@
package morph
package ape
import (
"encoding/json"

View file

@ -0,0 +1,16 @@
package ape
import "github.com/spf13/cobra"
var Cmd = &cobra.Command{
Use: "ape",
Short: "Section for APE configuration commands",
}
func init() {
initAddRuleChainCmd()
initRemoveRuleChainCmd()
initListRuleChainsCmd()
initSetAdminCmd()
initGetAdminCmd()
}

View file

@ -1,6 +1,7 @@
package morph
import (
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/ape"
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@ -283,12 +284,7 @@ func init() {
initDepositoryNotaryCmd()
initNetmapCandidatesCmd()
RootCmd.AddCommand(apeCmd)
initAddRuleChainCmd()
initRemoveRuleChainCmd()
initListRuleChainsCmd()
initSetAdminCmd()
initGetAdminCmd()
RootCmd.AddCommand(ape.Cmd)
initProxyAddAccount()
initProxyRemoveAccount()