cmd

package
v1.20.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
	}
)
View Source
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,
	}
)
View Source
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,
	}
)
View Source
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,
	}
)
View Source
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,
	}
)
View Source
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
	}
)
View Source
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,
	}
)
View Source
var (
	// AcceptCmd is root for various `accept ...` commands
	AcceptCmd = &cobra.Command{
		Use:   "accept",
		Short: "Accept invites",
		Run:   ShowUsage,
	}
)
View Source
var (
	// AddAuditLogCmd is root for various `add auditlog...` commands
	AddAuditLogCmd = &cobra.Command{
		Use:   "auditlog",
		Short: "Add auditlog resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// AddCmd is root for various `add ...` commands
	AddCmd = &cobra.Command{
		Use:   "add",
		Short: "Add resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// AuditLogCmd is root for various `auditlog ...` commands
	AuditLogCmd = &cobra.Command{
		Use:   "auditlog",
		Short: "AuditLog resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// AuditLogGetAttachedCmd is root for various `attached...` commands
	AuditLogGetAttachedCmd = &cobra.Command{
		Use:   "attached",
		Short: "Audit get attached resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// AuditLogGetCmd is root for various `auditlog get...` commands
	AuditLogGetCmd = &cobra.Command{
		Use:   "get",
		Short: "Audit log get resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// BackupCmd is root for various `backup ...` commands
	BackupCmd = &cobra.Command{
		Use:   "backup",
		Short: "Backup commands",
		Run:   ShowUsage,
	}
)
View Source
var (
	// BackupListRootCmd is root for various `list backup ...` commands
	BackupListRootCmd = &cobra.Command{
		Use:   "backup",
		Short: "A list command for various backup resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// CloneCmd is root for various `clone ...` commands
	CloneCmd = &cobra.Command{
		Use:   "clone",
		Short: "Clone resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// CloneDeploymentCmd is root for various `clone deployment ...` commands
	CloneDeploymentCmd = &cobra.Command{
		Use:   "deployment",
		Short: "Clone deployment resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// DisableCmd is root for various `enable ...` commands
	DisableCmd = &cobra.Command{
		Use:   "disable",
		Short: "Disable some settings related to deployment",
		Run:   ShowUsage,
	}
)
View Source
var (
	// EnableCmd is root for various `enable ...` commands
	EnableCmd = &cobra.Command{
		Use:   "enable",
		Short: "Enable some settings related to deployment",
		Run:   ShowUsage,
	}
)
View Source
var (
	// GenerateCmd is root for various `generate ...` commands
	GenerateCmd = &cobra.Command{
		Use:                "generate-docs",
		Short:              "Generate output",
		Run:                generateMarkdownRun,
		DisableAutoGenTag:  true,
		DisableSuggestions: true,
	}
)
View Source
var (
	// GetServerCmd is based for other commands
	GetServerCmd = &cobra.Command{
		Use:   "server",
		Short: "Get server information",
		Run:   ShowUsage,
	}
)
View Source
var (
	// ListArangoDBCmd is based for other commands
	ListArangoDBCmd = &cobra.Command{
		Use:   "arangodb",
		Short: "List ArangoDB information",
		Run:   ShowUsage,
	}
)
View Source
var (
	// ListCmd is root for various `auditlog ...` commands
	ListAuditLogCmd = &cobra.Command{
		Use:   "auditlog",
		Short: "List resources for auditlogs",
		Run:   ShowUsage,
	}
)
View Source
var (
	// ListEffectiveCmd is based for other commands
	ListEffectiveCmd = &cobra.Command{
		Use:   "effective",
		Short: "List effective information",
		Run:   ShowUsage,
	}
)
View Source
var (
	// ListServersCmd is based for other commands
	ListServersCmd = &cobra.Command{
		Use:   "servers",
		Short: "List servers information",
		Run:   ShowUsage,
	}
)
View Source
var (
	// LockCmd is root for various `lock ...` commands
	LockCmd = &cobra.Command{
		Use:   "lock",
		Short: "Lock resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// LoginCmd is used to login using an API key
	LoginCmd = &cobra.Command{
		Use: "login",
		Run: ShowUsage,
	}
)
View Source
var (
	// PauseCmd is root for various `pause ...` commands
	PauseCmd = &cobra.Command{
		Use:   "pause",
		Short: "Pause resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RebalanceCmd is root for various `rebalance ...` commands
	RebalanceCmd = &cobra.Command{
		Use:   "rebalance",
		Short: "Rebalance resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RebalanceDeploymentCmd is root for various `rebalance deployment ...` commands
	RebalanceDeploymentCmd = &cobra.Command{
		Use:   "deployment",
		Short: "Rebalance deployment resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RejectCmd is root for various `reject ...` commands
	RejectCmd = &cobra.Command{
		Use:   "reject",
		Short: "Reject invites",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RenewCmd is root for various `renew ...` commands
	RenewCmd = &cobra.Command{
		Use:   "renew",
		Short: "Renew keys & tokens",
		Run:   ShowUsage,
	}
)
View Source
var (
	// ResumeCmd is root for various `resume ...` commands
	ResumeCmd = &cobra.Command{
		Use:   "resume",
		Short: "Resume resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RotateCmd is root for various `rotate ...` commands
	RotateCmd = &cobra.Command{
		Use:   "rotate",
		Short: "Rotate resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// RotateDeploymentCmd is root for various `rotate deployment ...` commands
	RotateDeploymentCmd = &cobra.Command{
		Use:   "deployment",
		Short: "Rotate deployment resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// UnlockCmd is root for various `unlock ...` commands
	UnlockCmd = &cobra.Command{
		Use:   "unlock",
		Short: "Unlock resources",
		Run:   ShowUsage,
	}
)
View Source
var (
	// WaitCmd is root for various `wait ...` commands
	WaitCmd = &cobra.Command{
		Use:   "wait",
		Short: "Wait for a status change",
		Run:   ShowUsage,
	}
)

Functions

func ContextWithToken

func ContextWithToken() context.Context

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 DefaultURL

func DefaultURL() string

DefaultURL returns the default value for a URL

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

func MustCheckNumberOfArgs(args []string, expectedNumberOfArgs int)

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

func OptOption(key, value string, args []string, argIndex int) (string, int)

OptOption returns given value if not empty. Returns: option-value, number-of-args-used(0|argIndex+1)

func OptOptionSlice added in v1.1.0

func OptOptionSlice(key string, value []string, args []string, argIndex int) ([]string, int)

OptOptionSlice returns given slice value if not empty. Returns: option-value, number-of-args-used(0|argIndex+1)

func ReqOption

func ReqOption(key, value string, args []string, argIndex int) (string, int)

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 ShowUsage

func ShowUsage(cmd *cobra.Command, args []string)

ShowUsage shows usage of the given command on stdout.

func SplitByComma added in v1.1.0

func SplitByComma(input string) []string

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL