cmd

package
v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//OutputDirPermissions are the output directory's permissions.
	OutputDirPermissions = 0755
)

Variables

View Source
var (
	//MessageNotEnoughArguments is shown when the user didn't provide enough arguments
	MessageNotEnoughArguments = "Not enough arguments, this command requires at least %d argument%s."

	//PlaceholderSynopsis is synopsis text when none is available
	PlaceholderSynopsis = "<synopsis>"

	//PlaceholderHelp is help when none is available
	PlaceholderHelp = "<help>"

	//PlaceholderUsage is shown when no specific implementation is available
	PlaceholderUsage = "<usage>"
)
View Source
var (
	// ErrNamespaceNotSet is returned when no namespace config is found in the kube config file.
	ErrNamespaceNotSet = errors.New("no cluster set, use `nerd login` to update your configuration")
	// ErrNotLoggedIn is returned when no oauth access token was found in the config file.
	ErrNotLoggedIn = errors.New("you're not logged in. Please login with `nerd login`")
)

Functions

func DatasetDeleteFactory

func DatasetDeleteFactory(ui cli.Ui) cli.CommandFactory

DatasetDeleteFactory creates the command

func DatasetDownloadFactory

func DatasetDownloadFactory(ui cli.Ui) cli.CommandFactory

DatasetDownloadFactory creates the command

func DatasetFactory

func DatasetFactory(ui cli.Ui) cli.CommandFactory

DatasetFactory creates the command

func DatasetListFactory

func DatasetListFactory(ui cli.Ui) cli.CommandFactory

DatasetListFactory creates the command

func DatasetUploadFactory

func DatasetUploadFactory(ui cli.Ui) cli.CommandFactory

DatasetUploadFactory creates the command

func JobDeleteFactory

func JobDeleteFactory(ui cli.Ui) cli.CommandFactory

JobDeleteFactory creates the command

func JobFactory

func JobFactory(ui cli.Ui) cli.CommandFactory

JobFactory creates the command

func JobListFactory

func JobListFactory(ui cli.Ui) cli.CommandFactory

JobListFactory creates the command

func JobLogsFactory

func JobLogsFactory(ui cli.Ui) cli.CommandFactory

JobLogsFactory creates the command

func JobRunFactory

func JobRunFactory(ui cli.Ui) cli.CommandFactory

JobRunFactory creates the command

func ParseInputSpecification

func ParseInputSpecification(input string) (parts []string, err error)

ParseInputSpecification will look at an input string and return its parts if valid

Types

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

Dataset command

func (Dataset) AutocompleteArgs

func (cmd Dataset) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (Dataset) AutocompleteFlags

func (cmd Dataset) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*Dataset) Description

func (cmd *Dataset) Description() string

Description returns long-form help text

func (*Dataset) Execute

func (cmd *Dataset) Execute(args []string) (err error)

Execute runs the command

func (Dataset) Help

func (cmd Dataset) Help() string

Help shows extensive help

func (Dataset) Logger

func (cmd Dataset) Logger() *logrus.Logger

Logger returns the logger

func (Dataset) Options

func (cmd Dataset) Options() *flags.Parser

Options returns the available options of a command

func (Dataset) Run

func (cmd Dataset) Run(args []string) int

Run runs the actual command

func (*Dataset) Synopsis

func (cmd *Dataset) Synopsis() string

Synopsis returns a one-line

func (*Dataset) Usage

func (cmd *Dataset) Usage() string

Usage shows usage

type DatasetDelete

type DatasetDelete struct {
	KubeOpts
	// contains filtered or unexported fields
}

DatasetDelete command

func (DatasetDelete) AutocompleteArgs

func (cmd DatasetDelete) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (DatasetDelete) AutocompleteFlags

func (cmd DatasetDelete) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*DatasetDelete) Description

func (cmd *DatasetDelete) Description() string

Description returns long-form help text

func (*DatasetDelete) Execute

func (cmd *DatasetDelete) Execute(args []string) (err error)

Execute runs the command

func (DatasetDelete) Help

func (cmd DatasetDelete) Help() string

Help shows extensive help

func (DatasetDelete) Logger

func (cmd DatasetDelete) Logger() *logrus.Logger

Logger returns the logger

func (DatasetDelete) Options

func (cmd DatasetDelete) Options() *flags.Parser

Options returns the available options of a command

