blob: 79b29c548b427d57b550d8309279e1ff6eabd419 [file] [log] [blame]
Author Namea594e632018-08-10 11:33:58 -04001/*
2 Copyright 2017 the original author or authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17package main
18
19import (
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040020 "context"
21 "flag"
22 "fmt"
Author Namea594e632018-08-10 11:33:58 -040023 "log"
Author Namea594e632018-08-10 11:33:58 -040024 "runtime/debug"
donNewtonAlphab3279ea2018-09-18 15:55:32 -040025 "strings"
Author Namea594e632018-08-10 11:33:58 -040026
27 "gerrit.opencord.org/abstract-olt/api"
Author Namea594e632018-08-10 11:33:58 -040028 "google.golang.org/grpc"
29 "google.golang.org/grpc/credentials"
30)
31
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040032func main() {
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040033 /* COMMAND FLAGS */
donNewtonAlphab3279ea2018-09-18 15:55:32 -040034 echo := flag.Bool("e", false, "echo")
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040035 create := flag.Bool("c", false, "create?")
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -040036 update := flag.Bool("u", false, "update?")
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040037 addOlt := flag.Bool("s", false, "addOlt?")
38 provOnt := flag.Bool("o", false, "provisionOnt?")
Don Newton281e0252018-10-22 14:38:50 -040039 provOntFull := flag.Bool("f", false, "provsionOntFull?")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040040 deleteOnt := flag.Bool("d", false, "deleteOnt")
Don Newton281e0252018-10-22 14:38:50 -040041 output := flag.Bool("output", false, "dump output")
Don Newtone973d342018-10-26 16:44:12 -040042 reflow := flag.Bool("reflow", false, "reflow provisioning tosca")
donNewtonAlpha27ad20c2018-10-30 16:18:42 -040043 fullInventory := flag.Bool("full_inventory", false, "pull full inventory json")
44 inventory := flag.Bool("inventory", false, "pull json inventory for a specific clli")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040045 /* END COMMAND FLAGS */
46
47 /* CREATE CHASSIS FLAGS */
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -040048 xosUser := flag.String("xos_user", "", "xos_user")
49 xosPassword := flag.String("xos_password", "", "xos_password")
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040050 xosAddress := flag.String("xos_address", "", "xos address")
51 xosPort := flag.Uint("xos_port", 0, "xos port")
52 rack := flag.Uint("rack", 1, "rack number for chassis")
53 shelf := flag.Uint("shelf", 1, "shelf number for chassis")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040054 /* END CREATE CHASSIS FLAGS */
55
56 /* ADD OLT FLAGS */
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040057 oltAddress := flag.String("olt_address", "", "ip address for olt chassis")
58 oltPort := flag.Uint("olt_port", 0, "listen port for olt chassis")
59 name := flag.String("name", "", "friendly name for olt chassis")
60 driver := flag.String("driver", "", "driver to use with olt chassis")
61 oltType := flag.String("type", "", "olt chassis type")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040062 /* END ADD OLT FLAGS */
63
64 /* PROVISION / DELETE ONT FLAGS */
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040065 slot := flag.Uint("slot", 1, "slot number 1-16 to provision ont to")
66 port := flag.Uint("port", 1, "port number 1-16 to provision ont to")
67 ont := flag.Uint("ont", 1, "ont number 1-64")
68 serial := flag.String("serial", "", "serial number of ont")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040069 /* END PROVISION / DELETE ONT FLAGS */
70
Don Newton281e0252018-10-22 14:38:50 -040071 /*PROVISION ONT FULL EXTRA FLAGS*/
72 stag := flag.Uint("stag", 0, "s-tag for ont")
73 ctag := flag.Uint("ctag", 0, "c-tag for ont")
74 nasPort := flag.String("nas_port", "", "NasPortID for ont")
75 circuitID := flag.String("circuit_id", "", "CircuitID for ont")
76 /*END PROVISION ONT FULL EXTRA FLAGS*/
77
78 /* ECHO FLAGS */
79 message := flag.String("message", "ping", "message to be echoed back")
80 /*END ECHO FLAGS*/
81
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040082 /*GENERIC FLAGS */
83 clli := flag.String("clli", "", "clli of abstract chassis")
donNewtonAlphab3279ea2018-09-18 15:55:32 -040084 useSsl := flag.Bool("ssl", false, "use ssl")
85 useAuth := flag.Bool("auth", false, "use auth")
86 crtFile := flag.String("cert", "cert/server.crt", "Public cert for server to establish tls session")
87 serverAddressPort := flag.String("server", "localhost:7777", "address and port of AbstractOLT server")
88 fqdn := flag.String("fqdn", "", "FQDN of the service to match what is in server.crt")
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040089 /*GENERIC FLAGS */
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040090
91 flag.Parse()
donNewtonAlphae7ab5b92018-09-27 15:09:14 -040092
donNewtonAlphab3279ea2018-09-18 15:55:32 -040093 if *useSsl {
94 if *fqdn == "" {
95 fqdn = &(strings.Split(*serverAddressPort, ":")[0])
96 fmt.Printf("using %s as the FQDN for the AbstractOLT server", *fqdn)
97 }
98 }
donNewtonAlpha1d2d6812018-09-14 16:00:02 -040099
donNewtonAlpha27ad20c2018-10-30 16:18:42 -0400100 cmdFlags := []*bool{echo, addOlt, update, create, provOnt, provOntFull, deleteOnt, output, reflow, fullInventory, inventory}
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400101 cmdCount := 0
102 for _, flag := range cmdFlags {
103 if *flag {
104 cmdCount++
105 }
106 }
107 if cmdCount > 1 {
108 fmt.Println("CMD You can only call one method at a time")
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400109 usage()
110 return
111 }
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400112 if cmdCount < 1 {
113 fmt.Println("CMD You didn't specify an operation to perform")
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400114 usage()
115 return
116 }
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400117
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400118 var conn *grpc.ClientConn
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400119 var err error
120
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400121 // Setup the login/pass
122 auth := Authentication{
123 Login: "john",
124 Password: "doe",
125 }
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400126 if *useSsl && *useAuth {
127
128 creds, err := credentials.NewClientTLSFromFile(*crtFile, *fqdn)
129 conn, err = grpc.Dial(*serverAddressPort, grpc.WithTransportCredentials(creds), grpc.WithPerRPCCredentials(&auth))
130 if err != nil {
131 log.Fatalf("could not load tls cert: %s", err)
132 }
133 } else if *useSsl {
134 creds, err := credentials.NewClientTLSFromFile("cert/server.crt", *fqdn)
135 conn, err = grpc.Dial(*serverAddressPort, grpc.WithTransportCredentials(creds))
136 if err != nil {
137 log.Fatalf("could not load tls cert: %s", err)
138 }
139 } else if *useAuth {
140 conn, err = grpc.Dial(*serverAddressPort, grpc.WithInsecure(), grpc.WithPerRPCCredentials(&auth))
141 } else {
142 conn, err = grpc.Dial(*serverAddressPort, grpc.WithInsecure())
143 }
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400144 if err != nil {
145 log.Fatalf("did not connect: %s", err)
146 }
147 defer conn.Close()
148
149 c := api.NewAbstractOLTClient(conn)
150 if *create {
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400151 createChassis(c, clli, xosUser, xosPassword, xosAddress, xosPort, rack, shelf)
152 } else if *update {
153 updateXOSUserPassword(c, clli, xosUser, xosPassword)
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400154 } else if *addOlt {
155 addOltChassis(c, clli, oltAddress, oltPort, name, driver, oltType)
156 } else if *provOnt {
157 provisionONT(c, clli, slot, port, ont, serial)
Don Newton281e0252018-10-22 14:38:50 -0400158 } else if *provOntFull {
159 provisionONTFull(c, clli, slot, port, ont, serial, stag, ctag, nasPort, circuitID)
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400160 } else if *echo {
161 ping(c, *message)
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400162 } else if *output {
163 Output(c)
164 } else if *deleteOnt {
165 deleteONT(c, clli, slot, port, ont, serial)
Don Newtone973d342018-10-26 16:44:12 -0400166 } else if *reflow {
167 reflowTosca(c)
donNewtonAlpha27ad20c2018-10-30 16:18:42 -0400168 } else if *fullInventory {
169 getFullInventory(c)
170 } else if *inventory {
171 getInventory(c, clli)
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400172 }
173
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400174}
175
Author Namea594e632018-08-10 11:33:58 -0400176// Authentication holds the login/password
177type Authentication struct {
178 Login string
179 Password string
180}
181
182// GetRequestMetadata gets the current request metadata
183func (a *Authentication) GetRequestMetadata(context.Context, ...string) (map[string]string, error) {
184 return map[string]string{
185 "login": a.Login,
186 "password": a.Password,
187 }, nil
188}
189
190// RequireTransportSecurity indicates whether the credentials requires transport security
191func (a *Authentication) RequireTransportSecurity() bool {
192 return true
193}
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400194func Output(c api.AbstractOLTClient) error {
195 response, err := c.Output(context.Background(), &api.OutputMessage{Something: "wtf"})
196 if err != nil {
197 fmt.Printf("Error when calling Echo: %s", err)
198 return err
199 }
200 log.Printf("Response from server: %v", response.GetSuccess())
201
202 return nil
203}
204
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400205func ping(c api.AbstractOLTClient, message string) error {
206 response, err := c.Echo(context.Background(), &api.EchoMessage{Ping: message})
207 if err != nil {
208 fmt.Printf("Error when calling Echo: %s", err)
209 return err
210 }
211 log.Printf("Response from server: %s", response.GetPong())
212 return nil
213}
Author Namea594e632018-08-10 11:33:58 -0400214
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400215func createChassis(c api.AbstractOLTClient, clli *string, xosUser *string, xosPassword *string, xosAddress *string, xosPort *uint, rack *uint, shelf *uint) error {
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400216 fmt.Println("Calling Create Chassis")
217 fmt.Println("clli", *clli)
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400218 fmt.Println("xos_user", *xosUser)
219 fmt.Println("xos_password", *xosPassword)
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400220 fmt.Println("xos_address", *xosAddress)
221 fmt.Println("xos_port", *xosPort)
222 fmt.Println("rack", *rack)
223 fmt.Println("shelf", *shelf)
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400224 response, err := c.CreateChassis(context.Background(), &api.AddChassisMessage{CLLI: *clli, XOSUser: *xosUser, XOSPassword: *xosPassword,
225 XOSIP: *xosAddress, XOSPort: int32(*xosPort), Rack: int32(*rack), Shelf: int32(*shelf)})
Author Namea594e632018-08-10 11:33:58 -0400226 if err != nil {
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400227 fmt.Printf("Error when calling CreateChassis: %s", err)
228 return err
Author Namea594e632018-08-10 11:33:58 -0400229 }
230 log.Printf("Response from server: %s", response.GetDeviceID())
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400231 return nil
232}
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400233func updateXOSUserPassword(c api.AbstractOLTClient, clli *string, xosUser *string, xosPassword *string) error {
234 fmt.Println("Calling Update XOS USER/PASSWORD")
235 fmt.Println("clli", *clli)
236 fmt.Println("xos_user", *xosUser)
237 fmt.Println("xos_password", *xosPassword)
238 response, err := c.ChangeXOSUserPassword(context.Background(), &api.ChangeXOSUserPasswordMessage{CLLI: *clli, XOSUser: *xosUser, XOSPassword: *xosPassword})
239 if err != nil {
240 fmt.Printf("Error when calling UpdateXOSUserPassword: %s", err)
241 return err
242 }
donNewtonAlphab1466392018-10-02 10:42:05 -0400243 log.Printf("Response from server: %t", response.GetSuccess())
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400244 return nil
245}
246
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400247func addOltChassis(c api.AbstractOLTClient, clli *string, oltAddress *string, oltPort *uint, name *string, driver *string, oltType *string) error {
248 fmt.Println("clli", *clli)
249 fmt.Println("olt_address", *oltAddress)
250 fmt.Println("olt_port", *oltPort)
251 fmt.Println("name", *name)
252 fmt.Println("driver", *driver)
253 fmt.Println("type", *oltType)
254 var driverType api.AddOLTChassisMessage_OltDriver
255 var chassisType api.AddOLTChassisMessage_OltType
256 switch *oltType {
257 case "edgecore":
258 chassisType = api.AddOLTChassisMessage_edgecore
259 }
260 switch *driver {
261 case "openolt":
262 driverType = api.AddOLTChassisMessage_openoltDriver
263
264 }
265
266 res, err := c.CreateOLTChassis(context.Background(), &api.AddOLTChassisMessage{CLLI: *clli, SlotIP: *oltAddress, SlotPort: uint32(*oltPort), Hostname: *name, Type: chassisType, Driver: driverType})
Author Namea594e632018-08-10 11:33:58 -0400267 if err != nil {
268 debug.PrintStack()
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400269 fmt.Printf("Error when calling CreateOLTChassis: %s", err)
270 return err
Author Namea594e632018-08-10 11:33:58 -0400271 }
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400272 log.Printf("Response from server: %s", res.GetDeviceID())
273 return nil
274}
275func provisionONT(c api.AbstractOLTClient, clli *string, slot *uint, port *uint, ont *uint, serial *string) error {
276 fmt.Println("clli", *clli)
277 fmt.Println("slot", *slot)
278 fmt.Println("port", *port)
279 fmt.Println("ont", *ont)
280 fmt.Println("serial", *serial)
281 res, err := c.ProvisionOnt(context.Background(), &api.AddOntMessage{CLLI: *clli, SlotNumber: int32(*slot), PortNumber: int32(*port), OntNumber: int32(*ont), SerialNumber: *serial})
282 if err != nil {
283 debug.PrintStack()
284 fmt.Printf("Error when calling ProvsionOnt %s", err)
285 return err
286 }
287 log.Printf("Response from server: %t", res.GetSuccess())
288 return nil
Don Newton281e0252018-10-22 14:38:50 -0400289}
290func provisionONTFull(c api.AbstractOLTClient, clli *string, slot *uint, port *uint, ont *uint, serial *string, stag *uint, ctag *uint, nasPort *string, circuitID *string) error {
291 fmt.Println("clli", *clli)
292 fmt.Println("slot", *slot)
293 fmt.Println("port", *port)
294 fmt.Println("ont", *ont)
295 fmt.Println("serial", *serial)
296 fmt.Println("stag", *stag)
297 fmt.Println("ctag", *ctag)
298 fmt.Println("nasPort", *nasPort)
299 fmt.Println("circuitID", *circuitID)
300 res, err := c.ProvisionOntFull(context.Background(), &api.AddOntFullMessage{CLLI: *clli, SlotNumber: int32(*slot), PortNumber: int32(*port), OntNumber: int32(*ont), SerialNumber: *serial, STag: uint32(*stag), CTag: uint32(*ctag), NasPortID: *nasPort, CircuitID: *circuitID})
301 if err != nil {
302 debug.PrintStack()
303 fmt.Printf("Error when calling ProvsionOnt %s", err)
304 return err
305 }
306 log.Printf("Response from server: %t", res.GetSuccess())
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400307 return nil
308}
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400309func deleteONT(c api.AbstractOLTClient, clli *string, slot *uint, port *uint, ont *uint, serial *string) error {
310 fmt.Println("clli", *clli)
311 fmt.Println("slot", *slot)
312 fmt.Println("port", *port)
313 fmt.Println("ont", *ont)
314 fmt.Println("serial", *serial)
315 res, err := c.DeleteOnt(context.Background(), &api.DeleteOntMessage{CLLI: *clli, SlotNumber: int32(*slot), PortNumber: int32(*port), OntNumber: int32(*ont), SerialNumber: *serial})
316 if err != nil {
317 debug.PrintStack()
318 fmt.Printf("Error when calling ProvsionOnt %s", err)
319 return err
320 }
321 log.Printf("Response from server: %t", res.GetSuccess())
322 return nil
323}
Don Newtone973d342018-10-26 16:44:12 -0400324func reflowTosca(c api.AbstractOLTClient) error {
325 res, err := c.Reflow(context.Background(), &api.ReflowMessage{})
326 if err != nil {
327 debug.PrintStack()
328 fmt.Printf("Error when calling Reflow %s", err)
329 return err
330 }
331 log.Printf("Response from server: %t", res.GetSuccess())
332 return nil
333}
donNewtonAlpha27ad20c2018-10-30 16:18:42 -0400334func getFullInventory(c api.AbstractOLTClient) error {
335 res, err := c.GetFullInventory(context.Background(), &api.FullInventoryMessage{})
336 if err != nil {
337 debug.PrintStack()
338 fmt.Printf("Error when calling Reflow %s", err)
339 return err
340 }
341 log.Println(res.GetJsonDump())
342 return nil
343}
344func getInventory(c api.AbstractOLTClient, clli *string) error {
345 res, err := c.GetInventory(context.Background(), &api.InventoryMessage{Clli: *clli})
346 if err != nil {
347 debug.PrintStack()
348 fmt.Printf("Error when calling Reflow %s", err)
349 return err
350 }
351 log.Println(res.GetJsonDump())
352 return nil
353}
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400354
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400355func usage() {
356 var output = `
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400357 Usage ./client -server=[serverAddress:port] -[methodFlag] params
358 ./client -ssl -fqdn=FQDN_OF_ABSTRACT_OLT_SERVER.CRT -cert PATH_TO_SERVER.CRT -server=[serverAddress:port] -[methodFlag] params : use ssl
359 ./client -auth -server=[serverAddress:port] -[methodFlag] params : Authenticate session
360
361 methodFlags:
362 -e echo # used to test connectivity to server NOOP
363 params:
364 -message string to be echoed back from the server
365 e.g. ./client -server=localhost:7777 -e -message MESSAGE_TO_BE_ECHOED
Don Newton0766ec22018-11-06 15:18:05 -0500366
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400367 -c create chassis
368 params:
369 -clli CLLI_NAME
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400370 -xos_user XOS_USER
371 -xos_password XOS_PASSWORD
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400372 -xos_address XOS_TOSCA_IP
373 -xos_port XOS_TOSCA_LISTEN_PORT
374 -rack [optional default 1]
375 -shelf [optional default 1]
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400376 e.g. ./client -server=localhost:7777 -c -clli MY_CLLI -xos_user foundry -xos_password password -xos_address 192.168.0.1 -xos_port 30007 -rack 1 -shelf 1
Don Newton0766ec22018-11-06 15:18:05 -0500377
donNewtonAlpha57aa2ff2018-10-01 16:45:32 -0400378 -u update xos user/password
379 -clli CLLI_NAME
380 -xos_user XOS_USER
381 -xos_password XOS_PASSWORD
382 e.g. ./client -server=localhost:7777 -u -clli MY_CLLI -xos_user NEW_USER -xos_password NEW_PASSWORD
Don Newton0766ec22018-11-06 15:18:05 -0500383
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400384 -s add physical olt chassis to chassis
385 params:
386 -clli CLLI_NAME - identifies abstract chassis to assign olt chassis to
387 -olt_address - OLT_CHASSIS_IP_ADDRESS
388 -olt_port - OLT_CHASSIS_LISTEN_PORT
389 -name - OLT_NAME internal human readable name to identify OLT_CHASSIS
390 -driver [openolt,asfvolt16,adtran,tibits] - used to tell XOS which driver should be used to manange chassis
391 -type [edgecore,adtran,tibit] - used to tell AbstractOLT how many ports are available on olt chassis
donNewtonAlphab3279ea2018-09-18 15:55:32 -0400392 e.g. ./client -server abstractOltHost:7777 -s -clli MY_CLLI -olt_address 192.168.1.100 -olt_port=9191 -name=slot1 -driver=openolt -type=adtran
Don Newton0766ec22018-11-06 15:18:05 -0500393
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400394 -o provision ont - adds ont to whitelist in XOS on a specific port on a specific olt chassis based on abstract -> phyisical mapping
395 params:
396 -clli CLLI_NAME
397 -slot SLOT_NUMBER [1-16]
398 -port OLT_PORT_NUMBER [1-16]
399 -ont ONT_NUMBER [1-64]
400 -serial ONT_SERIAL_NUM
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400401 e.g. ./client -server=localhost:7777 -o -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf
Don Newton0766ec22018-11-06 15:18:05 -0500402
Don Newton281e0252018-10-22 14:38:50 -0400403 -f provision ont full - same as -o above but allows explicit set of s/c vlans , NasPortID and CircuitID
404 params:
405 -clli CLLI_NAME
406 -slot SLOT_NUMBER [1-16]
407 -port OLT_PORT_NUMBER [1-16]
408 -ont ONT_NUMBER [1-64]
409 -serial ONT_SERIAL_NUM
410 -stag S_TAG
411 -ctag C_TAG
412 -nas_port NAS_PORT_ID
413 -circuit_id CIRCUIT_ID
414 e.g. ./client -server=localhost:7777 -f -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf -stag=33 -ctag=104 -nas_port="pon 1/1/1/3:1.1" -circuit_id="CLLI 1/1/1/13:1.1"
Don Newton0766ec22018-11-06 15:18:05 -0500415
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400416 -d delete ont - removes ont from service
417 params:
418 -clli CLLI_NAME
419 -slot SLOT_NUMBER [1-16]
420 -port OLT_PORT_NUMBER [1-16]
421 -ont ONT_NUMBER [1-64]
422 -serial ONT_SERIAL_NUM
423 e.g. ./client -server=localhost:7777 -d -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf
Don Newton0766ec22018-11-06 15:18:05 -0500424
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400425 -output (TEMPORARY) causes AbstractOLT to serialize all chassis to JSON file in $WorkingDirectory/backups
426 e.g. ./client -server=localhost:7777 -output
Don Newton0766ec22018-11-06 15:18:05 -0500427
Don Newtone973d342018-10-26 16:44:12 -0400428 -reflow causes tosca to be repushed to xos
429 e.g. ./client -server=localhost:7777 -reflow
Don Newton0766ec22018-11-06 15:18:05 -0500430
431 -inventory - returns a json document that describes currently provisioned equipment for a specific clli
432 params:
433 -clli CLLI_NAME
434 e.g. ./client -inventory -clli=ATLEDGEVOLT1
435
436 -full_inventory - returns a json document that describes all currently provisioned pods
437 e.g. ./client -full_inventory
438
donNewtonAlphae7ab5b92018-09-27 15:09:14 -0400439 `
donNewtonAlpha1d2d6812018-09-14 16:00:02 -0400440
441 fmt.Println(output)
Author Namea594e632018-08-10 11:33:58 -0400442}