commands

package
v0.0.0-...-b4dec9c Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package commands contains implementation of all commands that can be entered by user on command line. This is the basic (and only) interface to Insights Operator CLI tool that is officially available.

Types, functions, and methods from this package are implemented in following source files:

* authors.go

* clusters.go

* commands.go

* common.go

* configurations.go

* copyright.go

* errors.go

* help.go

* license.go

* messages.go

* profiles.go

* triggers.go

Index

Constants

View Source
const (
	CannotReadConfigurationFileErrorMessage    = "Cannot read configuration file"
	CannotReadAnyConfigurationFileErrorMessage = "Cannot read any configuration file"
	ErrorCommunicationWithServiceErrorMessage  = "Error communicating with the service"
	ErrorReadingListOfClusters                 = "Error reading list of clusters"
	ErrorReadingListOfConfigurations           = "Error reading list of configurations"
	ErrorReadingClusterConfiguration           = "Error reading cluster configuration"
	ErrorReadingListOfConfigurationProfiles    = "Error reading list of configuration profiles"
	ErrorReadingConfigurationProfile           = "Error reading configuration profile"
	ErrorReadingListOfTriggers                 = "Error reading list of triggers"
	ErrorReadingSelectedTrigger                = "Error reading selected trigger"
)

constants used to display various error messages

Variables

This section is empty.

Functions

func ActivateTrigger

func ActivateTrigger(api restapi.API, triggerID string)

ActivateTrigger function activates specified trigger.

func AddCluster

func AddCluster(api restapi.API, clusterName string)

AddCluster function inserts new cluster info into the database via REST API call to insights operator controller service.

func AddClusterConfiguration

func AddClusterConfiguration(api restapi.API, username string)

AddClusterConfiguration function asks for all information needed to create new cluster configuration, all done via REST API call.

func AddClusterConfigurationImpl

func AddClusterConfigurationImpl(api restapi.API, username, cluster, reason, description, configurationFileName string)

AddClusterConfigurationImpl function creates a new cluster configuration.

func AddConfigurationProfile

func AddConfigurationProfile(api restapi.API, username string)

AddConfigurationProfile function adds the profile to database

func AddConfigurationProfileImpl

func AddConfigurationProfileImpl(api restapi.API, username, description, configurationFileName string)

AddConfigurationProfileImpl function adds the profile to database

func AddTrigger

func AddTrigger(api restapi.API, username string)

AddTrigger function adds new trigger for a cluster.

func AddTriggerImpl

func AddTriggerImpl(api restapi.API, username, clusterName, reason, link string)

AddTriggerImpl function calls REST API to add a new trigger into the database.

func ConfigFileCompleter

func ConfigFileCompleter(in prompt.Document) []prompt.Suggest

ConfigFileCompleter function implements completer based on list of files.

func DeactivateTrigger

func DeactivateTrigger(api restapi.API, triggerID string)

DeactivateTrigger deactivates specified trigger

func DeleteCluster

func DeleteCluster(api restapi.API, clusterID string, askForConfirmation bool)

DeleteCluster function deletes all info about selected cluster from database. Before this operation is performed, user is ask if it is really required (this additional operation can be disabled by command line option).

func DeleteClusterConfiguration

func DeleteClusterConfiguration(api restapi.API, configurationID string)

DeleteClusterConfiguration function deletes selected cluster configuration from database via REST API call.

func DeleteClusterNoConfirm

func DeleteClusterNoConfirm(api restapi.API, clusterID string)

DeleteClusterNoConfirm function deletes all info about selected cluster w/o asking for confirmation of this operation. Usually it function should not be called directly from user interface as some confirmation is required.

func DeleteConfigurationProfile

func DeleteConfigurationProfile(api restapi.API, profileID string, askForConfirmation bool)

DeleteConfigurationProfile function deletes the profile selected by its ID

func DeleteConfigurationProfileNoConfirm

func DeleteConfigurationProfileNoConfirm(api restapi.API, profileID string)

DeleteConfigurationProfileNoConfirm function deletes the configuration profile selected by its ID w/o asking for confirmation

func DeleteTrigger

func DeleteTrigger(api restapi.API, triggerID string)

DeleteTrigger function deletes specified trigger.

func DescribeConfiguration

func DescribeConfiguration(api restapi.API, clusterID string)

DescribeConfiguration function displays additional information about selected configuration read via REST API call.

func DescribeProfile

func DescribeProfile(api restapi.API, profileID string)

DescribeProfile function displays additional information about selected profile

func DescribeTrigger

func DescribeTrigger(api restapi.API, triggerID string)

DescribeTrigger function displays additional information about selected trigger.

func DisableClusterConfiguration

func DisableClusterConfiguration(api restapi.API, configurationID string)

DisableClusterConfiguration function disables the selected cluster configuration in the controller service via REST API call.

func EnableClusterConfiguration

func EnableClusterConfiguration(api restapi.API, configurationID string)

EnableClusterConfiguration function enables the selected cluster configuration in the controller service via REST API call.

func FillInConfigurationList

func FillInConfigurationList(directory string) error

FillInConfigurationList function prepares a list of configuration files that are found in specified directory.

func ListOfClusters

func ListOfClusters(api restapi.API)

ListOfClusters function displays list of clusters gathered via REST API call to the controller service. Just basic information about clusters are displayed - mainly its internal ID, an official ID, and a name.

func ListOfConfigurations

func ListOfConfigurations(api restapi.API, filter string)

ListOfConfigurations function displays list of all configurations gathered via REST API call to the Controller Service.

func ListOfProfiles

func ListOfProfiles(api restapi.API)

ListOfProfiles function displays list of configuration profiles gathered via REST API call made to controller service.

func ListOfTriggers

func ListOfTriggers(api restapi.API)

ListOfTriggers function displays list of triggers (including must-gather one) gathered via REST API call to controller service.

func LoginCompleter

func LoginCompleter(in prompt.Document) []prompt.Suggest

LoginCompleter implements a no-op completer needed to input random data, for example during testing.

func PrintAuthors

func PrintAuthors()

PrintAuthors function displays list of authors to standard output. It is possible to enable or disable colorized output of header via command line options.

func PrintCopyright

func PrintCopyright()

PrintCopyright function displays copyright notice on terminal with optional colorization.

func PrintHelp

func PrintHelp()

PrintHelp function can be used to display help on (color) terminal. Colorization is optional and depends on configuration.

func PrintLicense

func PrintLicense()

PrintLicense function displays license used by this project

func ProceedQuestion

func ProceedQuestion(question string) bool

ProceedQuestion ask user about y/n answer.

func Quit

func Quit()

Quit function will exit from the CLI client.

func SetColorizer

func SetColorizer(c aurora.Aurora)

SetColorizer function set the terminal colorizer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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