func (DatasetDelete) Run

func (cmd DatasetDelete) Run(args []string) int

Run runs the actual command

func (*DatasetDelete) Synopsis

func (cmd *DatasetDelete) Synopsis() string

Synopsis returns a one-line

func (*DatasetDelete) Usage

func (cmd *DatasetDelete) Usage() string

Usage shows usage

type DatasetDownload

type DatasetDownload struct {
	KubeOpts

	Input  string `` /* 128-byte string literal not displayed */
	Output string `` /* 130-byte string literal not displayed */
	// contains filtered or unexported fields
}

DatasetDownload command

func (DatasetDownload) AutocompleteArgs

func (cmd DatasetDownload) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (DatasetDownload) AutocompleteFlags

func (cmd DatasetDownload) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*DatasetDownload) Description

func (cmd *DatasetDownload) Description() string

Description returns long-form help text

func (*DatasetDownload) Execute

func (cmd *DatasetDownload) Execute(args []string) (err error)

Execute runs the command

func (DatasetDownload) Help

func (cmd DatasetDownload) Help() string

Help shows extensive help

func (DatasetDownload) Logger

func (cmd DatasetDownload) Logger() *logrus.Logger

Logger returns the logger

func (DatasetDownload) Options

func (cmd DatasetDownload) Options() *flags.Parser

Options returns the available options of a command

func (DatasetDownload) Run

func (cmd DatasetDownload) Run(args []string) int

Run runs the actual command

func (*DatasetDownload) Synopsis

func (cmd *DatasetDownload) Synopsis() string

Synopsis returns a one-line

func (*DatasetDownload) Usage

func (cmd *DatasetDownload) Usage() string

Usage shows usage

type DatasetList

type DatasetList struct {
	KubeOpts
	// contains filtered or unexported fields
}

DatasetList command

func (DatasetList) AutocompleteArgs

func (cmd DatasetList) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (DatasetList) AutocompleteFlags

func (cmd DatasetList) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*DatasetList) Description

func (cmd *DatasetList) Description() string

Description returns long-form help text

func (*DatasetList) Execute

func (cmd *DatasetList) Execute(args []string) (err error)

Execute runs the command

func (DatasetList) Help

func (cmd DatasetList) Help() string

Help shows extensive help

func (DatasetList) Logger

func (cmd DatasetList) Logger() *logrus.Logger

Logger returns the logger

func (DatasetList) Options

func (cmd DatasetList) Options() *flags.Parser

Options returns the available options of a command

func (DatasetList) Run

func (cmd DatasetList) Run(args []string) int

Run runs the actual command

func (*DatasetList) Synopsis

func (cmd *DatasetList) Synopsis() string

Synopsis returns a one-line

func (*DatasetList) Usage

func (cmd *DatasetList) Usage() string

Usage shows usage

type DatasetUpload

type DatasetUpload struct {
	KubeOpts
	TransferOpts
	Name string `long:"name" short:"n" description:"assign a name to the dataset"`
	// contains filtered or unexported fields
}

DatasetUpload command

func (DatasetUpload) AutocompleteArgs

func (cmd DatasetUpload) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (DatasetUpload) AutocompleteFlags

func (cmd DatasetUpload) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*DatasetUpload) Description

func (cmd *DatasetUpload) Description() string

Description returns long-form help text

func (*DatasetUpload) Execute

func (cmd *DatasetUpload) Execute(args []string) (err error)

Execute runs the command

func (DatasetUpload) Help

func (cmd DatasetUpload) Help() string

Help shows extensive help

func (DatasetUpload) Logger

func (cmd DatasetUpload) Logger() *logrus.Logger

Logger returns the logger

func (DatasetUpload) Options

func (cmd DatasetUpload) Options() *flags.Parser

Options returns the available options of a command

func (DatasetUpload) Run

func (cmd DatasetUpload) Run(args []string) int

Run runs the actual command

func (*DatasetUpload) Synopsis

func (cmd *DatasetUpload) Synopsis() string

Synopsis returns a one-line

func (*DatasetUpload) Usage

func (cmd *DatasetUpload) Usage() string

Usage shows usage

type Deps

type Deps struct {
	// contains filtered or unexported fields
}

Deps exposes dependencies

func NewDeps

func NewDeps(logs svc.Logger, kopts KubeOpts) (*Deps, error)

