cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGetTask

func RunGetTask(t GetTask, outputFmt string)

RunGetTask is the function that operates on a GetTask and shows the output in the respective format that is specified at the command line.

func RunListTask

func RunListTask(t ListTask, outputFmt string)

RunListTask is the function that operates on a ListTask and shows the output in the respective format that is specified at the command line.

func RunSetTask

func RunSetTask(t SetTask, q *Quotas)

RunSetTask is the function that operates on a SetTask and shows the output in the respective format that is specified at the command line.

func RunSyncTask

func RunSyncTask(p *Project)

RunSyncTask schedules a sync job that pulls quota and usage data for a project from the backing services into Limes' local database.

Types

type Cluster

type Cluster struct {
	ID     string
	Opts   Options
	Result clusters.CommonResult
	IsList bool
}

Cluster contains information regarding a cluster(s). As different methods are called on it, the fields within the structure are updated accordingly. Call its appropriate method to get/list/update a Cluster.

type Domain

type Domain struct {
	ID     string
	Name   string
	Opts   Options
	Result domains.CommonResult
	IsList bool
}

Domain contains information regarding a domain(s). As different methods are called on it, the fields within the structure are updated accordingly. Call its appropriate method to get/list/update a Domain.

func FindDomain

func FindDomain(userInput string) (*Domain, error)

FindDomain uses the user's input (name/UUID) to find a specific domain within the token scope.

type GetTask

type GetTask interface {
	// contains filtered or unexported methods
}

GetTask is the interface type that abstracts a get operation.

type ListTask

type ListTask interface {
	// contains filtered or unexported methods
}

ListTask is the interface type that abstracts a list operation.

type Options

type Options struct {
	Names    bool
	Long     bool
	Cluster  string
	Area     string
	Service  string
	Resource string
}

Options contains different options that affect the output of a get/list/update operation.

type Project

type Project struct {
	ID         string
	Name       string
	DomainID   string
	DomainName string
	Opts       Options
	Result     projects.CommonResult
	IsList     bool
}

Project contains information regarding a project(s). As different methods are called on it, the fields within the structure are updated accordingly. Call its appropriate method to get/list/update a Project.

func FindProject

func FindProject(userInputProject, userInputDomain string) (*Project, error)

FindProject uses the user's input (name/UUID) to find a specific project within the token scope.

type Quotas

type Quotas map[string][]Resource

Quotas is a map of service name to a list of resources. It contains the aggregate quota values used by the set methods to update a single cluster/domain/project.

func ParseQuotas

func ParseQuotas(s kingpin.Settings) (target *Quotas)

ParseQuotas parses a command line argument to a quota value and assigns it to the aggregate cli.Quotas map.

func (*Quotas) IsCumulative

func (q *Quotas) IsCumulative() bool

IsCumulative allows consumption of remaining command line arguments.

func (*Quotas) Set

func (q *Quotas) Set(value string) error

Set implements the kingpin.Value interface.

func (*Quotas) String

func (q *Quotas) String() string

String implements the kingpin.Value interface.

type Resource

type Resource struct {
	Name    string
	Value   int64
	Unit    limes.Unit
	Comment string
}

Resource contains quota information about a single resource.

type SetTask

type SetTask interface {
	// contains filtered or unexported methods
}

SetTask is the interface type that abstracts a put operation.

Jump to

Keyboard shortcuts

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