Use Detail rather than list to get JWT, otherwise paging causes failures. Fixes
@@ -95,20 +95,11 @@ func runCreateEdgeRouter(o *createEdgeRouterOptions) error {
}
func getEdgeRouterJwt(o *createEdgeRouterOptions, id string) error {
- list, _, err := listEntitiesOfType("edge-routers", nil, o.OutputJSONResponse, o.Out)
+ newRouter, err := DetailEntityOfType("edge-routers", id, o.OutputJSONResponse, o.Out)
if err != nil {
return err
}
- var newRouter *gabs.Container
- for _, gw := range list {
- gwId := gw.Path("id").Data().(string)
- if gwId == id {
- newRouter = gw
- break
- }
- }
-
if newRouter == nil {
return fmt.Errorf("no error during edge router creation, but edge router with id %v not found... unable to extract JWT", id)
}
