shell

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 27

Documentation

Index

Constants

View Source
const (
	CustomActionGet = TCustomAction("Get")
	CustomActionDo  = TCustomAction("Do")
)
View Source
const (
	OUTPUT_FORMAT_TABLE         = "table"         // pretty table
	OUTPUT_FORMAT_FLATTEN_TABLE = "flatten-table" // pretty table with flattened keys
	OUTPUT_FORMAT_JSON          = "json"          // json string
	OUTPUT_FORMAT_YAML          = "yaml"          // yaml string
	OUTPUT_FORMAT_KV            = "kv"            // "key: value" as separate line
	OUTPUT_FORMAT_FLATTEN_KV    = "flatten-kv"    // kv with flattened keys
)

Variables

View Source
var CommandTable []CMD = make([]CMD, 0)
View Source
var ErrEmtptyUpdate = errors.New("No valid update data")

Functions

func ExportList

func ExportList(list *printutils.ListResult, file string, exportKeys string, exportTexts string, columns []string)

func InvalidUpdateError

func InvalidUpdateError() error

func OutputFormat

func OutputFormat(s string)

func PrintList

func PrintList(list *printutils.ListResult, columns []string)

func PrintObject

func PrintObject(obj jsonutils.JSONObject)

func R

func R(options interface{}, command string, desc string, callback interface{})

Types

type CMD

type CMD struct {
	Options  interface{}
	Command  string
	Desc     string
	Callback interface{}
}

type IBatchCreateOpt

type IBatchCreateOpt interface {
	IOpt
	GetCountParam() int
}

type IBatchDeleteOpt

type IBatchDeleteOpt interface {
	IIdsOpt
	IOpt
}

type IBatchDeleteWithParamOpt

type IBatchDeleteWithParamOpt interface {
	IBatchDeleteOpt
	QueryParams() (jsonutils.JSONObject, error)
}

type IBatchPerformOpt

type IBatchPerformOpt interface {
	IIdsOpt
	IOpt
}

type IBatchPutOpt

type IBatchPutOpt interface {
	IIdsOpt
	IOpt
}

type ICreateOpt

type ICreateOpt interface {
	IOpt
}

type IDeleteOpt

type IDeleteOpt interface {
	IOpt
	IIdOpt
}

type IDeleteWithParamOpt

type IDeleteWithParamOpt interface {
	IDeleteOpt
	QueryParams() (jsonutils.JSONObject, error)
}

type IGetActionOpt

type IGetActionOpt interface {
	IOpt
	IIdOpt
}

type IGetOpt

type IGetOpt interface {
	IIdOpt
	IOpt
}

type IIdOpt

type IIdOpt interface {
	GetId() string
}

type IIdsOpt

type IIdsOpt interface {
	GetIds() []string
}

type IJointListOpt

type IJointListOpt interface {
	IListOpt
	GetMasterOpt() string
	GetSlaveOpt() string
}

type IJointOpt

type IJointOpt interface {
	IOpt
	GetMasterId() string
	GetSlaveId() string
}

type IListOpt

type IListOpt interface {
	IOpt
	GetContextId() string
	GetExportFile() string
	GetExportKeys() string
	GetExportTexts() string
}

type IMetadataOpt

type IMetadataOpt interface {
	IIdOpt
	IOpt
}

type IOpt

type IOpt interface {
	Params() (jsonutils.JSONObject, error)
}

type IPerformOpt

type IPerformOpt interface {
	IOpt
	IIdOpt
}

type IPropertyOpt

type IPropertyOpt interface {
	IOpt
	Property() string
}

type IShowOpt

type IShowOpt interface {
	IOpt
	IIdOpt
}

type IUpdateOpt

type IUpdateOpt interface {
	IOpt
	IIdOpt
}

type IWithDescOpt

type IWithDescOpt interface {
	Description() string
}

type JointCmd

type JointCmd struct {
	*ResourceCmd
}

func NewJointCmd

func NewJointCmd(manager modulebase.JointManager) *JointCmd

func (JointCmd) Attach

func (cmd JointCmd) Attach(args IJointOpt)

func (JointCmd) Detach

func (cmd JointCmd) Detach(args IJointOpt)

func (JointCmd) List

func (cmd JointCmd) List(args IJointListOpt)

func (JointCmd) Show

func (cmd JointCmd) Show(args IJointOpt)

func (JointCmd) Update

func (cmd JointCmd) Update(args IJointOpt)

type ResourceCmd

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

func NewResourceCmd

func NewResourceCmd(manager modulebase.IBaseManager) *ResourceCmd

func (ResourceCmd) BatchCreate

func (cmd ResourceCmd) BatchCreate(args IBatchCreateOpt)

func (ResourceCmd) BatchCreateWithKeyword

