forked from vmware/go-vcloud-director
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fork sync #1
Merged
Merged
Fork sync #1
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
Replace two packages that were retrieved through gopkg.in to be fetched instead from their corresponding GitHub repositories.
* Add description argument to vdc.ComposeRawVApp * Add methods to change vApp name and description * Add ability to remove a vApp description * Update description of empty test vApp Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
…mware#371) * Dropped support for VCD 9.7 which is EOL now [vmware#371](vmware#371) * Bumped Default API Version to V33.0 [vmware#371](vmware#371) * Methods `GetVDCById` and `GetVDCByName` for `Org` now use queries behind the scenes because Org structure does not list child VDCs anymore [vmware#371](vmware#371) * Methods `GetCatalogById` and `GetCatalogByName` for `Org` now use queries behind the scenes because Org structure does not list child Catalogs anymore [vmware#371](vmware#371) * Drop legacy authentication mechanism (vcdAuthorize) and use only new Cloud API provided (vcdCloudApiAuthorize) as API V33.0 is sufficient for it [vmware#371](vmware#371) * Field `types.Disk.Size` is replaced with `types.Disk.SizeMb` as size in Kilobytes is not supported in V33.0 [vmware#371](vmware#371) * Field `types.DiskRecordType.SizeB` is replaced with `types.DiskRecordType.SizeMb` as size in Kilobytes is not supported in V33.0 [vmware#371](vmware#371)
* Do not send xml.Header when body is nil (some WAFs block such requests)
…e#368) This PR adds NSX-T Firewall Group support (this endpoint supports setting both - Security Groups and IP Sets). It does so by introducing the following new types: NsxtFirewallGroup NsxtFirewallGroupMemberVms And such methods for managing them: Vdc.CreateNsxtFirewallGroup, NsxtEdgeGateway.CreateNsxtFirewallGroup Org.GetAllNsxtFirewallGroups Vdc.GetAllNsxtFirewallGroups Org.GetNsxtFirewallGroupByName, Vdc.GetNsxtFirewallGroupByName NsxtEdgeGateway.GetNsxtFirewallGroupByName, Org.GetNsxtFirewallGroupById Vdc.GetNsxtFirewallGroupById, NsxtEdgeGateway.GetNsxtFirewallGroupById NsxtFirewallGroup.Update, NsxtFirewallGroup.Delete NsxtFirewallGroup.GetAssociatedVms, NsxtFirewallGroup.IsSecurityGroup NsxtFirewallGroup.IsIpSet Additionally it adds the following new methods to improve test cleanup framework (add support for VM cleanup when they are spread in multiple VDCs) Org.QueryVmList and Org.QueryVmById to find VM by ID in an Org IMPROVEMENTS: Improved test entity cleanup to find standalone VMs in any VDC (not only default NSX-V one) Improved test entity cleanup to allow specifying parent VDC for vApp removals
After API V33.0 bump (vmware#371) GetCatalogById, GetCatalogByName, GetVDCById, GetVDCByName started using queries behind the scenes. Apparently query filters do not accept org filter when being used by Org user. (it does work and is useful with System user). This PR adjusts filtering to avoid sending org filter when used by Org user.
This PR adds types `NsxtAppPortProfile` and `types.NsxtAppPortProfile` together with `org.CreateNsxtAppPortProfile`, `org.GetAllNsxtAppPortProfiles`, `org.GetNsxtAppPortProfileByName`, `NsxtAppPortProfile.Update`, `NsxtAppPortProfile.Delete` and adds tests on top of it. NsxtAppPortProfile uses OpenAPI endpoint to operate NSX-T Application Port Profiles It can have 3 types of scopes: * SYSTEM - Read-only (The ones that are provided by SYSTEM). Constant `types.ApplicationPortProfileScopeSystem` * PROVIDER - Created by Provider on a particular network provider (NSX-T manager). Constant `types.ApplicationPortProfileScopeProvider` * TENANT (Created by Tenant at Org VDC level). Constant `types.ApplicationPortProfileScopeTenant` Additionally: * Add a workaround to `OpenApiGetAllItems` internal function `openApiGetAllPages` to work around a VCD bug where some endpoints do not return `nextPage` header to follow and show `pageCount` as 0 while there are multiple pages available. * Fix LDAP related tests to map correct port in latest versions of LDAP container * Add optional test config variable `Misc.LdapContainer` to override default docker container location. (can be used to overcome throttling issues) * Prevent nil pointer dereference errors in some tests when vApp is not available * Test_GetDiskByHref supplied fake UUID of invalid length. Some API versions fail to validate it. Adjusted to include fake ID of a valid length * Test_VdcUpdateStorageProfile used pvdcStorageProfile name in VDC storage profile. This is not always correct and was adjusted to map correctly. * Adds two new `types.VAppStatuses` - `PARTIALLY_POWERED_OFF` and `PARTIALLY_SUSPENDED`
* Add support for Rights, Roles, Global Roles, and Rights Bundles * Add OpenAPI endpoints for roles/rights management * Add tenants management for provider containers * Add tenant context functions to several resources * Add functions get(Admin)OrgByHref * Update CODING_GUIDELINES.md * Update CHANGELOG.md Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
This PR adds support for NSX-T Firewall by adding new functions and types: `NsxtEdgeGateway.UpdateNsxtFirewall()`, `NsxtEdgeGateway.GetNsxtFirewall()`, `nsxtFirewall.DeleteAllRules()`, `nsxtFirewall.DeleteRuleById`, `types.NsxtFirewallRule`, `types.NsxtFirewallRuleContainer` It also fixes a few errors found by new staticheck: ``` ## staticcheck 2021.1 (v0.2.0) ## Checking govcd api.go:285:61: the argument's underlying type is a slice of bytes, should use a simple conversion instead of fmt.Sprintf (S1025) api_vcd_test.go:762:3: this value of err is never used (SA4006) entity_test.go:145:13: type assertion to the same type: ge already has type genericEntity (S1040) entity_test.go:165:13: type assertion to the same type: ge already has type genericEntity (S1040) entity_test.go:178:13: type assertion to the same type: ge already has type genericEntity (S1040) entity_test.go:192:13: type assertion to the same type: ge already has type genericEntity (S1040) filter_engine.go:253:25: type assertion to the same type: candidate already has type QueryItem (S1040) filter_engine.go:284:27: type assertion to the same type: candidate already has type QueryItem (S1040) ```
Implements NSX-T NAT rule support by adding `NsxtNatRule` and `types.NsxtNatRule` as well as methods `edge.GetAllNsxtNatRules`,`edge.GetNsxtNatRuleByName`, `edge.GetNsxtNatRuleById`, `edge.CreateNatRule`, `nsxtNatRule.Update`, `nsxtNatRule.Delete`, `nsxtNatRule.IsEqualTo` A few caveats: * API does not return ID of created object therefore it must be manually looked up by comparing as much fields as it is possible. To aid this `nsxtNatRule.IsEqualTo` is introduced to perform additional validations. `edge.CreateNatRule` also has non-standard task tracking and then uses `nsxtNatRule.IsEqualTo` internally to find ID of newly created rule. * There are two new fields introduced in API V35.2+ (VCD 10.2.2+) - `FirewalMatch` and `Priority`. In order to support these fields all methods above will elevevate API version to exactly V35.2 (not higher) so that those fields can be used. There is a specific check `Test_NsxtNatDnatFirewallMatchPriority` to test exactly that * New NAT rule type `REFLEXIVE` is supported in API V36.0. It also requires rule type to be specified in `Type` field instead of `RuleType` * There is one field which was deprecated `InternalPort` and was changed to `DnatExternalPort` between existing versions. Because these functions automatically elevate API - one must know which field to use. Tests `Test_NsxtNatDnatInternalPort` and `Test_NsxtNatDnatExternalPort` test out this functionality. Additionally: * Functions `queryOrgVdcByName`, `queryOrgVdcById`, `queryCatalogByName` and `queryCatalogById` are improved to include `orgName` as filter (improves filtering accuracy in cases when `org` ID field is not accepted) Note. Tests pass with `nsxt` tag on all NSX-T supported environments.
The following methods are created: * `NsxtEdgeGateway.GetAllIpSecVpnTunnels` * `NsxtEdgeGateway.GetIpSecVpnTunnelById` * `NsxtEdgeGateway.GetIpSecVpnTunnelByName` * `NsxtEdgeGateway.CreateIpSecVpnTunnel` * `NsxtIpSecVpnTunnel.Update` * `NsxtIpSecVpnTunnel.Delete` * `NsxtIpSecVpnTunnel.GetStatus` * `NsxtIpSecVpnTunnel.UpdateTunnelConnectionProperties` * `NsxtIpSecVpnTunnel.GetTunnelConnectionProperties` * `NsxtIpSecVpnTunnel.IsEqualTo` As well as more new types: * `types.NsxtIpSecVpnTunnel` * `types.NsxtIpSecVpnTunnelStatus` * `types.NsxtIpSecVpnTunnelSecurityProfile`
* Add method vdc.CreateRawVApp * Deprecate vdc.ComposeRawVApp * Deprecate vdc.ComposeVApp * Update CHANGELOG.md Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Set release date for 2.12
…ById` (vmware#389) * go-vcloud-director does not find catalogs shared from other Orgs in methods org.GetCatalogByName and org.GetCatalogById This addon fixes that, adds some tests including a test with uses Org Admin user and adds a changelog note for 2.12.1 bugfix release.
* Fix Issue vmware#390: catalog.Delete() ignores task Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
* Allow staticcheck to run in GitHub Actions * Add .changes section to avoid CHANGELOG confilcts * Add current release note to CHANGELOG.md * Add links replacement script * Add documentation for .changes Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
* Add structure needed to update storage profiles * Add methods to add/remove VDC storage profiles * Replace methods used to search storage profiles * Deprecate vdc.GetDefaultStorageProfileReference * Add tests for storage profile handling * Add CHANGELOG items Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Go 1.17 introduced changes to how build tags are defined. gofmt automatically fixes that and this PR is just to make sure we are 1.17 compatible so that make build works.
Add OwnerRef field to types.OpenAPIEdgeGateway
Add support for Provider part of NSX-T ALB configuration functions. These are required to configure VCD for usage of AVI load balancer (NSX-T ALB) Functionality includes 5 entities in total. 3 of them have CRUD functionality (some still do not support Update in VCD) and 2 Read-only entities used only for lookup of AVI Controller components for mapping in VCD. Note. This functionality requires VCD >= 10.2
* Add support and tests for external network backed by NSX-T Segment in 10.3
* Add CHANGELOG for 2.13.0 Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
* Fix receiver name in code and comments Co-authored-by: Yuri crashiura Co-authored-by: Dainius <Didainius@users.noreply.github.com> Co-authored-by: lvirbalas <lvirbalas@vmware.com> Co-authored-by: Giuseppe Maxia <dataclouder@users.noreply.github.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
…are#403) This PR starts adding NSX-T ALB support for Tenant view. It is in tenant view, but still requires System user (just like creating an edge gateway) This is the first resource in series to allow controlling ALB on NSX-T Edge Gateway. It still requires system user to modify, just as creating an edge gateway, but is presented in Tenants view
…Library (vmware#404) * added implementation for managing Certificates in certificate library. New functions and methods GetCertificateFromLibraryById, AddCertificateToLibrary, GetAllCertificatesFromLibrary, GetCertificateFromLibraryByName, Update, Delete * added handling different API calls for 10.2.0 and query issue in 10.2.2 * added space handling in alias
* Add method VCDClient.GetBearerTokenFromApiToken * Add method VCDClient.SetApiToken * Make VCDClient.SetToken accept API tokens transparently * Add tracer for token usage in client structure * Add check for API token usage in tests * Update logging of API token operations * Add removal of certificate details from logs Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
* Remove warnings with url.ParseRequestURI * Resolve unchecked error warnings * Fix null pointer dereference * Remove dead code * Remove redundant Boolean return value Methods client.vcdCheckSupportedVersion, client.checkSupportedVersionConstraint, and client.apiVersionMatchesConstraint were returning "true" only if error was nil. Removing the Boolean returning value makes evaluation more streamlined. Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
…are#545) Signed-off-by: abarreiro <abarreiro@vmware.com>
* Fixed accessing uninitialized `Features` field while updating a vApp network * Added support for using subnet prefix length while creating vApp networks --------- Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
* Add functions to enable/disable a NSX-V distributed firewall * Add NSX-V distributed firewall and service types specifications * Add services and configuration retrieval functions * Add NSX-V distributed firewall update function * Implement IsNsxv for AdminVdc * Add test for AdminVdc.IsNsxv * Add test for NSX-V distributed firewall update * Add CHANGELOG entry Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
…#544) Signed-off-by: abarreiro <abarreiro@vmware.com>
…mbership (VCD 10.4.1+) (vmware#560)
Signed-off-by: abarreiro <abarreiro@vmware.com>
* add ability to authorize using a service account --------- Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
* Update CHANGELOG with v2.20.0 changes * Fix test Test_readFileAndUnmarshalJSON Signed-off-by: Giuseppe Maxia <gmaxia@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.
Sync Fork to 2.20
Re-add: