command

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateApplicationCommand

func NewCreateApplicationCommand(cfg Config, p Printer) *cobra.Command

NewCreateApplicationCommand returns a command for creating applications.

func NewCreateScenarioCommand

func NewCreateScenarioCommand(cfg Config, p Printer) *cobra.Command

NewCreateScenarioCommand returns a command for creating scenarios.

func NewCreateTrialCommand

func NewCreateTrialCommand(cfg Config, p Printer) *cobra.Command

NewCreateTrialCommand returns a command for creating a trial.

func NewDeleteApplicationsCommand

func NewDeleteApplicationsCommand(cfg Config, p Printer) *cobra.Command

NewDeleteApplicationsCommand returns a command for deleting applications.

func NewDeleteClustersCommand

func NewDeleteClustersCommand(cfg Config, p Printer) *cobra.Command

NewDeleteClustersCommand returns a command for deleting clusters.

func NewDeleteExperimentsCommand

func NewDeleteExperimentsCommand(cfg Config, p Printer) *cobra.Command

NewDeleteExperimentsCommand returns a command for deleting experiments.

func NewDeleteScenariosCommand

func NewDeleteScenariosCommand(cfg Config, p Printer) *cobra.Command

NewDeleteScenariosCommand returns a command for deleting scenarios.

func NewDeleteTrialsCommand

func NewDeleteTrialsCommand(cfg Config, p Printer) *cobra.Command

NewDeleteTrialsCommand returns a command for deleting ("abandoning") trials.

func NewDisableApplicationRecommendationsCommand added in v0.1.2

func NewDisableApplicationRecommendationsCommand(cfg Config, p Printer) *cobra.Command

NewDisableApplicationRecommendationsCommand returns a new command for disabling recommendations.

func NewEditApplicationCommand

func NewEditApplicationCommand(cfg Config, p Printer) *cobra.Command

NewEditApplicationCommand returns a command for editing an application.

func NewEditClusterCommand

func NewEditClusterCommand(cfg Config, p Printer) *cobra.Command

NewEditClusterCommand returns a command for editing a cluster.

func NewEditExperimentCommand

func NewEditExperimentCommand(cfg Config, p Printer) *cobra.Command

NewEditExperimentCommand returns a command for editing an experiment.

func NewEditScenarioCommand

func NewEditScenarioCommand(cfg Config, p Printer) *cobra.Command

NewEditScenarioCommand returns a command for editing a scenario.

func NewEditTrialCommand

func NewEditTrialCommand(cfg Config, p Printer) *cobra.Command

NewEditTrialCommand returns a command for editing a trial.

func NewEnableApplicationRecommendationsCommand added in v0.1.2

func NewEnableApplicationRecommendationsCommand(cfg Config, p Printer) *cobra.Command

NewEnableApplicationRecommendationsCommand returns a new command for enabling recommendations.

func NewGetActivityCommand added in v0.0.27

func NewGetActivityCommand(cfg Config, p Printer) *cobra.Command

NewGetActivityCommand returns a command for getting activity feed items.

func NewGetApplicationsCommand

func NewGetApplicationsCommand(cfg Config, p Printer) *cobra.Command

NewGetApplicationsCommand returns a command for getting applications.

func NewGetClustersCommand

func NewGetClustersCommand(cfg Config, p Printer) *cobra.Command

NewGetClustersCommand returns a command for getting clusters.

func NewGetExperimentsCommand

func NewGetExperimentsCommand(cfg Config, p Printer) *cobra.Command

NewGetExperimentsCommand returns a command for getting experiments.

func NewGetRecommendationsCommand

func NewGetRecommendationsCommand(cfg Config, p Printer) *cobra.Command

NewGetRecommendationsCommand returns a command for getting recommendations.

func NewGetScenariosCommand

func NewGetScenariosCommand(cfg Config, p Printer) *cobra.Command

NewGetScenariosCommand returns a command for getting scenarios.

func NewGetTrialsCommand

func NewGetTrialsCommand(cfg Config, p Printer) *cobra.Command

NewGetTrialsCommand returns a command for getting trials.

func NewWatchActivityCommand

func NewWatchActivityCommand(cfg Config) *cobra.Command

NewWatchActivityCommand returns a command for watching the activity feed.

