status

package
v0.0.0-...-966d904 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = models.Command{
	Name:      "status",
	ShortHelp: "Get quick readout of the current status of an environment and all of its services",
	LongHelp: "<code>status</code> will give a quick readout of your environment's health. " +
		"This includes your environment name, environment ID, and for each service the name, size, build status, deploy status, and service ID. " +
		"Here is a sample command\n\n" +
		"<pre>\ndatica -E \"<your_env_name>\" status\ndatica -E \"<your_env_name>\" status --historical\n</pre>",
	CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) {
		return func(cmd *cli.Cmd) {
			historical := cmd.BoolOpt("historical", false, "If this option is specified, a complete history of jobs will be reported")
			cmd.Action = func() {
				if _, err := auth.New(settings, prompts.New()).Signin(); err != nil {
					logrus.Fatal(err.Error())
				}
				if err := config.CheckRequiredAssociation(settings); err != nil {
					logrus.Fatal(err.Error())
				}
				err := CmdStatus(settings.EnvironmentID, New(settings, jobs.New(settings)), environments.New(settings), services.New(settings), *historical)
				if err != nil {
					logrus.Fatal(err.Error())
				}
			}
			cmd.Spec = "[--historical]"
		}
	},
}

Cmd is the contract between the user and the CLI. This specifies the command name, arguments, and required/optional arguments and flags for the command.

Functions

func CmdStatus

func CmdStatus(envID string, is IStatus, ie environments.IEnvironments, iservices services.IServices, historical bool) error

Types

type IStatus

type IStatus interface {
	Status(env *models.Environment, services *[]models.Service, historical bool) error
}

IStatus

func New

func New(settings *models.Settings, ij jobs.IJobs) IStatus

New returns an instance of IStatus

type SStatus

type SStatus struct {
	Settings *models.Settings
	Jobs     jobs.IJobs
}

SStatus is a concrete implementation of IStatus

func (*SStatus) Status

func (s *SStatus) Status(env *models.Environment, services *[]models.Service, historical bool) error

Status prints out all of the non-utility services and their running jobs

Jump to

Keyboard shortcuts

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