Unverified Commit 2bbb1b48 authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

Added 'label' and 'properties' fields in board watch command (json output) (#1845)

parent f43c9ec0
...@@ -91,9 +91,11 @@ func watchList(cmd *cobra.Command, inst *rpc.Instance) { ...@@ -91,9 +91,11 @@ func watchList(cmd *cobra.Command, inst *rpc.Instance) {
for event := range eventsChan { for event := range eventsChan {
feedback.PrintResult(watchEvent{ feedback.PrintResult(watchEvent{
Type: event.EventType, Type: event.EventType,
Label: event.Port.Port.Label,
Address: event.Port.Port.Address, Address: event.Port.Port.Address,
Protocol: event.Port.Port.Protocol, Protocol: event.Port.Port.Protocol,
ProtocolLabel: event.Port.Port.ProtocolLabel, ProtocolLabel: event.Port.Port.ProtocolLabel,
Properties: event.Port.Port.Properties,
Boards: event.Port.MatchingBoards, Boards: event.Port.MatchingBoards,
Error: event.Error, Error: event.Error,
}) })
...@@ -166,8 +168,10 @@ func (dr result) String() string { ...@@ -166,8 +168,10 @@ func (dr result) String() string {
type watchEvent struct { type watchEvent struct {
Type string `json:"type"` Type string `json:"type"`
Address string `json:"address,omitempty"` Address string `json:"address,omitempty"`
Label string `json:"label,omitempty"`
Protocol string `json:"protocol,omitempty"` Protocol string `json:"protocol,omitempty"`
ProtocolLabel string `json:"protocol_label,omitempty"` ProtocolLabel string `json:"protocol_label,omitempty"`
Properties map[string]string `json:"properties"`
Boards []*rpc.BoardListItem `json:"boards,omitempty"` Boards []*rpc.BoardListItem `json:"boards,omitempty"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment