Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package main |
| 18 | |
| 19 | import ( |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 20 | "context" |
| 21 | "flag" |
| 22 | "fmt" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 23 | "log" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 24 | "runtime/debug" |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 25 | "strings" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 26 | |
| 27 | "gerrit.opencord.org/abstract-olt/api" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 28 | "google.golang.org/grpc" |
| 29 | "google.golang.org/grpc/credentials" |
| 30 | ) |
| 31 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 32 | func main() { |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 33 | /* COMMAND FLAGS */ |
| 34 | output := flag.Bool("output", false, "dump output") |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 35 | echo := flag.Bool("e", false, "echo") |
| 36 | message := flag.String("message", "ping", "message to be echoed back") |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 37 | create := flag.Bool("c", false, "create?") |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 38 | update := flag.Bool("u", false, "update?") |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 39 | addOlt := flag.Bool("s", false, "addOlt?") |
| 40 | provOnt := flag.Bool("o", false, "provisionOnt?") |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 41 | deleteOnt := flag.Bool("d", false, "deleteOnt") |
| 42 | /* END COMMAND FLAGS */ |
| 43 | |
| 44 | /* CREATE CHASSIS FLAGS */ |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 45 | xosUser := flag.String("xos_user", "", "xos_user") |
| 46 | xosPassword := flag.String("xos_password", "", "xos_password") |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 47 | xosAddress := flag.String("xos_address", "", "xos address") |
| 48 | xosPort := flag.Uint("xos_port", 0, "xos port") |
| 49 | rack := flag.Uint("rack", 1, "rack number for chassis") |
| 50 | shelf := flag.Uint("shelf", 1, "shelf number for chassis") |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 51 | /* END CREATE CHASSIS FLAGS */ |
| 52 | |
| 53 | /* ADD OLT FLAGS */ |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 54 | oltAddress := flag.String("olt_address", "", "ip address for olt chassis") |
| 55 | oltPort := flag.Uint("olt_port", 0, "listen port for olt chassis") |
| 56 | name := flag.String("name", "", "friendly name for olt chassis") |
| 57 | driver := flag.String("driver", "", "driver to use with olt chassis") |
| 58 | oltType := flag.String("type", "", "olt chassis type") |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 59 | /* END ADD OLT FLAGS */ |
| 60 | |
| 61 | /* PROVISION / DELETE ONT FLAGS */ |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 62 | slot := flag.Uint("slot", 1, "slot number 1-16 to provision ont to") |
| 63 | port := flag.Uint("port", 1, "port number 1-16 to provision ont to") |
| 64 | ont := flag.Uint("ont", 1, "ont number 1-64") |
| 65 | serial := flag.String("serial", "", "serial number of ont") |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 66 | /* END PROVISION / DELETE ONT FLAGS */ |
| 67 | |
| 68 | /*GENERIC FLAGS */ |
| 69 | clli := flag.String("clli", "", "clli of abstract chassis") |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 70 | useSsl := flag.Bool("ssl", false, "use ssl") |
| 71 | useAuth := flag.Bool("auth", false, "use auth") |
| 72 | crtFile := flag.String("cert", "cert/server.crt", "Public cert for server to establish tls session") |
| 73 | serverAddressPort := flag.String("server", "localhost:7777", "address and port of AbstractOLT server") |
| 74 | fqdn := flag.String("fqdn", "", "FQDN of the service to match what is in server.crt") |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 75 | /*GENERIC FLAGS */ |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 76 | |
| 77 | flag.Parse() |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 78 | |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 79 | if *useSsl { |
| 80 | if *fqdn == "" { |
| 81 | fqdn = &(strings.Split(*serverAddressPort, ":")[0]) |
| 82 | fmt.Printf("using %s as the FQDN for the AbstractOLT server", *fqdn) |
| 83 | } |
| 84 | } |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 85 | |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 86 | cmdFlags := []*bool{echo, addOlt, update, create, provOnt, deleteOnt, output} |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 87 | cmdCount := 0 |
| 88 | for _, flag := range cmdFlags { |
| 89 | if *flag { |
| 90 | cmdCount++ |
| 91 | } |
| 92 | } |
| 93 | if cmdCount > 1 { |
| 94 | fmt.Println("CMD You can only call one method at a time") |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 95 | usage() |
| 96 | return |
| 97 | } |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 98 | if cmdCount < 1 { |
| 99 | fmt.Println("CMD You didn't specify an operation to perform") |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 100 | usage() |
| 101 | return |
| 102 | } |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 103 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 104 | var conn *grpc.ClientConn |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 105 | var err error |
| 106 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 107 | // Setup the login/pass |
| 108 | auth := Authentication{ |
| 109 | Login: "john", |
| 110 | Password: "doe", |
| 111 | } |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 112 | if *useSsl && *useAuth { |
| 113 | |
| 114 | creds, err := credentials.NewClientTLSFromFile(*crtFile, *fqdn) |
| 115 | conn, err = grpc.Dial(*serverAddressPort, grpc.WithTransportCredentials(creds), grpc.WithPerRPCCredentials(&auth)) |
| 116 | if err != nil { |
| 117 | log.Fatalf("could not load tls cert: %s", err) |
| 118 | } |
| 119 | } else if *useSsl { |
| 120 | creds, err := credentials.NewClientTLSFromFile("cert/server.crt", *fqdn) |
| 121 | conn, err = grpc.Dial(*serverAddressPort, grpc.WithTransportCredentials(creds)) |
| 122 | if err != nil { |
| 123 | log.Fatalf("could not load tls cert: %s", err) |
| 124 | } |
| 125 | } else if *useAuth { |
| 126 | conn, err = grpc.Dial(*serverAddressPort, grpc.WithInsecure(), grpc.WithPerRPCCredentials(&auth)) |
| 127 | } else { |
| 128 | conn, err = grpc.Dial(*serverAddressPort, grpc.WithInsecure()) |
| 129 | } |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 130 | if err != nil { |
| 131 | log.Fatalf("did not connect: %s", err) |
| 132 | } |
| 133 | defer conn.Close() |
| 134 | |
| 135 | c := api.NewAbstractOLTClient(conn) |
| 136 | if *create { |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 137 | createChassis(c, clli, xosUser, xosPassword, xosAddress, xosPort, rack, shelf) |
| 138 | } else if *update { |
| 139 | updateXOSUserPassword(c, clli, xosUser, xosPassword) |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 140 | } else if *addOlt { |
| 141 | addOltChassis(c, clli, oltAddress, oltPort, name, driver, oltType) |
| 142 | } else if *provOnt { |
| 143 | provisionONT(c, clli, slot, port, ont, serial) |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 144 | } else if *echo { |
| 145 | ping(c, *message) |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 146 | } else if *output { |
| 147 | Output(c) |
| 148 | } else if *deleteOnt { |
| 149 | deleteONT(c, clli, slot, port, ont, serial) |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 150 | } |
| 151 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 152 | } |
| 153 | |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 154 | // Authentication holds the login/password |
| 155 | type Authentication struct { |
| 156 | Login string |
| 157 | Password string |
| 158 | } |
| 159 | |
| 160 | // GetRequestMetadata gets the current request metadata |
| 161 | func (a *Authentication) GetRequestMetadata(context.Context, ...string) (map[string]string, error) { |
| 162 | return map[string]string{ |
| 163 | "login": a.Login, |
| 164 | "password": a.Password, |
| 165 | }, nil |
| 166 | } |
| 167 | |
| 168 | // RequireTransportSecurity indicates whether the credentials requires transport security |
| 169 | func (a *Authentication) RequireTransportSecurity() bool { |
| 170 | return true |
| 171 | } |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 172 | func Output(c api.AbstractOLTClient) error { |
| 173 | response, err := c.Output(context.Background(), &api.OutputMessage{Something: "wtf"}) |
| 174 | if err != nil { |
| 175 | fmt.Printf("Error when calling Echo: %s", err) |
| 176 | return err |
| 177 | } |
| 178 | log.Printf("Response from server: %v", response.GetSuccess()) |
| 179 | |
| 180 | return nil |
| 181 | } |
| 182 | |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 183 | func ping(c api.AbstractOLTClient, message string) error { |
| 184 | response, err := c.Echo(context.Background(), &api.EchoMessage{Ping: message}) |
| 185 | if err != nil { |
| 186 | fmt.Printf("Error when calling Echo: %s", err) |
| 187 | return err |
| 188 | } |
| 189 | log.Printf("Response from server: %s", response.GetPong()) |
| 190 | return nil |
| 191 | } |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 192 | |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 193 | func createChassis(c api.AbstractOLTClient, clli *string, xosUser *string, xosPassword *string, xosAddress *string, xosPort *uint, rack *uint, shelf *uint) error { |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 194 | fmt.Println("Calling Create Chassis") |
| 195 | fmt.Println("clli", *clli) |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 196 | fmt.Println("xos_user", *xosUser) |
| 197 | fmt.Println("xos_password", *xosPassword) |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 198 | fmt.Println("xos_address", *xosAddress) |
| 199 | fmt.Println("xos_port", *xosPort) |
| 200 | fmt.Println("rack", *rack) |
| 201 | fmt.Println("shelf", *shelf) |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 202 | response, err := c.CreateChassis(context.Background(), &api.AddChassisMessage{CLLI: *clli, XOSUser: *xosUser, XOSPassword: *xosPassword, |
| 203 | XOSIP: *xosAddress, XOSPort: int32(*xosPort), Rack: int32(*rack), Shelf: int32(*shelf)}) |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 204 | if err != nil { |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 205 | fmt.Printf("Error when calling CreateChassis: %s", err) |
| 206 | return err |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 207 | } |
| 208 | log.Printf("Response from server: %s", response.GetDeviceID()) |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 209 | return nil |
| 210 | } |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 211 | func updateXOSUserPassword(c api.AbstractOLTClient, clli *string, xosUser *string, xosPassword *string) error { |
| 212 | fmt.Println("Calling Update XOS USER/PASSWORD") |
| 213 | fmt.Println("clli", *clli) |
| 214 | fmt.Println("xos_user", *xosUser) |
| 215 | fmt.Println("xos_password", *xosPassword) |
| 216 | response, err := c.ChangeXOSUserPassword(context.Background(), &api.ChangeXOSUserPasswordMessage{CLLI: *clli, XOSUser: *xosUser, XOSPassword: *xosPassword}) |
| 217 | if err != nil { |
| 218 | fmt.Printf("Error when calling UpdateXOSUserPassword: %s", err) |
| 219 | return err |
| 220 | } |
donNewtonAlpha | b146639 | 2018-10-02 10:42:05 -0400 | [diff] [blame] | 221 | log.Printf("Response from server: %t", response.GetSuccess()) |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 222 | return nil |
| 223 | } |
| 224 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 225 | func addOltChassis(c api.AbstractOLTClient, clli *string, oltAddress *string, oltPort *uint, name *string, driver *string, oltType *string) error { |
| 226 | fmt.Println("clli", *clli) |
| 227 | fmt.Println("olt_address", *oltAddress) |
| 228 | fmt.Println("olt_port", *oltPort) |
| 229 | fmt.Println("name", *name) |
| 230 | fmt.Println("driver", *driver) |
| 231 | fmt.Println("type", *oltType) |
| 232 | var driverType api.AddOLTChassisMessage_OltDriver |
| 233 | var chassisType api.AddOLTChassisMessage_OltType |
| 234 | switch *oltType { |
| 235 | case "edgecore": |
| 236 | chassisType = api.AddOLTChassisMessage_edgecore |
| 237 | } |
| 238 | switch *driver { |
| 239 | case "openolt": |
| 240 | driverType = api.AddOLTChassisMessage_openoltDriver |
| 241 | |
| 242 | } |
| 243 | |
| 244 | res, err := c.CreateOLTChassis(context.Background(), &api.AddOLTChassisMessage{CLLI: *clli, SlotIP: *oltAddress, SlotPort: uint32(*oltPort), Hostname: *name, Type: chassisType, Driver: driverType}) |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 245 | if err != nil { |
| 246 | debug.PrintStack() |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 247 | fmt.Printf("Error when calling CreateOLTChassis: %s", err) |
| 248 | return err |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 249 | } |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 250 | log.Printf("Response from server: %s", res.GetDeviceID()) |
| 251 | return nil |
| 252 | } |
| 253 | func provisionONT(c api.AbstractOLTClient, clli *string, slot *uint, port *uint, ont *uint, serial *string) error { |
| 254 | fmt.Println("clli", *clli) |
| 255 | fmt.Println("slot", *slot) |
| 256 | fmt.Println("port", *port) |
| 257 | fmt.Println("ont", *ont) |
| 258 | fmt.Println("serial", *serial) |
| 259 | res, err := c.ProvisionOnt(context.Background(), &api.AddOntMessage{CLLI: *clli, SlotNumber: int32(*slot), PortNumber: int32(*port), OntNumber: int32(*ont), SerialNumber: *serial}) |
| 260 | if err != nil { |
| 261 | debug.PrintStack() |
| 262 | fmt.Printf("Error when calling ProvsionOnt %s", err) |
| 263 | return err |
| 264 | } |
| 265 | log.Printf("Response from server: %t", res.GetSuccess()) |
| 266 | return nil |
| 267 | |
| 268 | return nil |
| 269 | } |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 270 | func deleteONT(c api.AbstractOLTClient, clli *string, slot *uint, port *uint, ont *uint, serial *string) error { |
| 271 | fmt.Println("clli", *clli) |
| 272 | fmt.Println("slot", *slot) |
| 273 | fmt.Println("port", *port) |
| 274 | fmt.Println("ont", *ont) |
| 275 | fmt.Println("serial", *serial) |
| 276 | res, err := c.DeleteOnt(context.Background(), &api.DeleteOntMessage{CLLI: *clli, SlotNumber: int32(*slot), PortNumber: int32(*port), OntNumber: int32(*ont), SerialNumber: *serial}) |
| 277 | if err != nil { |
| 278 | debug.PrintStack() |
| 279 | fmt.Printf("Error when calling ProvsionOnt %s", err) |
| 280 | return err |
| 281 | } |
| 282 | log.Printf("Response from server: %t", res.GetSuccess()) |
| 283 | return nil |
| 284 | } |
| 285 | |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 286 | func usage() { |
| 287 | var output = ` |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 288 | Usage ./client -server=[serverAddress:port] -[methodFlag] params |
| 289 | ./client -ssl -fqdn=FQDN_OF_ABSTRACT_OLT_SERVER.CRT -cert PATH_TO_SERVER.CRT -server=[serverAddress:port] -[methodFlag] params : use ssl |
| 290 | ./client -auth -server=[serverAddress:port] -[methodFlag] params : Authenticate session |
| 291 | |
| 292 | methodFlags: |
| 293 | -e echo # used to test connectivity to server NOOP |
| 294 | params: |
| 295 | -message string to be echoed back from the server |
| 296 | e.g. ./client -server=localhost:7777 -e -message MESSAGE_TO_BE_ECHOED |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 297 | -c create chassis |
| 298 | params: |
| 299 | -clli CLLI_NAME |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 300 | -xos_user XOS_USER |
| 301 | -xos_password XOS_PASSWORD |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 302 | -xos_address XOS_TOSCA_IP |
| 303 | -xos_port XOS_TOSCA_LISTEN_PORT |
| 304 | -rack [optional default 1] |
| 305 | -shelf [optional default 1] |
donNewtonAlpha | 57aa2ff | 2018-10-01 16:45:32 -0400 | [diff] [blame] | 306 | 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 |
| 307 | -u update xos user/password |
| 308 | -clli CLLI_NAME |
| 309 | -xos_user XOS_USER |
| 310 | -xos_password XOS_PASSWORD |
| 311 | e.g. ./client -server=localhost:7777 -u -clli MY_CLLI -xos_user NEW_USER -xos_password NEW_PASSWORD |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 312 | -s add physical olt chassis to chassis |
| 313 | params: |
| 314 | -clli CLLI_NAME - identifies abstract chassis to assign olt chassis to |
| 315 | -olt_address - OLT_CHASSIS_IP_ADDRESS |
| 316 | -olt_port - OLT_CHASSIS_LISTEN_PORT |
| 317 | -name - OLT_NAME internal human readable name to identify OLT_CHASSIS |
| 318 | -driver [openolt,asfvolt16,adtran,tibits] - used to tell XOS which driver should be used to manange chassis |
| 319 | -type [edgecore,adtran,tibit] - used to tell AbstractOLT how many ports are available on olt chassis |
donNewtonAlpha | b3279ea | 2018-09-18 15:55:32 -0400 | [diff] [blame] | 320 | 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 |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 321 | -o provision ont - adds ont to whitelist in XOS on a specific port on a specific olt chassis based on abstract -> phyisical mapping |
| 322 | params: |
| 323 | -clli CLLI_NAME |
| 324 | -slot SLOT_NUMBER [1-16] |
| 325 | -port OLT_PORT_NUMBER [1-16] |
| 326 | -ont ONT_NUMBER [1-64] |
| 327 | -serial ONT_SERIAL_NUM |
donNewtonAlpha | e7ab5b9 | 2018-09-27 15:09:14 -0400 | [diff] [blame] | 328 | e.g. ./client -server=localhost:7777 -o -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf |
| 329 | -d delete ont - removes ont from service |
| 330 | params: |
| 331 | -clli CLLI_NAME |
| 332 | -slot SLOT_NUMBER [1-16] |
| 333 | -port OLT_PORT_NUMBER [1-16] |
| 334 | -ont ONT_NUMBER [1-64] |
| 335 | -serial ONT_SERIAL_NUM |
| 336 | e.g. ./client -server=localhost:7777 -d -clli=MY_CLLI -slot=1 -port=1 -ont=22 -serial=aer900jasdf |
| 337 | -output (TEMPORARY) causes AbstractOLT to serialize all chassis to JSON file in $WorkingDirectory/backups |
| 338 | e.g. ./client -server=localhost:7777 -output |
| 339 | ` |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 340 | |
| 341 | fmt.Println(output) |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 342 | } |