From 737f82ed3f486442a14c732dd7da399eab577ec7 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Wed, 1 Nov 2023 10:40:35 -0500 Subject: [PATCH] "opslevel import group" command has been removed --- .../unreleased/Removed-20231101-104007.yaml | 3 ++ src/cmd/group.go | 42 ------------------- 2 files changed, 3 insertions(+), 42 deletions(-) create mode 100644 .changes/unreleased/Removed-20231101-104007.yaml diff --git a/.changes/unreleased/Removed-20231101-104007.yaml b/.changes/unreleased/Removed-20231101-104007.yaml new file mode 100644 index 00000000..ebe90e5c --- /dev/null +++ b/.changes/unreleased/Removed-20231101-104007.yaml @@ -0,0 +1,3 @@ +kind: Removed +body: '"opslevel import group" command has been removed' +time: 2023-11-01T10:40:07.550406-05:00 diff --git a/src/cmd/group.go b/src/cmd/group.go index 5ae12098..cb57d728 100644 --- a/src/cmd/group.go +++ b/src/cmd/group.go @@ -6,7 +6,6 @@ import ( "fmt" "github.com/opslevel/opslevel-go/v2023" - "github.com/rs/zerolog/log" "github.com/opslevel/cli/common" "github.com/spf13/cobra" @@ -270,46 +269,6 @@ var deleteGroupCmd = &cobra.Command{ }, } -var importGroupsCmd = &cobra.Command{ - Use: "group", - Aliases: []string{"groups"}, - Short: "Imports groups from a CSV", - Deprecated: `Please convert all Groups into Teams. See https://docs.opslevel.com/docs/groups`, - Long: `Imports a list of groups from a CSV file with the column headers: -Name,Description,Parent - -Example: - -cat << EOF | opslevel import group -f - -Name,Description,Parent -Engineering,All of Engineering, -Product,All of Product,engineering -Sales,Sales BU,product -EOF -`, - Run: func(cmd *cobra.Command, args []string) { - reader, err := readImportFilepathAsCSV() - cobra.CheckErr(err) - for reader.Rows() { - name := reader.Text("Name") - input := opslevel.GroupInput{ - Name: name, - Description: reader.Text("Description"), - } - parent := reader.Text("Parent") - if parent != "" { - input.Parent = opslevel.NewIdentifier(parent) - } - group, err := getClientGQL().CreateGroup(input) - if err != nil { - log.Error().Err(err).Msgf("error creating group '%s'", name) - continue - } - log.Info().Msgf("created group '%s' with id '%s'", group.Name, group.Id) - } - }, -} - func init() { createCmd.AddCommand(createGroupCmd) getCmd.AddCommand(getGroupCommand) @@ -321,5 +280,4 @@ func init() { listCmd.AddCommand(listGroupCmd) updateCmd.AddCommand(updateGroupCmd) deleteCmd.AddCommand(deleteGroupCmd) - importCmd.AddCommand(importGroupsCmd) }