SEBA-841 importer to parse all status from redfish server for data collection purpose / remove demotest binary
SEBA-856 SendDeviceList- This API will add all devices in the list
SEBA-858 DeleteDeviceList- This API will remove all devices in the list
decouple add/remove event subscription routines and device data file update
remove 'protocol'
SEBA-874 get rid of the 'vendor' argument called by some API's
Change-Id: Icc044dd4661c3cc14f02ad1a5f52e18116da63aa
diff --git a/demo_test/cmd_client/Makefile b/demo_test/cmd_client/Makefile
index 4c9a95e..c9f9579 100644
--- a/demo_test/cmd_client/Makefile
+++ b/demo_test/cmd_client/Makefile
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmd_cl:
+cmd_cl: cmd_cl.go
go build -i -v -o $@
diff --git a/demo_test/cmd_client/Note b/demo_test/cmd_client/Note
index 4781181..b72578a 100644
--- a/demo_test/cmd_client/Note
+++ b/demo_test/cmd_client/Note
@@ -26,9 +26,7 @@
Example:
- For the first time, you need to use "attach:ipaddress:port:vendorname:freq" to set the device's IP related info.
- If successful, you will get "[ipaddress:port]CMD to send:" prompt to indicate what device you attached now.
- This attach will subscribe default 3 types events into the server.
+ Attach a device will subscribe default 3 types events into the server.
You can use the following wget to check if any events subscriptions on the device.
wget --no-check-certificate \
@@ -42,60 +40,70 @@
--------------------------------------------------------------------------------------
Test items client cmd
--------------------------------------------------------------------------------------
-set device info Example:
+register one device Example:
-Set IP 192.168.4.27 port 8888 vendor "edgecore" freq 180
- attach:192.168.4.27:8888:edgecore:180
+Set IP 192.168.4.27 port 8888 freq 180
+ attach 192.168.4.27:8888:180
--------------------------------------------------------------------------------------
-set multi-device info Example:
+register multiple devices Example:
- attach:192.168.4.27:8888:edgecore:180
- attach:192.168.3.34:8888:edgecore:180
+Set "IP 192.168.4.27 port 8888 freq 180" and "IP 192.168.4.26 port 8888 freq 120"
+ attach 192.168.4.27:8888:180 192.168.4.26:8888:120
+
+--------------------------------------------------------------------------------------
+delete devices Example:
+
+Delete "IP 192.168.4.27" and "IP 192.168.3.34"
+
+ delete 192.168.4.27:8888 192.168.4.26:8888
--------------------------------------------------------------------------------------
Get Current List of Devices monitored showdevices
Return from server: 192.168.4.26:8888,192.168.4.27:8888
--------------------------------------------------------------------------------------
UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:192.168.4.27:8888:add:rm:alert
+=======
+UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub 192.168.4.27:8888:add:rm:alert
+>>>>>>> SEBA-841 importer to parse all status from redfish server for data collection purpose / remove demotest binary
--------------------------------------------------------------------------------------
-Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub:192.168.4.27:8888:add:rm:alert
+Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub 192.168.4.27:8888:add:rm:alert
--------------------------------------------------------------------------------------
Subscribe and unsubscribe an event Example:
-Subscribe ResourceAdded event sub:192.168.4.27:8888:add
-Subscribe ResourceRemoved event sub:192.168.4.27:8888:rm
-Subscribe Alert event sub:192.168.4.27:8888:alert
-Unsubscribe ResourceAdded event unsub:192.168.4.27:8888:add
-Unsubscribe ResourceRemoved event unsub:192.168.4.27:8888:rm
-Unsubscribe Alert event unsub:192.168.4.27:8888:alert
+Subscribe ResourceAdded event sub 192.168.4.27:8888:add
+Subscribe ResourceRemoved event sub 192.168.4.27:8888:rm
+Subscribe Alert event sub 192.168.4.27:8888:alert
+Unsubscribe ResourceAdded event unsub 192.168.4.27:8888:add
+Unsubscribe ResourceRemoved event unsub 192.168.4.27:8888:rm
+Unsubscribe Alert event unsub 192.168.4.27:8888:alert
--------------------------------------------------------------------------------------
Subscribe and unsubscribe multiple events, out of order Use the above commands to do test.
--------------------------------------------------------------------------------------
-Subscribe an unsupported event sub:192.168.4.27:8888:update
+Subscribe an unsupported event sub 192.168.4.27:8888:update
--------------------------------------------------------------------------------------
Subscribe to an already subscribed event Example:
- sub:192.168.4.27:8888:add
- sub:192.168.4.27:8888:add
+ sub 192.168.4.27:8888:add
+ sub 192.168.4.27:8888:add
--------------------------------------------------------------------------------------
-Unsubscribe an unsupported event unsub:192.168.4.27:8888:update
+Unsubscribe an unsupported event unsub 192.168.4.27:8888:update
--------------------------------------------------------------------------------------
Unsubscribe a supported but not-subscribed event Example:
- unsub:192.168.4.27:8888:add:rm:alert
- unsub:192.168.4.27:8888:add
- unsub:192.168.4.27:8888:rm
- unsub:192.168.4.27:8888:alert
+ unsub 192.168.4.27:8888:add:rm:alert
+ unsub 192.168.4.27:8888:add
+ unsub 192.168.4.27:8888:rm
+ unsub 192.168.4.27:8888:alert
--------------------------------------------------------------------------------------
Change polling interval Example:
Set frequecny to 30 seconds
- period:192.168.4.27:8888:30
+ period 192.168.4.27:8888:30
--------------------------------------------------------------------------------------
-Show support event list vendor showeventlist:edgecore
+Show list of supported event showeventlist 192.168.4.27:8888
-----------------------------------------------------------------------------------------------
-Show current events subscribed by device showdeviceeventlist:192.168.4.27:8888
+Show current events subscribed by device showdeviceeventlist 192.168.4.27:8888
------------------------------------------------------------------------------------------------------------
-Clear all current events subscribed by device cleardeviceeventlist:192.168.4.27:8888
+Clear all current events subscribed by device cleardeviceeventlist 192.168.4.27:8888
-------------------------------------------------------------------------------------------------------------
* During and after each test, verify the list of events subscribed wget --no-check-certificate \
-qO- https://192.168.4.27:8888/redfish/v1/EventService/Subscriptions/ \
diff --git a/demo_test/cmd_client/cmd_cl.go b/demo_test/cmd_client/cmd_cl.go
index e1ee3bb..2f8d865 100644
--- a/demo_test/cmd_client/cmd_cl.go
+++ b/demo_test/cmd_client/cmd_cl.go
@@ -18,9 +18,6 @@
import "fmt"
import "bufio"
import "os"
-import "strings"
-
-var attach_ip string = ""
func main() {
// connect to this socket
@@ -29,29 +26,14 @@
reader := bufio.NewReader(os.Stdin)
for {
// read in input from stdin
- if(attach_ip != ""){
- fmt.Printf("[%v] CMD to send :", attach_ip)
- }else{
- fmt.Print("CMD to send :")
- }
+ fmt.Print("CMD to send : ")
text, _ := reader.ReadString('\n')
-
// send to socket
fmt.Fprintf(conn, text + "\n")
- cmd := strings.TrimSuffix(text, "\n")
- s := strings.Split(cmd, ":")
- cmd = s[0]
-
- if(cmd == "attach"){
- // listen for reply
- t_attach_ip, _ := bufio.NewReader(conn).ReadString('\n')
- attach_ip = strings.TrimSuffix(t_attach_ip, "\n")
- }else{
- // listen for reply
- message, _ = bufio.NewReader(conn).ReadString('\n')
- fmt.Print("Return from server: " + message)
- }
+ // listen for reply
+ message, _ = bufio.NewReader(conn).ReadString('\n')
+ fmt.Print("Return from server: " + message)
if message == "QUIT\n"{
break