Documentation ¶
Index ¶
Constants ¶
View Source
const ENABLED = "true"
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "apigeecli", Short: "Utility to work with Apigee APIs.", Long: "This command lets you interact with Apigee APIs.", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if metadataToken && defaultToken { return fmt.Errorf("metadata-token and default-token cannot be used together") } if defaultToken && (serviceAccount != "" || accessToken != "") { return fmt.Errorf("default-token cannot be used with token or account flags") } if metadataToken && (serviceAccount != "" || accessToken != "") { return fmt.Errorf("metadata-token cannot be used with token or account flags") } if serviceAccount != "" && accessToken != "" { return fmt.Errorf("token and account flags cannot be used together") } if !disableCheck { if ok, _ := apiclient.TestAndUpdateLastCheck(); !ok { latestVersion, _ := getLatestVersion() if cmd.Version == "" { clilog.Debug.Println("apigeecli wasn't built with a valid Version tag.") } else if latestVersion != "" && cmd.Version != latestVersion { clilog.Info.Printf("You are using %s, the latest version %s "+ "is available for download\n", cmd.Version, latestVersion) } } } if !metadataToken && !defaultToken { apiclient.SetServiceAccount(serviceAccount) apiclient.SetApigeeToken(accessToken) } if metadataToken { return apiclient.GetMetadataAccessToken() } if defaultToken { return apiclient.GetDefaultAccessToken() } _ = apiclient.SetAccessToken() return nil }, SilenceUsage: getUsageFlag(), SilenceErrors: getErrorsFlag(), }
RootCmd to manage apigeecli
Functions ¶
func GetRootCmd ¶
GetRootCmd returns the root of the cobra command-tree.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.