seba-321 implemented reflow logic
Change-Id: I4a67a38104dbcb9bbfa830b38fc4fc21c42c2dbd
diff --git a/client/main.go b/client/main.go
index f4b7826..abecae7 100644
--- a/client/main.go
+++ b/client/main.go
@@ -39,6 +39,7 @@
provOntFull := flag.Bool("f", false, "provsionOntFull?")
deleteOnt := flag.Bool("d", false, "deleteOnt")
output := flag.Bool("output", false, "dump output")
+ reflow := flag.Bool("reflow", false, "reflow provisioning tosca")
/* END COMMAND FLAGS */
/* CREATE CHASSIS FLAGS */
@@ -94,7 +95,7 @@
}
}
- cmdFlags := []*bool{echo, addOlt, update, create, provOnt, provOntFull, deleteOnt, output}
+ cmdFlags := []*bool{echo, addOlt, update, create, provOnt, provOntFull, deleteOnt, output, reflow}
cmdCount := 0
for _, flag := range cmdFlags {
if *flag {
@@ -160,6 +161,8 @@
Output(c)
} else if *deleteOnt {
deleteONT(c, clli, slot, port, ont, serial)
+ } else if *reflow {
+ reflowTosca(c)
}
}
@@ -312,6 +315,16 @@
log.Printf("Response from server: %t", res.GetSuccess())
return nil
}
+func reflowTosca(c api.AbstractOLTClient) error {
+ res, err := c.Reflow(context.Background(), &api.ReflowMessage{})
+ if err != nil {
+ debug.PrintStack()
+ fmt.Printf("Error when calling Reflow %s", err)
+ return err
+ }
+ log.Printf("Response from server: %t", res.GetSuccess())
+ return nil
+}
func usage() {
var output = `
@@ -378,6 +391,8 @@
e.g. ./client -server=localhost:7777 -d -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf
-output (TEMPORARY) causes AbstractOLT to serialize all chassis to JSON file in $WorkingDirectory/backups
e.g. ./client -server=localhost:7777 -output
+ -reflow causes tosca to be repushed to xos
+ e.g. ./client -server=localhost:7777 -reflow
`
fmt.Println(output)