Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added newrelic #1440

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/agent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var agentCmd = &cobra.Command{
Use: "agent",
Short: "Utilities for New Relic Agents",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(agentCmd).Standalone()
rootCmd.AddCommand(agentCmd)
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/agent_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var agent_configCmd = &cobra.Command{
Use: "config",
Short: "Configuration utilities/helpers for New Relic agents",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(agent_configCmd).Standalone()
agentCmd.AddCommand(agent_configCmd)
}
27 changes: 27 additions & 0 deletions completers/newrelic_completer/cmd/agent_config_migrateV3toV4.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var agent_config_migrateV3toV4Cmd = &cobra.Command{
Use: "migrateV3toV4",
Short: "migrate V3 configuration to V4 configuration format",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(agent_config_migrateV3toV4Cmd).Standalone()
agent_config_migrateV3toV4Cmd.Flags().Bool("overwrite", false, "if set ti true and pathOutput file exists already the old file is removed ")
agent_config_migrateV3toV4Cmd.Flags().StringP("pathConfiguration", "c", "", "path configuration")
agent_config_migrateV3toV4Cmd.Flags().StringP("pathDefinition", "d", "", "path definition")
agent_config_migrateV3toV4Cmd.Flags().StringP("pathOutput", "o", "", "path output")
agent_configCmd.AddCommand(agent_config_migrateV3toV4Cmd)

carapace.Gen(agent_config_migrateV3toV4Cmd).FlagCompletion(carapace.ActionMap{
"pathConfiguration": carapace.ActionFiles(),
"pathDefinition": carapace.ActionFiles(),
"pathOutput": carapace.ActionFiles(),
})
}
19 changes: 19 additions & 0 deletions completers/newrelic_completer/cmd/agent_config_obfuscate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var agent_config_obfuscateCmd = &cobra.Command{
Use: "obfuscate",
Short: "Obfuscate a configuration value using a key",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(agent_config_obfuscateCmd).Standalone()
agent_config_obfuscateCmd.Flags().StringP("key", "k", "", "the key to use when obfuscating the clear-text value")
agent_config_obfuscateCmd.Flags().StringP("value", "v", "", "the value, in clear text, to be obfuscated")
agent_configCmd.AddCommand(agent_config_obfuscateCmd)
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/apiAccess.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apiAccessCmd = &cobra.Command{
Use: "apiAccess",
Short: "Manage New Relic API access keys",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiAccessCmd).Standalone()
rootCmd.AddCommand(apiAccessCmd)
}
18 changes: 18 additions & 0 deletions completers/newrelic_completer/cmd/apiAccess_apiAccessCreateKeys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apiAccess_apiAccessCreateKeysCmd = &cobra.Command{
Use: "apiAccessCreateKeys",
Short: "Create keys. You can create keys for multiple accounts at once. You can read more about managing keys on [this documentation page](https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys).",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiAccess_apiAccessCreateKeysCmd).Standalone()
apiAccess_apiAccessCreateKeysCmd.Flags().String("keys", "", "A list of the configurations for each key you want to create.")
apiAccessCmd.AddCommand(apiAccess_apiAccessCreateKeysCmd)
}
18 changes: 18 additions & 0 deletions completers/newrelic_completer/cmd/apiAccess_apiAccessDeleteKeys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apiAccess_apiAccessDeleteKeysCmd = &cobra.Command{
Use: "apiAccessDeleteKeys",
Short: "A mutation to delete keys.",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiAccess_apiAccessDeleteKeysCmd).Standalone()
apiAccess_apiAccessDeleteKeysCmd.Flags().String("keys", "", "A list of each key `id` that you want to delete. You can read more about managing keys on [this documentation page](https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys).")
apiAccessCmd.AddCommand(apiAccess_apiAccessDeleteKeysCmd)
}
21 changes: 21 additions & 0 deletions completers/newrelic_completer/cmd/apiAccess_apiAccessGetKey.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apiAccess_apiAccessGetKeyCmd = &cobra.Command{
Use: "apiAccessGetKey",
Short: "Fetch a single key by ID and type.",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiAccess_apiAccessGetKeyCmd).Standalone()
apiAccess_apiAccessGetKeyCmd.Flags().String("id", "", "The `id` of the key. This can be used to identify a key without revealing the key itself (used to update and delete).")
apiAccess_apiAccessGetKeyCmd.Flags().String("keyType", "", "The type of key.")
apiAccessCmd.AddCommand(apiAccess_apiAccessGetKeyCmd)