func NewWhoAmICommand added in v0.1.0

func NewWhoAmICommand(cfg Config) *cobra.Command

NewWhoAmICommand returns a command for determining the current identity associated with the configuration.

func SortBy added in v0.1.5

func SortBy(o Output, name string) error

SortBy sorts the supplied output using the named value on each row.

func SortByKey added in v0.1.5

func SortByKey(key string) string

SortByKey normalizes the user supplied sort-by key.

Types

type ActivityOutput added in v0.0.27

type ActivityOutput struct {
	Items []ActivityRow `json:"-"`

	applications.ActivityFeed
}

func (*ActivityOutput) Add added in v0.0.27

type ActivityRow added in v0.0.27

type ActivityRow struct {
	ID               string `table:"id" csv:"id" json:"-"`
	Title            string `table:"title" csv:"title" json:"-"`
	Tags             string `table:"tags" csv:"tags" json:"-"`
	ExternalURL      string `table:"reference" csv:"external_url" json:"-"`
	URL              string `table:"url,wide" csv:"url" json:"-"`
	FailureReason    string `table:"reason,wide" csv:"failure_reason" json:"-"`
	PublishedHuman   string `table:"published" csv:"-" json:"-"`
	PublishedMachine string `table:"-" csv:"published" json:"-"`

	applications.ActivityItem `table:"-" csv:"-"`
}

func NewActivityRow added in v0.1.4

func NewActivityRow(item *applications.ActivityItem) *ActivityRow

type ApplicationOutput

type ApplicationOutput struct {
	Items []ApplicationRow `json:"items"`
}

ApplicationOutput wraps an application list for output.

func (*ApplicationOutput) Add

Add an application item to the output.

func (*ApplicationOutput) Item added in v0.1.5

func (o *ApplicationOutput) Item(i int) Row

Item returns the specified row value.

func (*ApplicationOutput) Len added in v0.1.5

func (o *ApplicationOutput) Len() int

Len returns the number of items being output.

func (*ApplicationOutput) SortBy added in v0.1.5

func (o *ApplicationOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*ApplicationOutput) Swap added in v0.1.5