NewDeps uses options to setup dependencies

func (*Deps) Crd

func (deps *Deps) Crd() crd.Interface

Crd provides the custom resource definition API

func (*Deps) Kube

func (deps *Deps) Kube() kubernetes.Interface

Kube provides the kubernetes dependency

func (*Deps) Logger

func (deps *Deps) Logger() svc.Logger

Logger provides the Logger dependency

func (*Deps) Namespace

func (deps *Deps) Namespace() string

Namespace provides the namespace dependency

func (*Deps) Validator

func (deps *Deps) Validator() svc.Validator

Validator provides the Validator dependency

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job command

func (Job) AutocompleteArgs

func (cmd Job) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (Job) AutocompleteFlags

func (cmd Job) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*Job) Description

func (cmd *Job) Description() string

Description returns long-form help text

func (*Job) Execute

func (cmd *Job) Execute(args []string) (err error)

Execute runs the command

func (Job) Help

func (cmd Job) Help() string

Help shows extensive help

func (Job) Logger

func (cmd Job) Logger() *logrus.Logger

Logger returns the logger

func (Job) Options

func (cmd Job) Options() *flags.Parser

Options returns the available options of a command

func (Job) Run

func (cmd Job) Run(args []string) int

Run runs the actual command

func (*Job) Synopsis

func (cmd *Job) Synopsis() string

Synopsis returns a one-line

func (*Job) Usage

func (cmd *Job) Usage() string

Usage shows usage

type JobDelete

type JobDelete struct {
	KubeOpts
	// contains filtered or unexported fields
}

JobDelete command

func (JobDelete) AutocompleteArgs

func (cmd JobDelete) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (JobDelete) AutocompleteFlags

func (cmd JobDelete) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*JobDelete) Description

func (cmd *JobDelete) Description() string

Description returns long-form help text

func (*JobDelete) Execute

func (cmd *JobDelete) Execute(args []string) (err error)

Execute runs the command

func (JobDelete) Help

func (cmd JobDelete) Help() string

Help shows extensive help

func (JobDelete) Logger

func (cmd JobDelete) Logger() *logrus.Logger

Logger returns the logger

func (JobDelete) Options

func (cmd JobDelete) Options() *flags.Parser

Options returns the available options of a command

func (JobDelete) Run

func (cmd JobDelete) Run(args []string) int

Run runs the actual command

func (*JobDelete) Synopsis

func (cmd *JobDelete) Synopsis() string

Synopsis returns a one-line

func (*JobDelete) Usage

func (cmd *JobDelete) Usage() string

Usage shows usage

type JobList

type JobList struct {
	KubeOpts
	// contains filtered or unexported fields
}

JobList command

func (JobList) AutocompleteArgs

func (cmd JobList) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (JobList) AutocompleteFlags

func (cmd JobList) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*JobList) Description

func (cmd *JobList) Description() string

Description returns long-form help text

func (*JobList) Execute

func (cmd *JobList) Execute(args []string) (err error)

Execute runs the command

func (JobList) Help

func (cmd JobList) Help() string

Help shows extensive help

func (JobList) Logger

func (cmd JobList) Logger() *logrus.Logger

Logger returns the logger

func (JobList) Options

func (cmd JobList) Options() *flags.Parser

Options returns the available options of a command

func (JobList) Run

func (cmd JobList) Run(args []string) int

Run runs the actual command

func (*JobList) Synopsis

func (cmd *JobList) Synopsis() string

Synopsis returns a one-line

func (*JobList) Usage

func (cmd *JobList) Usage() string

Usage shows usage

type JobLogs

type JobLogs struct {
	KubeOpts
	Tail int64 `long:"tail" short:"t" description:"only return the oldest N lines of the process logs"`
	// contains filtered or unexported fields
}

JobLogs command

func (JobLogs) AutocompleteArgs

func (cmd JobLogs) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (JobLogs) AutocompleteFlags

func (cmd JobLogs) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*JobLogs) Description

func (cmd *JobLogs) Description() string

Description returns long-form help text

func (*JobLogs) Execute

func (cmd *JobLogs) Execute(args []string) (err error)

Execute runs the command

func (JobLogs) Help

func (cmd JobLogs) Help() string

Help shows extensive help

func (JobLogs) Logger

func (cmd JobLogs) Logger() *logrus.Logger

Logger returns the logger

func (JobLogs) Options