// TODO keytype
}
18 changes: 18 additions & 0 deletions completers/newrelic_completer/cmd/apiAccess_apiAccessUpdateKeys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apiAccess_apiAccessUpdateKeysCmd = &cobra.Command{
Use: "apiAccessUpdateKeys",
Short: "Update keys. You can update keys for multiple accounts at once. You can read more about managing keys on [this documentation page](https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys).",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiAccess_apiAccessUpdateKeysCmd).Standalone()
apiAccess_apiAccessUpdateKeysCmd.Flags().String("keys", "", "The configurations of each key you want to update.")
apiAccessCmd.AddCommand(apiAccess_apiAccessUpdateKeysCmd)
}
25 changes: 25 additions & 0 deletions completers/newrelic_completer/cmd/apm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/newrelic"
"github.com/spf13/cobra"
)

var apmCmd = &cobra.Command{
Use: "apm",
Short: "Interact with New Relic APM",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apmCmd).Standalone()
apmCmd.PersistentFlags().Int("applicationId", 0, "A New Relic APM application ID")
rootCmd.AddCommand(apmCmd)

carapace.Gen(apmCmd).FlagCompletion(carapace.ActionMap{
"applicationId": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
return newrelic.ActionApplicationIds(apmCmd.Flag("profile").Value.String())
}),
})
}
25 changes: 25 additions & 0 deletions completers/newrelic_completer/cmd/apm_application.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/newrelic"
"github.com/spf13/cobra"
)

var apm_applicationCmd = &cobra.Command{
Use: "application",
Short: "Interact with New Relic APM applications",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_applicationCmd).Standalone()
apm_applicationCmd.PersistentFlags().StringP("guid", "g", "", "search for results matching the given APM application GUID")
apmCmd.AddCommand(apm_applicationCmd)

carapace.Gen(apm_applicationCmd).FlagCompletion(carapace.ActionMap{
"guid": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
return newrelic.ActionApplicationGuids(apm_applicationCmd.Flag("profile").Value.String())
}),
})
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/apm_application_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_application_getCmd = &cobra.Command{
Use: "get",
Short: "Get a New Relic application",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_application_getCmd).Standalone()
apm_applicationCmd.AddCommand(apm_application_getCmd)
}
18 changes: 18 additions & 0 deletions completers/newrelic_completer/cmd/apm_application_search.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_application_searchCmd = &cobra.Command{
Use: "search",
Short: "Search for a New Relic application",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_application_searchCmd).Standalone()
apm_application_searchCmd.Flags().StringP("name", "n", "", "search for results matching the given APM application name")
apm_applicationCmd.AddCommand(apm_application_searchCmd)
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/apm_deployment.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_deploymentCmd = &cobra.Command{
Use: "deployment",
Short: "Manage New Relic APM deployment markers",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_deploymentCmd).Standalone()
apmCmd.AddCommand(apm_deploymentCmd)
}
21 changes: 21 additions & 0 deletions completers/newrelic_completer/cmd/apm_deployment_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_deployment_createCmd = &cobra.Command{
Use: "create",
Short: "Create a New Relic APM deployment",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_deployment_createCmd).Standalone()
apm_deployment_createCmd.Flags().String("change-log", "", "the change log stored with the deployment")
apm_deployment_createCmd.Flags().String("description", "", "the description stored with the deployment")
apm_deployment_createCmd.Flags().StringP("revision", "r", "", "a freeform string representing the revision of the deployment")
apm_deployment_createCmd.Flags().String("user", "", "the user creating with the deployment")
apm_deploymentCmd.AddCommand(apm_deployment_createCmd)
}
18 changes: 18 additions & 0 deletions completers/newrelic_completer/cmd/apm_deployment_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_deployment_deleteCmd = &cobra.Command{
Use: "delete",
Short: "Delete a New Relic APM deployment",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_deployment_deleteCmd).Standalone()
apm_deployment_deleteCmd.Flags().IntP("deploymentID", "d", 0, "the ID of the deployment to be deleted")
apm_deploymentCmd.AddCommand(apm_deployment_deleteCmd)
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/apm_deployment_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var apm_deployment_listCmd = &cobra.Command{
Use: "list",
Short: "List New Relic APM deployments for an application",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apm_deployment_listCmd).Standalone()
apm_deploymentCmd.AddCommand(apm_deployment_listCmd)
}
22 changes: 22 additions & 0 deletions completers/newrelic_completer/cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var completionCmd = &cobra.Command{
Use: "completion",
Short: "Generate completion script",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(completionCmd).Standalone()
completionCmd.Flags().String("shell", "", "Output completion for the specified shell. (bash, powershell, zsh)")
rootCmd.AddCommand(completionCmd)

carapace.Gen(completionCmd).FlagCompletion(carapace.ActionMap{
"shell": carapace.ActionValues("bash", "powershell", "zsh"),
})
}
17 changes: 17 additions & 0 deletions completers/newrelic_completer/cmd/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var configCmd = &cobra.Command{
Use: "config",
Short: "Manage the configuration of the New Relic CLI",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(configCmd).Standalone()
rootCmd.AddCommand(configCmd)
}
Loading