func (o *ApplicationOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type ApplicationRow

type ApplicationRow struct {
	Name                string `table:"name" csv:"name" json:"-"`
	Title               string `table:"title" csv:"title" json:"title,omitempty"`
	ScenarioCount       int    `table:"scenarios" csv:"scenario_count" json:"-"`
	RecommendationMode  string `table:"recommendations" csv:"recommendations" json:"-"`
	DeployInterval      string `table:"deploy_interval,wide" csv:"deploy_interval" json:"-"`
	LastDeployedMachine string `table:"-" csv:"last_deployed" json:"-"`
	LastDeployedHuman   string `table:"last_deployed,wide" csv:"-" json:"-"`
	Age                 string `table:"age,wide" csv:"-" json:"-"`

	applications.ApplicationItem `table:"-" csv:"-"`

	RecommendationsDeployConfig     *applications.DeployConfiguration `table:"-" csv:"-" json:"recommendationsDeployConfig,omitempty"`
	RecommendationsConfiguration    []applications.Configuration      `table:"-" csv:"-" json:"recommendationsConfiguration,omitempty"`
	RecommendationsBackfillProgress *applications.BackfillProgress    `table:"-" csv:"-" json:"recommendationsBackfillProgress,omitempty"`
}

ApplicationRow is a table row representation of an application.

func NewApplicationRow added in v0.1.4

func NewApplicationRow(item *applications.ApplicationItem) *ApplicationRow

func (*ApplicationRow) Lookup added in v0.1.5

func (r *ApplicationRow) Lookup(key string) (interface{}, bool)

func (*ApplicationRow) SetBackfillProgress added in v0.1.5

func (r *ApplicationRow) SetBackfillProgress(progress *applications.BackfillProgress)

func (*ApplicationRow) SetRecommendationsConfiguration added in v0.1.2

func (r *ApplicationRow) SetRecommendationsConfiguration(config []applications.Configuration)

func (*ApplicationRow) SetRecommendationsDeployConfig added in v0.1.2

func (r *ApplicationRow) SetRecommendationsDeployConfig(deploy *applications.DeployConfiguration)

type ClusterOutput

type ClusterOutput struct {
	Items []ClusterRow `json:"items"`
}

ClusterOutput wraps a cluster list for output.

func (*ClusterOutput) Add

Add a cluster item to the output.

func (*ClusterOutput) Item added in v0.1.5

func (o *ClusterOutput) Item(i int) Row

Item returns the specified row value.

func (*ClusterOutput) Len added in v0.1.5

func (o *ClusterOutput) Len() int

Len returns the number of items being output.

func (*ClusterOutput) SortBy added in v0.1.5

func (o *ClusterOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*ClusterOutput) Swap added in v0.1.5

func (o *ClusterOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type ClusterRow

type ClusterRow struct {
	Name                   string `table:"name" csv:"name" json:"-"`
	DisplayName            string `table:"title" csv:"title" json:"title,omitempty"`
	OptimizeProVersion     string `table:"optimize_pro" csv:"optimize_pro_version" json:"-"`
	OptimizeLiveVersion    string `table:"optimize_live" csv:"optimize_live_version" json:"-"`
	PerformanceTestVersion string `table:"performance_test,wide" csv:"performance_test_version" json:"-"`
	KubernetesVersion      string `table:"kubernetes,wide" csv:"kubernetes_version" json:"-"`
	LastSeenMachine        string `table:"-" csv:"last_seen" json:"-"`
	LastSeenHuman          string `table:"last_seen" csv:"-" json:"-"`
	Age                    string `table:"age,wide" csv:"-" json:"-"`

	applications.ClusterItem `table:"-" csv:"-"`
}

ClusterRow is a table row representation of a cluster.

func NewClusterRow added in v0.1.4

func NewClusterRow(item *applications.ClusterItem) *ClusterRow

func (*ClusterRow) Lookup added in v0.1.5

func (r *ClusterRow) Lookup(key string) (interface{}, bool)

type Config

type Config interface {
	// Address returns the base address for the API endpoints.
	Address() string
}

Config represents the configuration necessary to run a command.

type ExperimentOutput

type ExperimentOutput struct {
	Items []ExperimentRow `json:"items"`
}

ExperimentOutput wraps an experiment list for output.

func (*ExperimentOutput) Add

Add an experiment item to the output.

func (*ExperimentOutput) Item added in v0.1.5

func (o *ExperimentOutput) Item(i int) Row

Item returns the specified row value.

func (*ExperimentOutput) Len added in v0.1.5

func (o *ExperimentOutput) Len() int

Len returns the number of items being output.

func (*ExperimentOutput) SortBy added in v0.1.5

func (o *ExperimentOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*ExperimentOutput) Swap added in v0.1.5

func (o *ExperimentOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type ExperimentRow

type ExperimentRow struct {
	Name         string            `table:"name" csv:"name" json:"-"`
	DisplayName  string            `table:"Name,custom" json:"-"`
	Observations int64             `table:"observations,wide" csv:"observations" json:"-"`
	Labels       map[string]string `table:"labels,labels" csv:"label_,labels,flatten" json:"-"`

	experiments.ExperimentItem `table:"-" csv:"-"`
}

ExperimentRow is a table row representation of an experiment.

func NewExperimentRow added in v0.1.4

func NewExperimentRow(item *experiments.ExperimentItem) *ExperimentRow

func (*ExperimentRow) Lookup added in v0.1.5

func (r *ExperimentRow) Lookup(key string) (interface{}, bool)

type Output added in v0.1.5

type Output interface {
	// Len returns the number of items in the output.
	Len() int
	// Swap exchanges the items at the specified indices.
	Swap(int, int)
	// Item returns the complete row.
	Item(int) Row
}

Output represents an output list.

type Printer

type Printer interface {
	// Fprint renders an object (which may represent a list) to the supplied writer.
	Fprint(out io.Writer, obj interface{}) error
}

Printer is the interface required to render results.

type RecommendationOutput

type RecommendationOutput struct {
	Items []RecommendationRow `json:"items"`
}

RecommendationOutput wraps a recommendation list for output.

func (*RecommendationOutput) Add

Add a recommendation item to the output.

func (*RecommendationOutput) Item added in v0.1.5

func (o *RecommendationOutput) Item(i int) Row

Item returns the specified row value.

func (*RecommendationOutput) Len added in v0.1.5

func (o *RecommendationOutput) Len() int

Len returns the number of items being output.

func (*RecommendationOutput) SortBy added in v0.1.5

func (o *RecommendationOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*RecommendationOutput) Swap added in v0.1.5

func (o *RecommendationOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type RecommendationRow

type RecommendationRow struct {
	Name              string `table:"name" csv:"name" json:"-"`
	DeployedAtMachine string `table:"-" csv:"last_deployed" json:"-"`
	DeployedAtHuman   string `table:"last_deployed" csv:"-" json:"-"`

	applications.RecommendationItem `table:"-" csv:"-"`
}

RecommendationRow is a table row representation of a recommendation.

func NewRecommendationRow added in v0.1.4

func NewRecommendationRow(item *applications.RecommendationItem) *RecommendationRow

func (*RecommendationRow) Lookup added in v0.1.5

func (r *RecommendationRow) Lookup(key string) (interface{}, bool)

type Row added in v0.1.5

type Row interface {
	// Lookup returns a named value on the row.
	Lookup(string) (interface{}, bool)
}

Row represents a single row in the output.

type ScenarioOutput

type ScenarioOutput struct {
	Items []ScenarioRow `json:"items"`
}

ScenarioOutput wraps a scenario list for output.

func (*ScenarioOutput) Add

Add a scenario item to the output.

func (*ScenarioOutput) Item added in v0.1.5

func (o *ScenarioOutput) Item(i int) Row

Item returns the specified row value.

func (*ScenarioOutput) Len added in v0.1.5

func (o *ScenarioOutput) Len() int

Len returns the number of items being output.

func (*ScenarioOutput) SortBy added in v0.1.5

func (o *ScenarioOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*ScenarioOutput) Swap added in v0.1.5

func (o *ScenarioOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type ScenarioRow

type ScenarioRow struct {
	Name string `table:"name" csv:"name" json:"-"`

	applications.ScenarioItem `table:"-" csv:"-"`
}

ScenarioRow is a table row representation of a scenario.

func NewScenarioRow added in v0.1.4

func NewScenarioRow(item *applications.ScenarioItem) *ScenarioRow

func (*ScenarioRow) Lookup added in v0.1.5

func (r *ScenarioRow) Lookup(key string) (interface{}, bool)

type TrialOutput

type TrialOutput struct {
	Items []TrialRow `json:"items"`
}

TrialOutput wraps a trial list for output.

func (*TrialOutput) Add

func (o *TrialOutput) Add(item *experiments.TrialItem) error

Add a trial item to the output.

func (*TrialOutput) Item added in v0.1.5

func (o *TrialOutput) Item(i int) Row

Item returns the specified row value.

func (*TrialOutput) Len added in v0.1.5

func (o *TrialOutput) Len() int

Len returns the number of items being output.

func (*TrialOutput) SortBy added in v0.1.5

func (o *TrialOutput) SortBy(key string) error

SortBy sorts the output by the named value.

func (*TrialOutput) Swap added in v0.1.5

func (o *TrialOutput) Swap(i, j int)

Swap exchanges the order of the two specified items.

type TrialRow

type TrialRow struct {
	Experiment     string            `table:"experiment,custom" csv:"experiment" json:"-"`
	Name           string            `table:"name" json:"-"`
	Number         int64             `table:"number,custom" csv:"number" json:"-"`
	Status         string            `table:"status" csv:"status" json:"-"`
	Assignments    map[string]string `csv:"parameter_,flatten" json:"-"`
	Values         map[string]string `csv:"metric_,flatten" json:"-"`
	FailureReason  string            `table:"failure_reason,wide" csv:"failure_reason" json:"-"`
	FailureMessage string            `table:"failure_message,wide" csv:"failure_message" json:"-"`
	Labels         map[string]string `table:"labels,labels" csv:"label_,labels,flatten" json:"-"`

	experiments.TrialItem `table:"-" csv:"-"`
}

TrialRow is a table row representation of a trial.

func NewTrialRow added in v0.1.4

func NewTrialRow(item *experiments.TrialItem) *TrialRow

func (*TrialRow) Lookup added in v0.1.5

func (r *TrialRow) Lookup(key string) (interface{}, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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