Skip to content

Commit

Permalink
Db/delete integration cmd (#341)
Browse files Browse the repository at this point in the history
* support deleting an integration

* bump versions
  • Loading branch information
davidbloss authored Oct 16, 2024
1 parent 547d59a commit bf294ba
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Dependency-20241016-144345.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Dependency
body: bump opslevel-go version to v2024.10.15
time: 2024-10-16T14:43:45.400052-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20241016-144239.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: delete integration command added
time: 2024-10-16T14:42:39.505046-05:00
15 changes: 15 additions & 0 deletions src/cmd/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -251,6 +265,7 @@ func init() {
getCmd.AddCommand(getIntegrationCmd)
listCmd.AddCommand(listIntegrationCmd)
updateCmd.AddCommand(updateIntegrationCmd)
deleteCmd.AddCommand(deleteIntegrationCmd)

updateIntegrationCmd.AddCommand(reactivateIntegrationCmd)
}
4 changes: 2 additions & 2 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down

0 comments on commit bf294ba

Please sign in to comment.