diff --git a/.changes/unreleased/Dependency-20241016-144345.yaml b/.changes/unreleased/Dependency-20241016-144345.yaml new file mode 100644 index 00000000..b28ad6bd --- /dev/null +++ b/.changes/unreleased/Dependency-20241016-144345.yaml @@ -0,0 +1,3 @@ +kind: Dependency +body: bump opslevel-go version to v2024.10.15 +time: 2024-10-16T14:43:45.400052-05:00 diff --git a/.changes/unreleased/Feature-20241016-144239.yaml b/.changes/unreleased/Feature-20241016-144239.yaml new file mode 100644 index 00000000..cdf4ce93 --- /dev/null +++ b/.changes/unreleased/Feature-20241016-144239.yaml @@ -0,0 +1,3 @@ +kind: Feature +body: delete integration command added +time: 2024-10-16T14:42:39.505046-05:00 diff --git a/src/cmd/integration.go b/src/cmd/integration.go index ce04bcda..96059ef2 100644 --- a/src/cmd/integration.go +++ b/src/cmd/integration.go @@ -231,6 +231,20 @@ EOF }, } +var deleteIntegrationCmd = &cobra.Command{ + Use: "integration {ID|ALIAS}", + Short: "Delete an integration", + Example: `opslevel delete integration Z2lkOi8vb123456789`, + Args: cobra.ExactArgs(1), + ArgAliases: []string{"ID", "ALIAS"}, + Run: func(cmd *cobra.Command, args []string) { + key := args[0] + err := getClientGQL().DeleteIntegration(key) + cobra.CheckErr(err) + fmt.Printf("integration '%s' deleted\n", key) + }, +} + var reactivateIntegrationCmd = &cobra.Command{ Use: "reactivate ID", Short: "Reactivate an integration", @@ -251,6 +265,7 @@ func init() { getCmd.AddCommand(getIntegrationCmd) listCmd.AddCommand(listIntegrationCmd) updateCmd.AddCommand(updateIntegrationCmd) + deleteCmd.AddCommand(deleteIntegrationCmd) updateIntegrationCmd.AddCommand(reactivateIntegrationCmd) } diff --git a/src/go.mod b/src/go.mod index 464f92f2..ccf94e7c 100644 --- a/src/go.mod +++ b/src/go.mod @@ -11,7 +11,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/mitchellh/mapstructure v1.5.0 github.com/open-policy-agent/opa v0.67.1 - github.com/opslevel/opslevel-go/v2024 v2024.10.11 + github.com/opslevel/opslevel-go/v2024 v2024.10.15 github.com/relvacode/iso8601 v1.4.0 github.com/rocktavious/autopilot v0.1.5 github.com/rs/zerolog v1.33.0 @@ -37,7 +37,7 @@ require ( github.com/cyphar/filepath-securejoin v0.2.5 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.5 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-ini/ini v1.67.0 // indirect diff --git a/src/go.sum b/src/go.sum index aaed1c57..4228e6e3 100644 --- a/src/go.sum +++ b/src/go.sum @@ -80,8 +80,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4= -github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4= +github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= +github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= @@ -196,10 +196,8 @@ github.com/open-policy-agent/opa v0.67.1 h1:rzy26J6g1X+CKknAcx0Vfbt41KqjuSzx4E0A github.com/open-policy-agent/opa v0.67.1/go.mod h1:aqKlHc8E2VAAylYE9x09zJYr/fYzGX+JKne89UGqFzk= github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12 h1:OQZ3W8kbyCcdS8QUWFTnZd6xtdkfhdckc7Paro7nXio= github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12/go.mod h1:g2GSXVP6LO+5+AIsnMRPN+BeV86OXuFRTX7HXCDtYeI= -github.com/opslevel/opslevel-go/v2024 v2024.9.18 h1:fb2fDPU6VZ6it39z6FDz34uQEJ8e42XLQUkQtfzECkk= -github.com/opslevel/opslevel-go/v2024 v2024.9.18/go.mod h1:u1IIoWb2zUpbjoX9mxwXHqlj8vLHS3+96z7pyUd3fs4= -github.com/opslevel/opslevel-go/v2024 v2024.10.11 h1:Lr4xLWU7P+ZXeswIw8yBoCwxKt+coN5fLyMnZ07xTrA= -github.com/opslevel/opslevel-go/v2024 v2024.10.11/go.mod h1:mSnWBEKMAgP4y5/U7GIt3ZXY7lO8cu6MQtrxRzeGpQg= +github.com/opslevel/opslevel-go/v2024 v2024.10.15 h1:ohWQQ38rKljeTtJHERC3YVO3vpJ9tVnuyCQZ9SO7R98= +github.com/opslevel/opslevel-go/v2024 v2024.10.15/go.mod h1:mSnWBEKMAgP4y5/U7GIt3ZXY7lO8cu6MQtrxRzeGpQg= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= diff --git a/src/submodules/opslevel-go b/src/submodules/opslevel-go index 62b28a99..40c286d6 160000 --- a/src/submodules/opslevel-go +++ b/src/submodules/opslevel-go @@ -1 +1 @@ -Subproject commit 62b28a9932c9f62a5aaa35e05b5e6466fcd0dfa1 +Subproject commit 40c286d6426381d5020b7fd752ac1878fd2f9996