Documentation ¶
Overview ¶
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2019-present Open Networking Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Portions copyright 2019-present Open Networking Foundation * Original copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- Variables
- func CheckModelName(source grpcurl.DescriptorSource, name string) error
- func CommaSeparatedQueryToMap(query_str string, allow_inequality bool) (map[string]string, error)
- func Confirmf(format string, args ...interface{}) bool
- func CreateDynamicURI() (string, string)
- func CreateModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, ...) error
- func DecodeOperator(query string) (string, string, bool, error)
- func DeleteModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, ...) error
- func FilterModels(ctx context.Context, conn *grpc.ClientConn, ...) ([]*dynamic.Message, error)
- func FindModel(ctx context.Context, conn *grpc.ClientConn, ...) (*dynamic.Message, error)
- func FindModelWithRetry(ctx context.Context, conn *grpc.ClientConn, ...) (*grpc.ClientConn, *dynamic.Message, error)
- func FormatAndGenerateListOutput(options *ListOutputOptions, default_format string, quiet_format string, ...)
- func FormatAndGenerateOutput(options *OutputOptions, default_format string, quiet_format string, ...)
- func GenerateHeaders() []string
- func GenerateOutput(result *CommandResult)
- func GetEnumValue(msg *dynamic.Message, name string) string
- func GetFilterKind(kindArg string) (string, error)
- func GetIDList(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, ...) ([]int32, error)
- func GetModel(ctx context.Context, conn *grpc.ClientConn, ...) (*dynamic.Message, error)
- func GetModelNames(source grpcurl.DescriptorSource) (map[string]bool, error)
- func GetModelWithRetry(ctx context.Context, conn *grpc.ClientConn, ...) (*grpc.ClientConn, *dynamic.Message, error)
- func GetReflectionMethod(conn *grpc.ClientConn, name string) (grpcurl.DescriptorSource, string, error)
- func GetVersion(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource) (*dynamic.Message, error)
- func GrpcTimeoutContext(ctx context.Context) (context.Context, context.CancelFunc)
- func InitClient(flags uint32) (*grpc.ClientConn, grpcurl.DescriptorSource, error)
- func IsEnacted(d *dynamic.Message) bool
- func IsFileUri(s string) bool
- func ItemsToDynamicMessageList(items interface{}) []*dynamic.Message
- func ListModels(ctx context.Context, conn *grpc.ClientConn, ...) ([]*dynamic.Message, error)
- func ListOrFilterModels(ctx context.Context, conn *grpc.ClientConn, ...) ([]*dynamic.Message, error)
- func MessageToMap(d *dynamic.Message) map[string]interface{}
- func NewConnection() (*grpc.ClientConn, error)
- func QueryStringsToMap(query_args []string, allow_inequality bool) (map[string]string, error)
- func RegisterBackupCommands(parser *flags.Parser)
- func RegisterCompletionCommands(parent *flags.Parser)
- func RegisterConfigCommands(parent *flags.Parser)
- func RegisterModelCommands(parser *flags.Parser)
- func RegisterModelTypeCommands(parser *flags.Parser)
- func RegisterServiceCommands(parser *flags.Parser)
- func RegisterStatusCommands(parser *flags.Parser)
- func RegisterTransferCommands(parser *flags.Parser)
- func RegisterVersionCommands(parent *flags.Parser)
- func SetEnumValue(msg *dynamic.Message, name string, value string)
- func Ternary_uint32(condition bool, value_true uint32, value_false uint32) uint32
- func TypeConvert(source grpcurl.DescriptorSource, modelName string, field_name string, v string) (interface{}, error)
- func UpdateModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, ...) error
- func UpdateModelStatusOutput(output *ModelStatusOutput, i int, id interface{}, status string, err error, ...)
- type BackupCreate
- type BackupOpts
- type BackupOutput
- type BackupRestore
- type BashOptions
- type CommandResult
- type CompletionOptions
- type ConfigOptions
- type CoreVersionDetails
- type DescriptorNotFoundError
- type DownloadHandler
- type ListOutputOptions
- type MethodNotFoundError
- type MethodVersionNotFoundError
- type ModelCreate
- type ModelDelete
- type ModelList
- type ModelNameString
- type ModelOpts
- type ModelSetDirty
- type ModelStatusOutput
- type ModelStatusOutputRow
- type ModelSync
- type ModelTypeList
- type ModelTypeOpts
- type ModelUpdate
- type OutputOptions
- type OutputType
- type QueryEventHandler
- type RpcEventHandler
- func (h *RpcEventHandler) GetParams(msg proto.Message) error
- func (h *RpcEventHandler) OnReceiveHeaders(metadata.MD)
- func (h *RpcEventHandler) OnReceiveResponse(m proto.Message)
- func (h *RpcEventHandler) OnReceiveTrailers(s *status.Status, m metadata.MD)
- func (h *RpcEventHandler) OnResolveMethod(*desc.MethodDescriptor)
- func (h *RpcEventHandler) OnSendHeaders(metadata.MD)
- type ServiceList
- type ServiceListOutput
- type ServiceOpts
- type StatusListOpts
- type StatusOpts
- type TransferDownload
- type TransferOpts
- type TransferOutput
- type TransferUpload
- type UnableToParseDescriptorErrror
- type UploadHandler
- type VersionDetails
- type VersionOpts
- type VersionOutput
Constants ¶
const ( INIT_DEFAULT = 0 INIT_NO_VERSION_CHECK = 1 // Do not check whether server is allowed version )
Flags for calling the InitReflectionClient Method
const ( DEFAULT_CREATE_FORMAT = "table{{ .Id }}\t{{ .Message }}" DEFAULT_DELETE_FORMAT = "table{{ .Id }}\t{{ .Message }}" DEFAULT_UPDATE_FORMAT = "table{{ .Id }}\t{{ .Message }}" DEFAULT_SYNC_FORMAT = "table{{ .Id }}\t{{ .Message }}" )
const ( GM_QUIET = 1 GM_UNTIL_FOUND = 2 GM_UNTIL_ENACTED = 4 GM_UNTIL_STATUS = 8 )
Flags for calling the *WithRetry methods
const ( FILTER_DEFAULT = "DEFAULT" FILTER_ALL = "ALL" FILTER_DIRTY = "SYNCHRONIZER_DIRTY_OBJECTS" FILTER_DELETED = "SYNCHRONIZER_DELETED_OBJECTS" FILTER_DIRTYPOL = "SYNCHRONIZER_DIRTY_POLICIES" FILTER_DELETEDPOL = "SYNCHRONIZER_DELETED_POLICIES" )
Valid choices for FilterModels `Kind` argument
const ClientFormat = `` /* 249-byte string literal not displayed */
const (
DEFAULT_BACKUP_FORMAT = "table{{ .Status }}\t{{ .Checksum }}\t{{ .Chunks }}\t{{ .Bytes }}"
)
const (
DEFAULT_MODELTYPE_LIST_FORMAT = "{{ . }}"
)
const (
DEFAULT_SERVICE_FORMAT = "table{{ .Name }}\t{{.Version}}\t{{.State}}"
)
const (
DEFAULT_TRANSFER_FORMAT = "table{{ .Status }}\t{{ .Checksum }}\t{{ .Chunks }}\t{{ .Bytes }}"
)
const DefaultFormat = ClientFormat + ServerFormat
const ServerFormat = `` /* 259-byte string literal not displayed */
const StatusListFormat = "table{{ .Component }}\t{{ .Name }}\t{{ .Version }}\t{{ .Connection }}\t{{ .Status }}"
Variables ¶
var CharReplacer = strings.NewReplacer("\\t", "\t", "\\n", "\n")
var OutputStream io.Writer = os.Stdout
Make it easy to override output stream for testing
Functions ¶
func CheckModelName ¶
func CheckModelName(source grpcurl.DescriptorSource, name string) error
Check to see if a model name is valid
func CommaSeparatedQueryToMap ¶
Take a string of comma-separated queries and turn it into a map of queries
func CreateDynamicURI ¶
Create a file:/// URI to use for storing the file in the core
func CreateModel ¶
func CreateModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, fields map[string]interface{}) error
Create a model in XOS given a map of fields
func DecodeOperator ¶
Separate the operator from the query value. For example,
"==foo" --> "EQUAL", "foo"
func DeleteModel ¶
func DeleteModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, id int32) error
Get a model from XOS given its ID
func FilterModels ¶
func FilterModels(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, kind string, queries map[string]string) ([]*dynamic.Message, error)
Filter models based on field values
queries is a map of <field_name> to <operator><query> For example, map[string]string{"name": "==mysite"}
func FindModel ¶
func FindModel(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, queries map[string]string) (*dynamic.Message, error)
Get a model from XOS given a fieldName/fieldValue
func FindModelWithRetry ¶
func FindModelWithRetry(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, queries map[string]string, flags uint32) (*grpc.ClientConn, *dynamic.Message, error)
Find a model, but retry under a variety of circumstances
func FormatAndGenerateListOutput ¶
func FormatAndGenerateListOutput(options *ListOutputOptions, default_format string, quiet_format string, data interface{})
Applies common output options to format and generate output
func FormatAndGenerateOutput ¶
func FormatAndGenerateOutput(options *OutputOptions, default_format string, quiet_format string, data interface{})
Applies common output options to format and generate output
func GenerateHeaders ¶
func GenerateHeaders() []string
func GenerateOutput ¶
func GenerateOutput(result *CommandResult)
func GetFilterKind ¶
Convert a user-supplied state filter argument to the appropriate enum name
func GetIDList ¶
func GetIDList(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, ids []int32, filter string, all bool) ([]int32, error)
Common processing for commands that take a modelname and a list of ids or a filter
func GetModel ¶
func GetModel(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, id int32) (*dynamic.Message, error)
Get a model from XOS given its ID
func GetModelNames ¶
func GetModelNames(source grpcurl.DescriptorSource) (map[string]bool, error)
Return a list of all available model names
func GetModelWithRetry ¶
func GetModelWithRetry(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, id int32, flags uint32) (*grpc.ClientConn, *dynamic.Message, error)
Get a model, but retry under a variety of circumstances
func GetReflectionMethod ¶
func GetReflectionMethod(conn *grpc.ClientConn, name string) (grpcurl.DescriptorSource, string, error)
func GetVersion ¶
func GetVersion(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource) (*dynamic.Message, error)
Perform the GetVersion API call on the core to get the version
func GrpcTimeoutContext ¶
Returns a context used for gRPC timeouts
func InitClient ¶
func InitClient(flags uint32) (*grpc.ClientConn, grpcurl.DescriptorSource, error)
func ListModels ¶
func ListModels(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string) ([]*dynamic.Message, error)
List all objects of a given model
func ListOrFilterModels ¶
func ListOrFilterModels(ctx context.Context, conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, kind string, queries map[string]string) ([]*dynamic.Message, error)
Call ListModels or FilterModels as appropriate
func MessageToMap ¶
Takes a *dynamic.Message and turns it into a map of fields to interfaces
TODO: Might be more useful to convert the values to strings and ints
func NewConnection ¶
func NewConnection() (*grpc.ClientConn, error)
func QueryStringsToMap ¶
Take a string list of queries and turns it into a map of queries
func RegisterBackupCommands ¶
func RegisterConfigCommands ¶
func RegisterModelCommands ¶
func RegisterServiceCommands ¶
func RegisterStatusCommands ¶
func RegisterVersionCommands ¶
func Ternary_uint32 ¶
A makeshift substitute for C's Ternary operator
func TypeConvert ¶
func TypeConvert(source grpcurl.DescriptorSource, modelName string, field_name string, v string) (interface{}, error)
Convert a string into the appropriate gRPC type for a given field
func UpdateModel ¶
func UpdateModel(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, modelName string, fields map[string]interface{}) error
Update a model in XOS given a map of fields
func UpdateModelStatusOutput ¶
func UpdateModelStatusOutput(output *ModelStatusOutput, i int, id interface{}, status string, err error, final bool)
Types ¶
type BackupCreate ¶
type BackupCreate struct { OutputOptions ChunkSize int `short:"h" long:"chunksize" default:"65536" description:"Chunk size for streaming transfer"` Args struct { LocalFileName string } `positional-args:"yes" required:"yes"` }
func (*BackupCreate) Execute ¶
func (options *BackupCreate) Execute(args []string) error
type BackupOpts ¶
type BackupOpts struct { Create BackupCreate `command:"create"` Restore BackupRestore `command:"restore"` }
type BackupOutput ¶
type BackupRestore ¶
type BackupRestore struct { OutputOptions ChunkSize int `short:"h" long:"chunksize" default:"65536" description:"Chunk size for streaming transfer"` Args struct { LocalFileName string } `positional-args:"yes" required:"yes"` CreateURIFunc func() (string, string) // allow override of CreateURIFunc for easy unit testing }
func (*BackupRestore) Execute ¶
func (options *BackupRestore) Execute(args []string) error
type BashOptions ¶
type BashOptions struct{}
func (*BashOptions) Execute ¶
func (options *BashOptions) Execute(args []string) error
type CommandResult ¶
type CommandResult struct { Format format.Format OrderBy string OutputAs OutputType Data interface{} }
type CompletionOptions ¶
type CompletionOptions struct {
BashOptions `command:"bash"`
}
type ConfigOptions ¶
type ConfigOptions struct { }
func (*ConfigOptions) Execute ¶
func (options *ConfigOptions) Execute(args []string) error
type CoreVersionDetails ¶
type DescriptorNotFoundError ¶
type DescriptorNotFoundError struct {
Version string
}
func (*DescriptorNotFoundError) Error ¶
func (e *DescriptorNotFoundError) Error() string
type DownloadHandler ¶
type DownloadHandler struct { RpcEventHandler // contains filtered or unexported fields }
func DownloadFile ¶
func DownloadFile(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, uri string, local_name string) (*DownloadHandler, error)
func (*DownloadHandler) GetChecksum ¶
func (h *DownloadHandler) GetChecksum() string
func (*DownloadHandler) OnReceiveResponse ¶
func (h *DownloadHandler) OnReceiveResponse(m proto.Message)
type ListOutputOptions ¶
type ListOutputOptions struct { OutputOptions OrderBy string `short:"r" long:"orderby" default:"" description:"Specify the sort order of the results"` }
type MethodNotFoundError ¶
type MethodNotFoundError struct {
Name string
}
func (*MethodNotFoundError) Error ¶
func (e *MethodNotFoundError) Error() string
type MethodVersionNotFoundError ¶
func (*MethodVersionNotFoundError) Error ¶
func (e *MethodVersionNotFoundError) Error() string
type ModelCreate ¶
type ModelCreate struct { OutputOptions Unbuffered bool `short:"u" long:"unbuffered" description:"Do not buffer console output"` SetFields string `long:"set-field" description:"Comma-separated list of field=value to set"` SetJSON string `long:"set-json" description:"JSON dictionary to use for settings fields"` Sync bool `long:"sync" description:"Synchronize before returning"` SyncTimeout time.Duration `long:"synctimeout" default:"600s" description:"Timeout for --sync option"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` }
func (*ModelCreate) Execute ¶
func (options *ModelCreate) Execute(args []string) error
type ModelDelete ¶
type ModelDelete struct { OutputOptions Unbuffered bool `short:"u" long:"unbuffered" description:"Do not buffer console output and suppress default output processor"` Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` All bool `short:"a" long:"all" description:"Operate on all models"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` IDArgs struct { ID []int32 } `positional-args:"yes" required:"no"` }
func (*ModelDelete) Execute ¶
func (options *ModelDelete) Execute(args []string) error
type ModelList ¶
type ModelList struct { ListOutputOptions ShowHidden bool `long:"showhidden" description:"Show hidden fields in default output"` ShowFeedback bool `long:"showfeedback" description:"Show feedback fields in default output"` ShowBookkeeping bool `long:"showbookkeeping" description:"Show bookkeeping fields in default output"` Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` State string `short:"s" long:"state" description:"Filter model state [DEFAULT | ALL | DIRTY | DELETED | DIRTYPOL | DELETEDPOL]"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` }
type ModelNameString ¶
type ModelNameString string
func (*ModelNameString) Complete ¶
func (modelName *ModelNameString) Complete(match string) []flags.Completion
type ModelOpts ¶
type ModelOpts struct { List ModelList `command:"list"` Update ModelUpdate `command:"update"` Delete ModelDelete `command:"delete"` Create ModelCreate `command:"create"` Sync ModelSync `command:"sync"` SetDirty ModelSetDirty `command:"setdirty"` }
type ModelSetDirty ¶
type ModelSetDirty struct { OutputOptions Unbuffered bool `short:"u" long:"unbuffered" description:"Do not buffer console output and suppress default output processor"` Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` All bool `short:"a" long:"all" description:"Operate on all models"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` IDArgs struct { ID []int32 } `positional-args:"yes" required:"no"` }
func (*ModelSetDirty) Execute ¶
func (options *ModelSetDirty) Execute(args []string) error
type ModelStatusOutput ¶
type ModelStatusOutput struct { Rows []ModelStatusOutputRow Unbuffered bool }
func InitModelStatusOutput ¶
func InitModelStatusOutput(unbuffered bool, count int) ModelStatusOutput
Initialize ModelStatusOutput structure, creating a row for each model that will be output
type ModelStatusOutputRow ¶
type ModelStatusOutputRow struct { Id interface{} `json:"id"` Message string `json:"message"` }
type ModelSync ¶
type ModelSync struct { OutputOptions Unbuffered bool `short:"u" long:"unbuffered" description:"Do not buffer console output and suppress default output processor"` Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` SyncTimeout time.Duration `long:"synctimeout" default:"600s" description:"Timeout for synchronization"` All bool `short:"a" long:"all" description:"Operate on all models"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` IDArgs struct { ID []int32 } `positional-args:"yes" required:"no"` }
type ModelTypeList ¶
type ModelTypeList struct {
OutputOptions
}
func (*ModelTypeList) Execute ¶
func (options *ModelTypeList) Execute(args []string) error
type ModelTypeOpts ¶
type ModelTypeOpts struct {
List ModelTypeList `command:"list"`
}
type ModelUpdate ¶
type ModelUpdate struct { OutputOptions Unbuffered bool `short:"u" long:"unbuffered" description:"Do not buffer console output and suppress default output processor"` Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` SetFields string `long:"set-field" description:"Comma-separated list of field=value to set"` SetJSON string `long:"set-json" description:"JSON dictionary to use for settings fields"` Sync bool `long:"sync" description:"Synchronize before returning"` SyncTimeout time.Duration `long:"synctimeout" default:"600s" description:"Timeout for --sync option"` Args struct { ModelName ModelNameString } `positional-args:"yes" required:"yes"` IDArgs struct { ID []int32 } `positional-args:"yes" required:"no"` }
func (*ModelUpdate) Execute ¶
func (options *ModelUpdate) Execute(args []string) error
type OutputOptions ¶
type OutputOptions struct { Format string `long:"format" value-name:"FORMAT" default:"" description:"Format to use to output structured data"` Quiet bool `short:"q" long:"quiet" description:"Output only the IDs of the objects"` OutputAs string `short:"o" long:"outputas" default:"table" choice:"table" choice:"json" choice:"yaml" description:"Type of output to generate"` }
type OutputType ¶
type OutputType uint8
const ( OUTPUT_TABLE OutputType = iota OUTPUT_JSON OUTPUT_YAML )
type QueryEventHandler ¶
type QueryEventHandler struct { RpcEventHandler Elements map[string]string Model *desc.MessageDescriptor Kind string EOF bool }
type RpcEventHandler ¶
type RpcEventHandler struct { Response proto.Message Status *status.Status Data []byte Fields map[string]map[string]interface{} }
func (*RpcEventHandler) OnReceiveHeaders ¶
func (h *RpcEventHandler) OnReceiveHeaders(metadata.MD)
func (*RpcEventHandler) OnReceiveResponse ¶
func (h *RpcEventHandler) OnReceiveResponse(m proto.Message)
func (*RpcEventHandler) OnReceiveTrailers ¶
func (h *RpcEventHandler) OnReceiveTrailers(s *status.Status, m metadata.MD)
func (*RpcEventHandler) OnResolveMethod ¶
func (h *RpcEventHandler) OnResolveMethod(*desc.MethodDescriptor)
func (*RpcEventHandler) OnSendHeaders ¶
func (h *RpcEventHandler) OnSendHeaders(metadata.MD)
type ServiceList ¶
type ServiceList struct {
ListOutputOptions
}
func (*ServiceList) Execute ¶
func (options *ServiceList) Execute(args []string) error
type ServiceListOutput ¶
type ServiceOpts ¶
type ServiceOpts struct {
List ServiceList `command:"list"`
}
type StatusListOpts ¶
type StatusListOpts struct { ListOutputOptions Filter string `short:"f" long:"filter" description:"Comma-separated list of filters"` }
func (*StatusListOpts) Execute ¶
func (options *StatusListOpts) Execute(args []string) error
type StatusOpts ¶
type StatusOpts struct {
List StatusListOpts `command:"list"`
}
type TransferDownload ¶
type TransferDownload struct { OutputOptions Args struct { URI string LocalFileName string } `positional-args:"yes" required:"yes"` }
func (*TransferDownload) Execute ¶
func (options *TransferDownload) Execute(args []string) error
type TransferOpts ¶
type TransferOpts struct { Upload TransferUpload `command:"upload"` Download TransferDownload `command:"download"` }
type TransferOutput ¶
type TransferUpload ¶
type TransferUpload struct { OutputOptions ChunkSize int `short:"h" long:"chunksize" default:"65536" description:"Host and port"` Args struct { LocalFileName string URI string } `positional-args:"yes" required:"yes"` }
func (*TransferUpload) Execute ¶
func (options *TransferUpload) Execute(args []string) error
type UnableToParseDescriptorErrror ¶
type UnableToParseDescriptorErrror struct { Version string // contains filtered or unexported fields }
func (*UnableToParseDescriptorErrror) Error ¶
func (e *UnableToParseDescriptorErrror) Error() string
type UploadHandler ¶
type UploadHandler struct { RpcEventHandler // contains filtered or unexported fields }
func UploadFile ¶
func UploadFile(conn *grpc.ClientConn, descriptor grpcurl.DescriptorSource, local_name string, uri string, chunkSize int) (*UploadHandler, *dynamic.Message, error)
func (*UploadHandler) GetChecksum ¶
func (h *UploadHandler) GetChecksum() string
type VersionDetails ¶
type VersionOpts ¶
type VersionOpts struct { OutputAs string `short:"o" long:"outputas" default:"table" choice:"table" choice:"json" choice:"yaml" description:"Type of output to generate"` ClientOnly bool `short:"c" long:"client-only" description:"Print only client version"` }
func (*VersionOpts) Execute ¶
func (options *VersionOpts) Execute(args []string) error
type VersionOutput ¶
type VersionOutput struct { Client VersionDetails `json:"client"` Server CoreVersionDetails `json:"server"` }