Documentation ¶
Overview ¶
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
* Copyright (C) 1999-2019 Alibaba Group Holding Limited
Index ¶
- Constants
- Variables
- func AcceptFlag(fs *cli.FlagSet) *cli.Flag
- func AddFlags(fs *cli.FlagSet)
- func BodyFileFlag(fs *cli.FlagSet) *cli.Flag
- func BodyFlag(fs *cli.FlagSet) *cli.Flag
- func DryRunFlag(fs *cli.FlagSet) *cli.Flag
- func EndpointFlag(fs *cli.FlagSet) *cli.Flag
- func ForceFlag(fs *cli.FlagSet) *cli.Flag
- func FormatJson(content string) string
- func HeaderFlag(fs *cli.FlagSet) *cli.Flag
- func NewAcceptFlag() *cli.Flag
- func NewBodyFileFlag() *cli.Flag
- func NewBodyFlag() *cli.Flag
- func NewDryRunFlag() *cli.Flag
- func NewEndpointFlag() *cli.Flag
- func NewForceFlag() *cli.Flag
- func NewHeaderFlag() *cli.Flag
- func NewOutputFlag() *cli.Flag
- func NewQuietFlag() *cli.Flag
- func NewRoaFlag() *cli.Flag
- func NewSecureFlag() *cli.Flag
- func NewVersionFlag() *cli.Flag
- func OutputFlag(fs *cli.FlagSet) *cli.Flag
- func QuietFlag(fs *cli.FlagSet) *cli.Flag
- func RoaFlag(fs *cli.FlagSet) *cli.Flag
- func SecureFlag(fs *cli.FlagSet) *cli.Flag
- func VersionFlag(fs *cli.FlagSet) *cli.Flag
- type BasicInvoker
- type Commando
- type ForceRpcInvoker
- type InvalidApiError
- type InvalidParameterError
- type InvalidProductError
- type InvokeHelper
- type Invoker
- type Library
- func (a *Library) GetApi(productCode string, version string, apiName string) (meta.Api, bool)
- func (a *Library) GetProduct(productCode string) (meta.Product, bool)
- func (a *Library) GetProducts() []meta.Product
- func (a *Library) PrintApiUsage(productCode string, apiName string) error
- func (a *Library) PrintProductUsage(productCode string, withApi bool) error
- func (a *Library) PrintProducts()
- type OutputFilter
- type Pager
- type RestfulInvoker
- type RpcInvoker
- type TableOutputFilter
- type Waiter
Constants ¶
const ( SecureFlagName = "secure" ForceFlagName = "force" EndpointFlagName = "endpoint" VersionFlagName = "version" HeaderFlagName = "header" BodyFlagName = "body" BodyFileFlagName = "body-file" AcceptFlagName = "accept" RoaFlagName = "roa" DryRunFlagName = "dryrun" QuietFlagName = "quiet" OutputFlagName = "output" )
Variables ¶
var PagerFlag = &cli.Flag{Category: "caller", Name: "pager", Hidden: false, AssignedMode: cli.AssignedRepeatable, Aliases: []string{"--all-pages"}, Short: i18n.T( "use `--pager` to merge pages for pageable APIs", "使用 `--pager` 在访问分页的API时合并结果分页"), Fields: []cli.Field{ {Key: "path", Required: false}, {Key: "PageNumber", DefaultValue: "PageNumber", Short: i18n.T(" PageNumber", "指定PageNumber的属性")}, {Key: "PageSize", DefaultValue: "PageSize", Short: i18n.T("PageSize", "")}, {Key: "TotalCount", DefaultValue: "TotalCount", Short: i18n.T("TotalCount", "")}, }, ExcludeWith: []string{WaiterFlag.Name}, }
var WaiterFlag = &cli.Flag{Category: "helper", Name: "waiter", AssignedMode: cli.AssignedRepeatable, Short: i18n.T( "use `--waiter expr=<jmesPath> to=<value>` to pull api until result equal to expected value", "使用 `--waiter expr=<jmesPath> to=<value>` 来轮询调用OpenAPI,知道返回期望的值"), Long: i18n.T( "", ""), Fields: []cli.Field{ {Key: "expr", Required: true, Short: i18n.T("", "")}, {Key: "to", Required: true, Short: i18n.T("", "")}, {Key: "timeout", DefaultValue: "180", Short: i18n.T("", "")}, {Key: "interval", DefaultValue: "5", Short: i18n.T("", "")}, }, ExcludeWith: []string{"pager"}, }
Functions ¶
func FormatJson ¶
func NewAcceptFlag ¶
func NewBodyFileFlag ¶
func NewBodyFlag ¶
func NewDryRunFlag ¶
func NewEndpointFlag ¶
func NewForceFlag ¶
func NewHeaderFlag ¶
func NewOutputFlag ¶
func NewQuietFlag ¶
func NewRoaFlag ¶
func NewSecureFlag ¶
func NewVersionFlag ¶
Types ¶
type BasicInvoker ¶
type BasicInvoker struct {
// contains filtered or unexported fields
}
basic invoker to init common object and headers
func NewBasicInvoker ¶
func NewBasicInvoker(cp *config.Profile) *BasicInvoker
type Commando ¶
type Commando struct {
// contains filtered or unexported fields
}
main entrance of aliyun cli
func (*Commando) InitWithCommand ¶
type ForceRpcInvoker ¶
type ForceRpcInvoker struct { *BasicInvoker // contains filtered or unexported fields }
func (*ForceRpcInvoker) Call ¶
func (a *ForceRpcInvoker) Call() (*responses.CommonResponse, error)
type InvalidApiError ¶
type InvalidApiError struct { Name string // contains filtered or unexported fields }
return when use unknown api
func (*InvalidApiError) Error ¶
func (e *InvalidApiError) Error() string
func (*InvalidApiError) GetSuggestions ¶
func (e *InvalidApiError) GetSuggestions() []string
type InvalidParameterError ¶
type InvalidParameterError struct { Name string // contains filtered or unexported fields }
return when use unknown parameter
func (*InvalidParameterError) Error ¶
func (e *InvalidParameterError) Error() string
func (*InvalidParameterError) GetSuggestions ¶
func (e *InvalidParameterError) GetSuggestions() []string
type InvalidProductError ¶
type InvalidProductError struct { Code string // contains filtered or unexported fields }
return when use unknown product
func (*InvalidProductError) Error ¶
func (e *InvalidProductError) Error() string
func (*InvalidProductError) GetSuggestions ¶
func (e *InvalidProductError) GetSuggestions() []string
type InvokeHelper ¶
implementations - Waiter - Pager
type Invoker ¶
type Invoker interface { Prepare(ctx *cli.Context) error Call() (*responses.CommonResponse, error) // contains filtered or unexported methods }
implementations: - RpcInvoker, - RpcForceInvoker - RestfulInvoker
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
func (*Library) GetProducts ¶
func (*Library) PrintApiUsage ¶
func (*Library) PrintProductUsage ¶
func (*Library) PrintProducts ¶
func (a *Library) PrintProducts()
type OutputFilter ¶
func GetOutputFilter ¶
func GetOutputFilter(ctx *cli.Context) OutputFilter
func NewTableOutputFilter ¶
func NewTableOutputFilter(ctx *cli.Context) OutputFilter
type Pager ¶
type Pager struct { PageNumberFlag string PageSizeFlag string PageNumberExpr string PageSizeExpr string TotalCountExpr string PageSize int // contains filtered or unexported fields }
func (*Pager) FeedResponse ¶
func (*Pager) GetResponseCollection ¶
func (*Pager) MoveNextPage ¶
func (a *Pager) MoveNextPage(request *requests.CommonRequest)
type RestfulInvoker ¶
type RestfulInvoker struct { *BasicInvoker // contains filtered or unexported fields }
func (*RestfulInvoker) Call ¶
func (a *RestfulInvoker) Call() (*responses.CommonResponse, error)
type RpcInvoker ¶
type RpcInvoker struct { *BasicInvoker // contains filtered or unexported fields }
func (*RpcInvoker) Call ¶
func (a *RpcInvoker) Call() (*responses.CommonResponse, error)
type TableOutputFilter ¶
type TableOutputFilter struct {
// contains filtered or unexported fields
}
func (*TableOutputFilter) FilterOutput ¶
func (a *TableOutputFilter) FilterOutput(s string) (string, error)
func (*TableOutputFilter) FormatTable ¶
func (a *TableOutputFilter) FormatTable(rowPath string, colNames []string, v interface{}) (string, error)