func (cmd ResourceCmd) BatchCreateWithKeyword(keyword string, args IBatchCreateOpt)

func (ResourceCmd) BatchDelete

func (cmd ResourceCmd) BatchDelete(args IBatchDeleteOpt)

func (ResourceCmd) BatchDeleteWithParam

func (cmd ResourceCmd) BatchDeleteWithParam(args IBatchDeleteWithParamOpt)

func (ResourceCmd) BatchPerform

func (cmd ResourceCmd) BatchPerform(action string, args IBatchPerformOpt)

func (ResourceCmd) BatchPut

func (cmd ResourceCmd) BatchPut(args IBatchPutOpt)

func (ResourceCmd) ClassShow

func (cmd ResourceCmd) ClassShow(args IShowOpt)

func (ResourceCmd) Create

func (cmd ResourceCmd) Create(args ICreateOpt)

func (ResourceCmd) CreateWithKeyword

func (cmd ResourceCmd) CreateWithKeyword(keyword string, args ICreateOpt)

func (ResourceCmd) Custom

func (cmd ResourceCmd) Custom(action TCustomAction, funcname string, args IGetActionOpt)

func (ResourceCmd) Delete

func (cmd ResourceCmd) Delete(args IDeleteOpt)

func (ResourceCmd) DeleteWithParam

func (cmd ResourceCmd) DeleteWithParam(args IDeleteWithParamOpt)

func (ResourceCmd) Get

func (cmd ResourceCmd) Get(specific string, args IGetOpt)

func (ResourceCmd) GetMetadata

func (cmd ResourceCmd) GetMetadata(args IMetadataOpt)

func (ResourceCmd) GetProperty

func (cmd ResourceCmd) GetProperty(args IPropertyOpt)

func (ResourceCmd) GetPropertyWithShowFunc

func (cmd ResourceCmd) GetPropertyWithShowFunc(args IPropertyOpt, showFunc func(jsonutils.JSONObject) error)

func (ResourceCmd) GetWithCustomOptionShow

func (cmd ResourceCmd) GetWithCustomOptionShow(specific string, show func(data jsonutils.JSONObject, args IGetOpt), args IGetOpt)

func (ResourceCmd) GetWithCustomShow

func (cmd ResourceCmd) GetWithCustomShow(specific string, show func(data jsonutils.JSONObject), args IGetOpt)

func (ResourceCmd) List

func (cmd ResourceCmd) List(args IListOpt)

func (ResourceCmd) Perform

func (cmd ResourceCmd) Perform(action string, args IPerformOpt)

func (ResourceCmd) PerformClass

func (cmd ResourceCmd) PerformClass(action string, args IOpt)

func (ResourceCmd) PerformClassWithKeyword

func (cmd ResourceCmd) PerformClassWithKeyword(keyword, action string, args IOpt)

func (ResourceCmd) PerformWithKeyword

func (cmd ResourceCmd) PerformWithKeyword(keyword, action string, args IPerformOpt)

func (*ResourceCmd) PrintObjectFlattenKV

func (cmd *ResourceCmd) PrintObjectFlattenKV() *ResourceCmd

func (*ResourceCmd) PrintObjectKV

func (cmd *ResourceCmd) PrintObjectKV() *ResourceCmd

func (*ResourceCmd) PrintObjectTable

func (cmd *ResourceCmd) PrintObjectTable() *ResourceCmd

func (*ResourceCmd) PrintObjectYAML

func (cmd *ResourceCmd) PrintObjectYAML() *ResourceCmd

func (ResourceCmd) Run

func (cmd ResourceCmd) Run(action string, args interface{}, callback interface{})

func (ResourceCmd) RunWithDesc

func (cmd ResourceCmd) RunWithDesc(action, desc string, args interface{}, callback interface{})

func (*ResourceCmd) SetKeyword

func (cmd *ResourceCmd) SetKeyword(keyword string) *ResourceCmd

func (*ResourceCmd) SetPrefix

func (cmd *ResourceCmd) SetPrefix(prefix string) *ResourceCmd

func (ResourceCmd) Show

func (cmd ResourceCmd) Show(args IShowOpt)

func (ResourceCmd) Update

func (cmd ResourceCmd) Update(args IUpdateOpt)

func (ResourceCmd) UpdateWithKeyword

func (cmd ResourceCmd) UpdateWithKeyword(keyword string, args IUpdateOpt)

func (*ResourceCmd) WithContextManager

func (cmd *ResourceCmd) WithContextManager(manager modulebase.IBaseManager) *ResourceCmd

func (*ResourceCmd) WithKeyword

func (cmd *ResourceCmd) WithKeyword(keyword string) *ResourceCmd

type TCustomAction

type TCustomAction string

Jump to

Keyboard shortcuts

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