-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add VDC Template support #686
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
3 tasks
adambarreiro
requested review from
lvirbalas,
Didainius and
dataclouder
as code owners
June 13, 2024 13:41
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
adambarreiro
commented
Jun 13, 2024
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
dataclouder
reviewed
Jun 14, 2024
Signed-off-by: abarreiro <abarreiro@vmware.com>
adambarreiro
force-pushed
the
add-vdc-template
branch
from
June 17, 2024 09:03
47f402a
to
a86673d
Compare
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
lvirbalas
approved these changes
Jun 18, 2024
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.
Couple inline comments and looks good!
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
dataclouder
approved these changes
Jun 19, 2024
Didainius
approved these changes
Jun 19, 2024
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 tests passed.
Signed-off-by: abarreiro <abarreiro@vmware.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds support for VDC Templates with CRUD methods, Access level methods and an instantiation method.
Description
A VDC Template is a System administrator feature that can make VDC creation easier, by defining how the VDCs should look like in terms of configuration. The templates can then be published to tenants, or remain in the System administrator realm if not published. The published tenants can then be instantiated by either Organizations (inside of it, in Libraries) or in the System org.
Methods
The new file
vcd_template.go
contains several new methods:VCDClient.CreateVdcTemplate
,VdcTemplate.Update
,VCDClient.GetVdcTemplateById
,VCDClient.GetVdcTemplateByName
,VdcTemplate.Delete
VdcTemplate.SetAccessControl
,VdcTemplate.GetAccessControl
VdcTemplate.InstantiateVdc
VDCClient.QueryAdminVdcTemplates
,Org.QueryVdcTemplates
Binding IDs
There's this odd concept from
VMWVdcTemplate.[]ProviderVdcReference.[]Binding
that is worth mentioning, specially when the new methods are consumed from the Terraform ProviderA Binding looks like:
To understand it easily, a
Binding.Name
represents a "field" (or an "option") in the Provider VDC configuration of the VDC Template, for example "External network", "Gateway Edge cluster" or "Service Edge cluster". In UI, these options are visible drop-down menus for the users to select. Then, theBinding.Value
represents the value of that field. In UI, this would be the selected value.The
Binding.Name
must be generated on our own, and looks likeurn:vcloud:binding:....
.With this information, we can understand that, given many Provider VDCs in the VDC Template, each one of them share the same
Binding.Name
(the same sections, eg: "External network"), but differ in values.Summary:
Binding.Name
is an self-generated UUID that replaces a human readable field (eg: "External network") with a generic URN (urn:vcloud:binding:....
).Binding.Value
is the value for that field/option.Quirks
The XML flavor of the
/admin/extension/vdcTemplate
doesn't work, as it fails to marshal theVMWVdcTemplate
structure, hence JSON is used. For that reason, all relevant types and fields now have a mapping to JSON.