func (cmd JobLogs) Options() *flags.Parser

Options returns the available options of a command

func (JobLogs) Run

func (cmd JobLogs) Run(args []string) int

Run runs the actual command

func (*JobLogs) Synopsis

func (cmd *JobLogs) Synopsis() string

Synopsis returns a one-line

func (*JobLogs) Usage

func (cmd *JobLogs) Usage() string

Usage shows usage

type JobRun

type JobRun struct {
	KubeOpts
	TransferOpts
	Name    string   `long:"name" short:"n" description:"assign a name to the job"`
	Env     []string `long:"env" short:"e" description:"environment variables to use"`
	Memory  string   `long:"memory" short:"m" description:"memory to use for this job, expressed in gigabytes" default:"3"`
	VCPU    string   `long:"vcpu" description:"number of vcpus to use for this job" default:"2"`
	Inputs  []string `` /* 140-byte string literal not displayed */
	Outputs []string `` /* 164-byte string literal not displayed */
	// contains filtered or unexported fields
}

JobRun command

func (JobRun) AutocompleteArgs

func (cmd JobRun) AutocompleteArgs() complete.Predictor

AutocompleteArgs returns the argument predictor for this command.

func (JobRun) AutocompleteFlags

func (cmd JobRun) AutocompleteFlags() (fl complete.Flags)

AutocompleteFlags returns a mapping of supported flags

func (*JobRun) Description

func (cmd *JobRun) Description() string

Description returns long-form help text

func (*JobRun) Execute

func (cmd *JobRun) Execute(args []string) (err error)

Execute runs the command

func (JobRun) Help

func (cmd JobRun) Help() string

Help shows extensive help

func (JobRun) Logger

func (cmd JobRun) Logger() *logrus.Logger

Logger returns the logger

func (JobRun) Options

func (cmd JobRun) Options() *flags.Parser

Options returns the available options of a command

func (JobRun) Run

func (cmd JobRun) Run(args []string) int

Run runs the actual command

func (*JobRun) Synopsis

func (cmd *JobRun) Synopsis() string

Synopsis returns a one-line

func (*JobRun) Usage

func (cmd *JobRun) Usage() string

Usage shows usage

type KubeOpts

type KubeOpts struct {
	KubeConfig string        `` /* 133-byte string literal not displayed */
	Timeout    time.Duration `` /* 126-byte string literal not displayed */
}

KubeOpts can be used to create a Kubernetes service

type Output

type Output struct {
	cli.Ui
	// contains filtered or unexported fields
}

Output standardizes the way in which we would like to capture output throughout the program

func NewOutput

func NewOutput(ui cli.Ui) *Output

NewOutput sets up our standardized program outputter

func (*Output) Errorf

func (o *Output) Errorf(format string, a ...interface{})

Errorf prints a formatted error to ErrorOutput

func (*Output) Infof

func (o *Output) Infof(format string, a ...interface{})

Infof prints a formatted message to

func (*Output) Logger

func (o *Output) Logger(level logrus.Level) *logrus.Logger

Logger returns a logrus logger that writes to the UIs Stderr

func (*Output) Table

func (o *Output) Table(header []string, rows [][]string) error

Table will print a table

type TransferOpts

type TransferOpts struct {
	AWSS3Bucket        string `long:"aws-s3-bucket" description:"AWS S3 Bucket name that will be used for dataset storage" default:"nlz-datasets-dev"`
	AWSRegion          string `long:"aws-region" description:"AWS region used for dataset storage"`
	AWSAccessKeyID     string `long:"aws-access-key-id" description:"AWS access key used for auth with the storage backend"`
	AWSSecretAccessKey string `long:"aws-secret-access-key" description:"AWS secret key for auth with the storage backend"`
	AWSSessionToken    string `long:"aws-session-token" description:"AWS temporary auth token for the storage backend"`
}

TransferOpts hold CLI options for configuring data transfer

func (TransferOpts) TransferManager

func (opts TransferOpts) TransferManager(kube *svc.Kube) (mgr transfer.Manager, sto *transferstore.StoreOptions, sta *transferarchiver.ArchiverOptions, err error)

TransferManager creates a transfermanager using the command line options

Directories

Path Synopsis
main holds the flex volume executable, compiled separately
main holds the flex volume executable, compiled separately

Jump to

Keyboard shortcuts

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