-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce OpenAPI based Org VDC network management functions for NSX-V and NSX-T #354
Conversation
… -> nsxtImportSegment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just a few nits :)
govcd/openapi_org_network.go
Outdated
} | ||
|
||
if len(allEdges) < 1 { | ||
return nil, fmt.Errorf("%s: got 0 Org Vdc network by name '%s'", ErrorEntityNotFound, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, fmt.Errorf("%s: got 0 Org Vdc network by name '%s'", ErrorEntityNotFound, name) | |
return nil, fmt.Errorf("%s: got zero Org Vdc networks by name '%s'", ErrorEntityNotFound, name) |
govcd/openapi_org_network.go
Outdated
case "": | ||
queryParameters.Set("pageSize", "32") | ||
|
||
// If pageSize is specified ensure it is not >32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems misplaced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in correct place. I might need to improve the comment then. The point is that above case ""
sets pageSize to 32 if none was specified.
The default
case will check what value was provided and if it is >32
it will set it to 32
. This is needed because this particular endpoint throws an ugly error if pageSize>32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so then the indentation is too big, as it should be inline with default:
as right now it looks as if the comment belongs to the case "":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR introduces:
OpenApiOrgVdcNetwork
structure and type meant to handle Org VDC networks for both NSX-T and NSX-V backed.NsxtImportableSwitch
meant for lookup "importable switches" (NSX-T segments) to be used for NSX-T Imported networks. MethodsGetNsxtImportableSwitchByName
andGetAllNsxtImportableSwitches
aid thatvdc.IsNsxt
andvdc.IsNsxv
help to verify which type of network provider this VDC is backed.Additionally it ads:
TestVCD
struct for testingedgeGateway
(to use existing edge gateway) andunusedSegment
which is needed to test our Imported NSX-T Org VDC network