Documentation ¶
Index ¶
- Variables
- func ContextWithToken() context.Context
- func DefaultCACertificate() string
- func DefaultDeployment() string
- func DefaultFormat() string
- func DefaultGroup() string
- func DefaultIPAllowlist() string
- func DefaultMetricsToken() string
- func DefaultOrganization() string
- func DefaultOrganizationInvite() string
- func DefaultPluginHandler() string
- func DefaultProject() string
- func DefaultProvider() string
- func DefaultRegion() string
- func DefaultRole() string
- func DefaultServer() string
- func DefaultTermsAndConditions() string
- func DefaultURL() string
- func ExecuteCommandOrPlugin(root *cobra.Command, pluginHandler PluginHandler, args []string)
- func InitCommand(parent, cmd *cobra.Command, flagInit func(c *cobra.Command, f *flag.FlagSet)) *cobra.Command
- func MustCheckNumberOfArgs(args []string, expectedNumberOfArgs int)
- func MustDialAPI(opts ...MustDialOption) *grpc.ClientConn
- func OptOption(key, value string, args []string, argIndex int) (string, int)
- func OptOptionSlice(key string, value []string, args []string, argIndex int) ([]string, int)
- func ReqOption(key, value string, args []string, argIndex int) (string, int)
- func SetVersion(releaseVersion string)
- func ShowUsage(cmd *cobra.Command, args []string)
- func SplitByComma(input string) []string
- type MustDialOption
- type PluginHandler
Constants ¶
This section is empty.
Variables ¶
var ( // CreateCmd is root for various `create ...` commands CreateCmd = &cobra.Command{ Use: "create", Short: "Create resources", Run: ShowUsage, } // CreateMetricsCmd is root for various `create metrics ...` commands CreateMetricsCmd = &cobra.Command{ Use: "metrics", Short: "Create metrics resources", Run: ShowUsage, } // CreatePrivateCmd is root for various `create private ...` commands CreatePrivateCmd = &cobra.Command{ Use: "private", Short: "Create private resources", Run: ShowUsage, } )
var ( // DeleteCmd is root for various `delete ...` commands DeleteCmd = &cobra.Command{ Use: "delete", Short: "Delete resources", Run: ShowUsage, } // DeleteMetricsCmd is root for various `delete metrics ...` commands DeleteMetricsCmd = &cobra.Command{ Use: "metrics", Short: "Delete metrics resources", Run: ShowUsage, } )
var ( // GetCmd is root for various `get ...` commands GetCmd = &cobra.Command{ Use: "get", Short: "Get information", Run: ShowUsage, } // GetMetricsCmd is root for various `get metrics ...` commands GetMetricsCmd = &cobra.Command{ Use: "metrics", Short: "Get metrics information", Run: ShowUsage, } // GetPrivateCmd is root for various `get private ...` commands GetPrivateCmd = &cobra.Command{ Use: "private", Short: "Get private information", Run: ShowUsage, } )
var ( // ListCmd is root for various `list ...` commands ListCmd = &cobra.Command{ Use: "list", Short: "List resources", Run: ShowUsage, } // ListMetricsCmd is root for various `list metrics ...` commands ListMetricsCmd = &cobra.Command{ Use: "metrics", Short: "List metrics resources", Run: ShowUsage, } )
var ( // RevokeCmd is root for various `revoke ...` commands RevokeCmd = &cobra.Command{ Use: "revoke", Short: "Revoke keys & tokens", Run: ShowUsage, } // RevokeMetricsCmd is root for various `revoke metrics ...` commands RevokeMetricsCmd = &cobra.Command{ Use: "metrics", Short: "Revoke keys & tokens", Run: ShowUsage, } )
var ( // RootCmd is the root (and only) command of this service RootCmd = &cobra.Command{ Use: "oasisctl", Short: "ArangoGraph Insights Platform", Long: "ArangoGraph Insights Platform (formerly called Oasis): The Managed Cloud for ArangoDB", Run: ShowUsage, PersistentPreRun: rootCmdPersistentPreRun, } CLILog = zerolog.New(zerolog.ConsoleWriter{ Out: os.Stderr, NoColor: !supportsColor(), }).With().Timestamp().Logger() RootArgs struct { Token string Format format.Options // contains filtered or unexported fields } )
var ( // UpdateCmd is root for various `update ...` commands UpdateCmd = &cobra.Command{ Use: "update", Short: "Update resources", Run: ShowUsage, } // UpdateMetricsCmd is root for various `update metrics ...` commands UpdateMetricsCmd = &cobra.Command{ Use: "metrics", Short: "Update metrics resources", Run: ShowUsage, } // UpdatePrivateCmd is root for various `update private ...` commands UpdatePrivateCmd = &cobra.Command{ Use: "private", Short: "Update private resources", Run: ShowUsage, } )
var ( // AcceptCmd is root for various `accept ...` commands AcceptCmd = &cobra.Command{ Use: "accept", Short: "Accept invites", Run: ShowUsage, } )
var ( // AddAuditLogCmd is root for various `add auditlog...` commands AddAuditLogCmd = &cobra.Command{ Use: "auditlog", Short: "Add auditlog resources", Run: ShowUsage, } )
var ( // AddCmd is root for various `add ...` commands AddCmd = &cobra.Command{ Use: "add", Short: "Add resources", Run: ShowUsage, } )
var ( // AuditLogCmd is root for various `auditlog ...` commands AuditLogCmd = &cobra.Command{ Use: "auditlog", Short: "AuditLog resources", Run: ShowUsage, } )
var ( // AuditLogGetAttachedCmd is root for various `attached...` commands AuditLogGetAttachedCmd = &cobra.Command{ Use: "attached", Short: "Audit get attached resources", Run: ShowUsage, } )
var ( // AuditLogGetCmd is root for various `auditlog get...` commands AuditLogGetCmd = &cobra.Command{ Use: "get", Short: "Audit log get resources", Run: ShowUsage, } )
var ( // BackupCmd is root for various `backup ...` commands BackupCmd = &cobra.Command{ Use: "backup", Short: "Backup commands", Run: ShowUsage, } )
var ( // BackupListRootCmd is root for various `list backup ...` commands BackupListRootCmd = &cobra.Command{ Use: "backup", Short: "A list command for various backup resources", Run: ShowUsage, } )
var ( // CloneCmd is root for various `clone ...` commands CloneCmd = &cobra.Command{ Use: "clone", Short: "Clone resources", Run: ShowUsage, } )
var ( // CloneDeploymentCmd is root for various `clone deployment ...` commands CloneDeploymentCmd = &cobra.Command{ Use: "deployment", Short: "Clone deployment resources", Run: ShowUsage, } )
var ( // DisableCmd is root for various `enable ...` commands DisableCmd = &cobra.Command{ Use: "disable", Short: "Disable some settings related to deployment", Run: ShowUsage, } )
var ( // EnableCmd is root for various `enable ...` commands EnableCmd = &cobra.Command{ Use: "enable", Short: "Enable some settings related to deployment", Run: ShowUsage, } )
var ( // GenerateCmd is root for various `generate ...` commands GenerateCmd = &cobra.Command{ Use: "generate-docs", Short: "Generate output", Run: generateMarkdownRun, DisableAutoGenTag: true, DisableSuggestions: true, } )
var ( // GetServerCmd is based for other commands GetServerCmd = &cobra.Command{ Use: "server", Short: "Get server information", Run: ShowUsage, } )
var ( // ListArangoDBCmd is based for other commands ListArangoDBCmd = &cobra.Command{ Use: "arangodb", Short: "List ArangoDB information", Run: ShowUsage, } )
var ( // ListCmd is root for various `auditlog ...` commands ListAuditLogCmd = &cobra.Command{ Use: "auditlog", Short: "List resources for auditlogs", Run: ShowUsage, } )
var ( // ListEffectiveCmd is based for other commands ListEffectiveCmd = &cobra.Command{ Use: "effective", Short: "List effective information", Run: ShowUsage, } )
var ( // ListServersCmd is based for other commands ListServersCmd = &cobra.Command{ Use: "servers", Short: "List servers information", Run: ShowUsage, } )
var ( // LockCmd is root for various `lock ...` commands LockCmd = &cobra.Command{ Use: "lock", Short: "Lock resources", Run: ShowUsage, } )
var ( // LoginCmd is used to login using an API key LoginCmd = &cobra.Command{ Use: "login", Run: ShowUsage, } )
var ( // PauseCmd is root for various `pause ...` commands PauseCmd = &cobra.Command{ Use: "pause", Short: "Pause resources", Run: ShowUsage, } )
var ( // RebalanceCmd is root for various `rebalance ...` commands RebalanceCmd = &cobra.Command{ Use: "rebalance", Short: "Rebalance resources", Run: ShowUsage, } )
var ( // RebalanceDeploymentCmd is root for various `rebalance deployment ...` commands RebalanceDeploymentCmd = &cobra.Command{ Use: "deployment", Short: "Rebalance deployment resources", Run: ShowUsage, } )
var ( // RejectCmd is root for various `reject ...` commands RejectCmd = &cobra.Command{ Use: "reject", Short: "Reject invites", Run: ShowUsage, } )
var ( // RenewCmd is root for various `renew ...` commands RenewCmd = &cobra.Command{ Use: "renew", Short: "Renew keys & tokens", Run: ShowUsage, } )
var ( // ResumeCmd is root for various `resume ...` commands ResumeCmd = &cobra.Command{ Use: "resume", Short: "Resume resources", Run: ShowUsage, } )
var ( // RotateCmd is root for various `rotate ...` commands RotateCmd = &cobra.Command{ Use: "rotate", Short: "Rotate resources", Run: ShowUsage, } )
var ( // RotateDeploymentCmd is root for various `rotate deployment ...` commands RotateDeploymentCmd = &cobra.Command{ Use: "deployment", Short: "Rotate deployment resources", Run: ShowUsage, } )
var ( // UnlockCmd is root for various `unlock ...` commands UnlockCmd = &cobra.Command{ Use: "unlock", Short: "Unlock resources", Run: ShowUsage, } )
var ( // WaitCmd is root for various `wait ...` commands WaitCmd = &cobra.Command{ Use: "wait", Short: "Wait for a status change", Run: ShowUsage, } )
Functions ¶
func ContextWithToken ¶
ContextWithToken returns a context with access token in it.
func DefaultCACertificate ¶
func DefaultCACertificate() string
DefaultCACertificate returns the default value for a CA certificate identifier
func DefaultDeployment ¶
func DefaultDeployment() string
DefaultDeployment returns the default value for a deployment identifier
func DefaultFormat ¶
func DefaultFormat() string
DefaultFormat returns the default value for the output format
func DefaultGroup ¶
func DefaultGroup() string
DefaultGroup returns the default value for a group identifier
func DefaultIPAllowlist ¶ added in v0.17.0
func DefaultIPAllowlist() string
DefaultIPAllowlist returns the default value for an IP allowlist identifier
func DefaultMetricsToken ¶ added in v1.4.0
func DefaultMetricsToken() string
DefaultMetricsToken returns the default value for a metrics token identifier
func DefaultOrganization ¶
func DefaultOrganization() string
DefaultOrganization returns the default value for an organization identifier
func DefaultOrganizationInvite ¶
func DefaultOrganizationInvite() string
DefaultOrganizationInvite returns the default value for an organization-invite identifier
func DefaultPluginHandler ¶ added in v0.18.0
func DefaultPluginHandler() string
DefaultPluginHandler returns the default value for a URL
func DefaultProject ¶
func DefaultProject() string
DefaultProject returns the default value for a project identifier
func DefaultProvider ¶
func DefaultProvider() string
DefaultProvider returns the default value for a provider identifier
func DefaultRegion ¶
func DefaultRegion() string
DefaultRegion returns the default value for a region identifier
func DefaultRole ¶
func DefaultRole() string
DefaultRole returns the default value for a role identifier
func DefaultServer ¶ added in v1.1.0
func DefaultServer() string
DefaultServer returns the default value for a deployment server identifier
func DefaultTermsAndConditions ¶ added in v0.17.0
func DefaultTermsAndConditions() string
DefaultTermsAndConditions returns the default value for a terms and conditions identifier
func ExecuteCommandOrPlugin ¶ added in v0.18.0
func ExecuteCommandOrPlugin(root *cobra.Command, pluginHandler PluginHandler, args []string)
ExecuteCommandOrPlugin tries to find a builtin command and execute it. If no such command it found, a plugin searched for and executed when applicable.
func InitCommand ¶
func InitCommand(parent, cmd *cobra.Command, flagInit func(c *cobra.Command, f *flag.FlagSet)) *cobra.Command
InitCommand adds the given command to the given parent and called the flag initialization function.
func MustCheckNumberOfArgs ¶
MustCheckNumberOfArgs compares the number of arguments with the expected number of arguments. If there is a difference a fatal error is raised.
func MustDialAPI ¶
func MustDialAPI(opts ...MustDialOption) *grpc.ClientConn
MustDialAPI dials the ArangoDB Oasis API
func OptOption ¶
OptOption returns given value if not empty. Returns: option-value, number-of-args-used(0|argIndex+1)
func OptOptionSlice ¶ added in v1.1.0
OptOptionSlice returns given slice value if not empty. Returns: option-value, number-of-args-used(0|argIndex+1)
func ReqOption ¶
ReqOption returns given value if not empty. Fails with clear error message when not set. Returns: option-value, number-of-args-used(0|argIndex+1)
func SetVersion ¶
func SetVersion(releaseVersion string)
SetVersion must be called at bootstrap to pass the current build version
func SplitByComma ¶ added in v1.1.0
SplitByComma splits the given input around ',', returning an empty slice (nil) if the input is empty.
Types ¶
type MustDialOption ¶ added in v0.20.0
type MustDialOption func(*mustDialOptions)
MustDialOption type for MustDialAPI
func WithKeepAlive ¶ added in v0.20.0
func WithKeepAlive() MustDialOption
WithKeepAlive sets the connection to keepalive.
func WithoutVersionCheck ¶ added in v0.20.0
func WithoutVersionCheck() MustDialOption
WithoutVersionCheck disables the compatibility check during the dial operation
type PluginHandler ¶ added in v0.18.0
type PluginHandler interface { // Lookup will iterate over a list of given prefixes // in order to recognize valid plugin filenames. // Returns: the first filepath to match a prefix together with true // or false if no match is found. Lookup(filename string) (string, bool) // Execute receives an executable's filepath, a slice // of arguments, and a slice of environment variables // to relay to the executable. Execute(executablePath string, cmdArgs, environment []string) error }
PluginHandler is capable of parsing command line arguments and performing executable filename lookups to search for valid plugin files, and execute found plugins.
func NewDefaultPluginHandler ¶ added in v0.18.0
func NewDefaultPluginHandler(validPrefixes ...string) PluginHandler
NewDefaultPluginHandler instantiates the DefaultPluginHandler with a list of given filename prefixes used to identify valid plugin filenames.
Source Files ¶
- accept.go
- add.go
- add_auditlog.go
- auditlog.go
- auditlog_get.go
- auditlog_get_attached.go
- backup.go
- backup_policy_list_root.go
- clone.go
- clone_deployment.go
- completion.go
- create.go
- defaults.go
- delete.go
- disable.go
- enable.go
- expected_apis.go
- generate_docs.go
- get.go
- get_server.go
- list.go
- list_arangodb.go
- list_auditlog.go
- list_effective.go
- list_servers.go
- lock.go
- log.go
- login.go
- pause.go
- plugin.go
- rebalance.go
- rebalance_deployment.go
- reject.go
- renew.go
- resume.go
- revoke.go
- root.go
- rotate.go
- rotate_deployment.go
- unlock.go
- update.go
- upgrade.go
- version.go
- wait.go