cli

package
v0.0.0-...-1242a22 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

Overview

Command Line Interface (CLI) of OpenUsp is centralized command center to issue various commands to all the distributed subsystems. It interacts with ApiServer of OpenUsp through gRPC protocol and uses database methods to interact with the DB.

It issues variour USP commands to agents through MTP module.

It also reads datamodel, parameter and instance information of objects from Database and manages the db objects, tables.

Syntax

A standard syntax of "verb noun" form has been followed for all the CLI commands.

Command Summary

add instance|wifi <path|ssid> <ssid:securitytype> <radio>
connect to mtp|db <addr:port>
operate command <command> Ex: operate command Device.Reboot()
remove object|collection|instance|wifi 
remove db <object|collection> <objname|collectionname>
set agentid|param|wifi
show agentid|param|datamodel|instance|wifi
update param|datamodel|instance

Command Details

Add

Add Commands can be used to create new instances of Device2 datamodel objects. Instances of objects having multi-instance capabilities can only be created or removed.

add instance <path> <paramname> <paramvalue>
add wifi <ssid>
Connect
Remove
IP
remove ip intf <id|name> [ipv4addr|ipv6addr] [id|name]
remove ip intf <id|name>
remove ip intf *
remove ip intf
remove ip intf <id|name> ipv4addr <id|name>
remove ip intf <id|name> ipv4addr
remove ip intf <id|name> ipv4addr *

Documentation

Index

Constants

View Source
const (
	DEFAULT_MAX_STOMP_MSG_TO_REMOVE = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

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

func (*Cli) ClearLastCmdErr

func (cli *Cli) ClearLastCmdErr()

func (*Cli) GetLastCmdErr

func (cli *Cli) GetLastCmdErr() error

func (*Cli) Init

func (cli *Cli) Init() error

func (*Cli) ProcessCmd

func (cli *Cli) ProcessCmd(args string) error

func (*Cli) Run

func (cli *Cli) Run()

func (*Cli) SetOut

func (cli *Cli) SetOut(writer io.Writer) error

type Instance

type Instance struct {
	Path       string            `json:"path"`
	UniqueKeys map[string]string `json:"unique_keys"`
}

type MsgType

type MsgType byte
const (
	MsgTypeNotify MsgType = iota
	MsgTypeGet
	MsgTypeSet
	MsgTypeOperate
	MsgTypeAdd
	MsgTypeDel
	MsgTypeGetDm
)

type MtpInfo

type MtpInfo struct {
	Version string `json:"version"`
}

type NotifyType

type NotifyType byte
const (
	NotifyEvent NotifyType = iota
	NotifyValueChange
	NotifyObjCreation
	NotifyObjDeletion
	NotifyOpComplete
	NotifyOnBoardReq
)

type Object

type Object struct {
	Path   string            `json:"path"`
	Params map[string]string `json:"params"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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