VOL-1552 - inital stub
remove extra file
Change-Id: I9f5c93eefbde51c64a7c1b13244eca3a16de8a41
diff --git a/cli/menu/devicemenu/deviceMenu.go b/cli/menu/devicemenu/deviceMenu.go
new file mode 100644
index 0000000..a435f16
--- /dev/null
+++ b/cli/menu/devicemenu/deviceMenu.go
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import (
+ "fmt"
+
+ "github.com/bclicn/color"
+ "github.com/opencord/voltha-go/cli/util"
+ "google.golang.org/grpc"
+)
+
+/*
+Conn - the grpc connection to use for making calls to voltha core
+*/
+var (
+ Conn *grpc.ClientConn
+ DeviceId *string
+ InputPrompt *string
+ Commands *[]string
+)
+
+/*
+MainLoop - the loop which processes commands at the main level
+*/
+func MainLoop(conn *grpc.ClientConn, deviceId string) {
+
+ DeviceId = &deviceId
+ inputPrompt := fmt.Sprint("(" + color.LightRed("device "+deviceId) + ") ")
+ InputPrompt = &inputPrompt
+ funcTable := make(map[string]func(bool))
+ // inputPromptSize := len(inputPrompt)
+ Conn = conn
+ funcTable["quit"] = util.Exit
+ funcTable["exit"] = nil
+ funcTable["edit"] = doEdit
+ funcTable["history"] = doHistory
+ funcTable["img_dnld_request"] = doImgDnldRequest
+ funcTable["perf_config"] = doPerfConfig
+ funcTable["save"] = doSave
+ funcTable["eof"] = doEof
+ funcTable["images"] = doImages
+ funcTable["img_dnld_status"] = doImgDnldStatus
+ funcTable["ports"] = doPorts
+ funcTable["set"] = doSet
+ funcTable["img_activate"] = doImgActivate
+ funcTable["img_revert"] = doImgRevert
+ funcTable["py"] = doPy
+ funcTable["shell"] = doShell
+ funcTable["flows"] = doFlows
+ funcTable["img_dnld_canel"] = doImgDnldCancel
+ funcTable["list"] = doList
+ funcTable["shortcuts"] = doShortCuts
+ funcTable["help"] = doHelp
+ funcTable["img_dnld_list"] = doImgDnldList
+ funcTable["pause"] = doPause
+ funcTable["run"] = doRun
+ funcTable["show"] = doShow
+
+ commands := make([]string, len(funcTable))
+ i := 0
+ for key, _ := range funcTable {
+ commands[i] = key
+ i++
+ }
+ Commands = &commands
+
+ util.ProcessTable(funcTable, inputPrompt)
+
+}
diff --git a/cli/menu/devicemenu/edit.go b/cli/menu/devicemenu/edit.go
new file mode 100644
index 0000000..c5c1e8e
--- /dev/null
+++ b/cli/menu/devicemenu/edit.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doEdit(enterPressed bool) {
+ fmt.Println("doEdit")
+}
diff --git a/cli/menu/devicemenu/eof.go b/cli/menu/devicemenu/eof.go
new file mode 100644
index 0000000..4d752fb
--- /dev/null
+++ b/cli/menu/devicemenu/eof.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doEof(enterPressed bool) {
+ fmt.Println("doEof")
+}
diff --git a/cli/menu/devicemenu/flows.go b/cli/menu/devicemenu/flows.go
new file mode 100644
index 0000000..9a648b2
--- /dev/null
+++ b/cli/menu/devicemenu/flows.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doFlows(enterPressed bool) {
+ fmt.Println("doFlows")
+}
diff --git a/cli/menu/devicemenu/help.go b/cli/menu/devicemenu/help.go
new file mode 100644
index 0000000..340817d
--- /dev/null
+++ b/cli/menu/devicemenu/help.go
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import (
+ "fmt"
+ "os"
+ "strings"
+
+ "github.com/opencord/voltha-go/cli/util"
+)
+
+func doHelp(enterPressed bool) {
+ input := ""
+ var b = make([]byte, 1)
+ inputPrompt := *InputPrompt + "help "
+ for {
+ os.Stdin.Read(b)
+ char := string(b)
+ if char == "\t" || char == "\n" || char == "?" {
+ if enterPressed {
+ baseHelp()
+ return
+ }
+
+ fmt.Println("")
+ ret, prompt := util.Test(input, *Commands)
+ if len(ret) == 1 {
+ input = ret[0]
+ if input == "quit" {
+ util.Exit(true)
+ } else if input == "exit" {
+ return
+ }
+
+ MainLoop(Conn, input)
+ return
+ } else if len(ret) == 0 {
+ input = ""
+ fmt.Print("Invalid Input \n" + inputPrompt)
+ } else {
+
+ fmt.Println(ret)
+ input = prompt
+ fmt.Print(prompt + inputPrompt)
+ }
+ } else if b[0] == 127 || char == "\b" {
+
+ sz := len(input)
+ if sz > 0 {
+ fmt.Print("\b \b")
+ input = input[:sz-1]
+ }
+ if !(strings.HasPrefix(input, "device")) {
+ return
+ }
+ } else {
+ fmt.Print(char)
+ input += char
+ }
+ }
+}
+func baseHelp() {
+ message := `
+Documented commands (type help <topic>):
+========================================
+edit help img_dnld_cancel img_revert ports set
+eof history img_dnld_list list py shell
+exit images img_dnld_request pause run shortcuts
+flows img_activate img_dnld_status perf_config save show
+
+Miscellaneous help topics:
+==========================
+load
+
+Undocumented commands:
+======================
+quit
+
+`
+ fmt.Println(message)
+}
diff --git a/cli/menu/devicemenu/history.go b/cli/menu/devicemenu/history.go
new file mode 100644
index 0000000..b4d2423
--- /dev/null
+++ b/cli/menu/devicemenu/history.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doHistory(enterPressed bool) {
+ fmt.Println("doHistory")
+}
diff --git a/cli/menu/devicemenu/images.go b/cli/menu/devicemenu/images.go
new file mode 100644
index 0000000..dc2105e
--- /dev/null
+++ b/cli/menu/devicemenu/images.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImages(enterPressed bool) {
+ fmt.Println("doImages")
+}
diff --git a/cli/menu/devicemenu/img_activate.go b/cli/menu/devicemenu/img_activate.go
new file mode 100644
index 0000000..b615c1b
--- /dev/null
+++ b/cli/menu/devicemenu/img_activate.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgActivate(enterPressed bool) {
+ fmt.Println("doImgActivate")
+}
diff --git a/cli/menu/devicemenu/img_dnld_cancel.go b/cli/menu/devicemenu/img_dnld_cancel.go
new file mode 100644
index 0000000..cc9881d
--- /dev/null
+++ b/cli/menu/devicemenu/img_dnld_cancel.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgDnldCancel(enterPressed bool) {
+ fmt.Println("doImgDnldCancel")
+}
diff --git a/cli/menu/devicemenu/img_dnld_list.go b/cli/menu/devicemenu/img_dnld_list.go
new file mode 100644
index 0000000..ea6d31f
--- /dev/null
+++ b/cli/menu/devicemenu/img_dnld_list.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgDnldList(enterPressed bool) {
+ fmt.Println("doImgDnldList")
+}
diff --git a/cli/menu/devicemenu/img_dnld_request.go b/cli/menu/devicemenu/img_dnld_request.go
new file mode 100644
index 0000000..1a0ee98
--- /dev/null
+++ b/cli/menu/devicemenu/img_dnld_request.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgDnldRequest(enterPressed bool) {
+ fmt.Println("doImgDnldRequest")
+}
diff --git a/cli/menu/devicemenu/img_dnld_status.go b/cli/menu/devicemenu/img_dnld_status.go
new file mode 100644
index 0000000..2177996
--- /dev/null
+++ b/cli/menu/devicemenu/img_dnld_status.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgDnldStatus(enterPressed bool) {
+ fmt.Println("doImgDnldStatus")
+}
diff --git a/cli/menu/devicemenu/img_revert.go b/cli/menu/devicemenu/img_revert.go
new file mode 100644
index 0000000..bac7b37
--- /dev/null
+++ b/cli/menu/devicemenu/img_revert.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doImgRevert(enterPressed bool) {
+ fmt.Println("doImgRevert")
+}
diff --git a/cli/menu/devicemenu/list.go b/cli/menu/devicemenu/list.go
new file mode 100644
index 0000000..053fec9
--- /dev/null
+++ b/cli/menu/devicemenu/list.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doList(enterPressed bool) {
+ fmt.Println("doList")
+}
diff --git a/cli/menu/devicemenu/pause.go b/cli/menu/devicemenu/pause.go
new file mode 100644
index 0000000..6fec137
--- /dev/null
+++ b/cli/menu/devicemenu/pause.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doPause(enterPressed bool) {
+ fmt.Println("doPause")
+}
diff --git a/cli/menu/devicemenu/perf_config.go b/cli/menu/devicemenu/perf_config.go
new file mode 100644
index 0000000..bdc9ab4
--- /dev/null
+++ b/cli/menu/devicemenu/perf_config.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doPerfConfig(enterPressed bool) {
+ fmt.Println("doPrefConfig")
+}
diff --git a/cli/menu/devicemenu/ports.go b/cli/menu/devicemenu/ports.go
new file mode 100644
index 0000000..4b1aefb
--- /dev/null
+++ b/cli/menu/devicemenu/ports.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doPorts(enterPressed bool) {
+ fmt.Println("doPorts")
+}
diff --git a/cli/menu/devicemenu/py.go b/cli/menu/devicemenu/py.go
new file mode 100644
index 0000000..8a489fd
--- /dev/null
+++ b/cli/menu/devicemenu/py.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doPy(enterPressed bool) {
+ fmt.Println("doPy")
+}
diff --git a/cli/menu/devicemenu/run.go b/cli/menu/devicemenu/run.go
new file mode 100644
index 0000000..081fddb
--- /dev/null
+++ b/cli/menu/devicemenu/run.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doRun(enterPressed bool) {
+ fmt.Println("doRun")
+}
diff --git a/cli/menu/devicemenu/save.go b/cli/menu/devicemenu/save.go
new file mode 100644
index 0000000..ba4ef89
--- /dev/null
+++ b/cli/menu/devicemenu/save.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doSave(enterPressed bool) {
+ fmt.Println("doSave")
+}
diff --git a/cli/menu/devicemenu/set.go b/cli/menu/devicemenu/set.go
new file mode 100644
index 0000000..c8d8a15
--- /dev/null
+++ b/cli/menu/devicemenu/set.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doSet(enterPressed bool) {
+ fmt.Println("doSet")
+}
diff --git a/cli/menu/devicemenu/shell.go b/cli/menu/devicemenu/shell.go
new file mode 100644
index 0000000..cffbcbd
--- /dev/null
+++ b/cli/menu/devicemenu/shell.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doShell(enterPressed bool) {
+ fmt.Println("doShell")
+}
diff --git a/cli/menu/devicemenu/shortcuts.go b/cli/menu/devicemenu/shortcuts.go
new file mode 100644
index 0000000..14596d0
--- /dev/null
+++ b/cli/menu/devicemenu/shortcuts.go
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import "fmt"
+
+func doShortCuts(enterPressed bool) {
+ fmt.Println("doShortCuts")
+}
diff --git a/cli/menu/devicemenu/show.go b/cli/menu/devicemenu/show.go
new file mode 100644
index 0000000..b9e22bd
--- /dev/null
+++ b/cli/menu/devicemenu/show.go
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2018-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.
+*/
+
+package devicemenu
+
+import (
+ "context"
+ "fmt"
+ "strconv"
+
+ "github.com/opencord/voltha-go/cli/util"
+ "github.com/opencord/voltha-protos/go/common"
+ "github.com/opencord/voltha-protos/go/voltha"
+)
+
+func doShow(enterPressed bool) {
+ client := voltha.NewVolthaServiceClient(Conn)
+ fmt.Println(*DeviceId)
+ device, err := client.GetDevice(context.Background(), &common.ID{Id: *DeviceId})
+ if err != nil {
+ fmt.Println(err)
+ }
+ fields := []string{"field", "value"}
+ var rows []map[string]string
+
+ id := make(map[string]string)
+ id["field"] = "id"
+ id["value"] = device.Id
+ rows = append(rows, id)
+
+ Type := make(map[string]string)
+ Type["field"] = "type"
+ Type["value"] = device.Type
+ rows = append(rows, Type)
+
+ parentId := make(map[string]string)
+ parentId["field"] = "parent_id"
+ parentId["value"] = device.ParentId
+ rows = append(rows, parentId)
+
+ vlan := make(map[string]string)
+ vlan["field"] = "vlan"
+ vlan["value"] = strconv.FormatUint(uint64(device.Vlan), 10)
+ rows = append(rows, vlan)
+
+ adminState := make(map[string]string)
+ adminState["field"] = "admin_state"
+ adminState["value"] = strconv.FormatUint(uint64(device.AdminState), 10)
+ rows = append(rows, adminState)
+
+ proxyAddress := device.GetProxyAddress()
+ proxyDeviceId := make(map[string]string)
+ proxyDeviceId["field"] = "proxy_address.device_id"
+ proxyDeviceId["value"] = proxyAddress.DeviceId
+ rows = append(rows, proxyDeviceId)
+
+ proxyDeviceType := make(map[string]string)
+ proxyDeviceType["field"] = "proxy_address.device_type"
+ proxyDeviceType["value"] = proxyAddress.DeviceType
+ rows = append(rows, proxyDeviceType)
+
+ proxyChannelId := make(map[string]string)
+ proxyChannelId["field"] = "proxy_address.channel_id"
+ proxyChannelId["value"] = strconv.FormatUint(uint64(proxyAddress.ChannelId), 10)
+ rows = append(rows, proxyChannelId)
+
+ parentPortNumber := make(map[string]string)
+ parentPortNumber["field"] = "parent_port_no"
+ parentPortNumber["value"] = strconv.FormatUint(uint64(device.GetParentPortNo()), 10)
+ rows = append(rows, parentPortNumber)
+
+ output, _ := util.BuildTable(fields, rows)
+
+ fmt.Println(output)
+}