├── .changes ├── README.md ├── init.sh ├── sections ├── v2.12.0 │ ├── 364-deprecations.md │ ├── 364-features.md │ ├── 367-improvements.md │ ├── 368-features.md │ ├── 368-improvements.md │ ├── 371-breaking-changes.md │ ├── 371-improvements.md │ ├── 371-notes.md │ ├── 372-breaking-changes.md │ ├── 378-features.md │ ├── 378-improvements.md │ ├── 380-breaking-changes.md │ ├── 380-deprecations.md │ ├── 380-features.md │ ├── 381-features.md │ ├── 381-improvements.md │ ├── 382-features.md │ ├── 385-features.md │ └── 387-bug-fixes.md ├── v2.12.1 │ └── 389-bug-fixes.md ├── v2.13.0 │ ├── 391-bug-fixes.md │ ├── 391-improvements.md │ ├── 392-bug-fixes.md │ ├── 393-deprecations.md │ ├── 393-features.md │ ├── 396-improvements.md │ ├── 397-bug-fixes.md │ ├── 398-features.md │ └── 399-improvements.md ├── v2.14.0 │ ├── 403-features.md │ ├── 404-features.md │ ├── 405-features.md │ ├── 406-features.md │ ├── 406-improvements.md │ ├── 408-improvements.md │ ├── 409-improvements.md │ ├── 410-features.md │ ├── 414-features.md │ ├── 417-features.md │ ├── 418-bug-fixes.md │ ├── 419-bug-fixes.md │ ├── 420-bug-fixes.md │ └── 420-improvements.md ├── v2.15.0 │ ├── 383-features.md │ ├── 422-features.md │ ├── 424-features.md │ ├── 430-deprecations.md │ ├── 430-features.md │ ├── 432-deprecations.md │ ├── 432-features.md │ ├── 433-bug-fixes.md │ ├── 434-features.md │ ├── 434-improvements.md │ ├── 435-bug-fixes.md │ ├── 436-bug-fixes.md │ ├── 436-features.md │ ├── 438-features.md │ ├── 439-improvements.md │ ├── 440-improvements.md │ ├── 441-bug-fixes.md │ ├── 442-improvements.md │ ├── 443-features.md │ ├── 444-improvements.md │ ├── 450-features.md │ ├── 451-features.md │ ├── 452-features.md │ ├── 454-features.md │ ├── 456-features.md │ ├── 457-notes.md │ ├── 458-improvements.md │ ├── 459-improvements.md │ └── 460-improvements.md ├── v2.16.0 │ ├── 465-features.md │ ├── 466-bug-fixes.md │ ├── 467-features.md │ ├── 468-deprecations.md │ ├── 468-improvements.md │ ├── 469-improvements.md │ ├── 470-features.md │ ├── 471-features.md │ ├── 473-features.md │ ├── 478-features.md │ ├── 479-improvements.md │ ├── 480-features.md │ ├── 481-bug-fixes.md │ ├── 485-improvements.md │ ├── 487-features.md │ ├── 488-features.md │ └── 489-features.md ├── v2.17.0 │ ├── 413-improvements.md │ ├── 491-improvements.md │ ├── 494-bug-fixes.md │ ├── 495-features.md │ ├── 497-notes.md │ ├── 498-bug-fixes.md │ ├── 499-improvements.md │ ├── 500-improvements.md │ ├── 501-features.md │ ├── 502-features.md │ ├── 502-improvements.md │ ├── 503-enhancement.md │ ├── 504-bug-fixes.md │ ├── 504-deprecations.md │ ├── 504-features.md │ ├── 505-improvements.md │ ├── 510-deprecations.md │ ├── 510-features.md │ ├── 511-features.md │ ├── 512-improvements.md │ ├── 513-improvements.md │ ├── 515-improvements.md │ ├── 516-notes.md │ ├── 517-notes.md │ ├── 518-bug-fixes.md │ ├── 520-features.md │ └── 520-improvements.md ├── v2.18.0 │ ├── 530-bug-fixes.md │ ├── 530-features.md │ ├── 531-features.md │ └── 533-bug-fixes.md ├── v2.19.0 │ ├── 537-bug-fixes.md │ ├── 537-features.md │ ├── 538-notes.md │ └── 540-bug-fixes.md ├── v2.20.0 │ ├── 521-features.md │ ├── 527-features.md │ ├── 528-features.md │ ├── 532-features.md │ ├── 536-bug-fixes.md │ ├── 544-features.md │ ├── 545-features.md │ ├── 546-notes.md │ ├── 549-improvements.md │ ├── 550-bug-fixes.md │ ├── 550-improvements.md │ ├── 553-improvements.md │ ├── 560-improvements.md │ ├── 561-features.md │ ├── 561-improvements.md │ ├── 562-improvements.md │ ├── 563-features.md │ └── 564-features.md ├── v2.21.0 │ ├── 571-notes.md │ ├── 572-notes.md │ ├── 573-features.md │ ├── 574-notes.md │ ├── 575-features.md │ ├── 576-features.md │ ├── 577-features.md │ ├── 578-features.md │ ├── 579-features.md │ ├── 579-improvements.md │ ├── 580-bug-fixes.md │ ├── 580-features.md │ ├── 581-improvements.md │ ├── 582-features.md │ ├── 582-improvements.md │ ├── 583-notes.md │ ├── 584-features.md │ ├── 586-features.md │ ├── 587-features.md │ ├── 588-deprecations.md │ ├── 588-features.md │ └── 589-bug-fixes.md ├── v2.22.0 │ ├── 557-features.md │ ├── 559-features.md │ ├── 559-improvements.md │ ├── 590-bug-fixes.md │ ├── 594-bug-fixes.md │ ├── 595-bug-fixes.md │ ├── 597-improvements.md │ ├── 598-bug-fixes.md │ ├── 599-notes.md │ ├── 600-notes.md │ ├── 601-notes.md │ ├── 605-notes.md │ ├── 607-deprecations.md │ ├── 607-features.md │ ├── 608-notes.md │ ├── 609-improvements.md │ ├── 609-notes.md │ ├── 609-removals.md │ ├── 610-improvements.md │ ├── 613-features.md │ ├── 615-improvements.md │ ├── 618-features.md │ ├── 619-features.md │ ├── 621-features.md │ ├── 622-features.md │ ├── 623-features.md │ ├── 625-bug-fixes.md │ ├── 627-features.md │ ├── 628-improvements.md │ ├── 629-notes.md │ ├── 632-improvements.md │ └── 633-features.md ├── v2.23.0 │ ├── 639-notes.md │ ├── 643-notes.md │ ├── 644-notes.md │ ├── 645-features.md │ ├── 646-features.md │ ├── 646-improvements.md │ ├── 648-improvements.md │ ├── 650-improvements.md │ └── 652-improvements.md ├── v2.24.0 │ ├── 657-features.md │ └── 663-bug-fixes.md ├── v2.25.0 │ ├── 656-improvements.md │ ├── 658-improvements.md │ ├── 659-notes.md │ ├── 660-improvements.md │ ├── 661-improvements.md │ ├── 665-features.md │ ├── 666-features.md │ ├── 669-features.md │ ├── 670-features.md │ ├── 671-features.md │ ├── 673-improvements.md │ ├── 674-bug-fixes.md │ ├── 677-bug-fixes.md │ ├── 678-features.md │ ├── 679-features.md │ ├── 679-improvements.md │ ├── 680-bug-fixes.md │ ├── 681-notes.md │ ├── 682-improvements.md │ ├── 683-bug-fixes.md │ ├── 684-notes.md │ ├── 686-features.md │ ├── 688-bug-fixes.md │ ├── 689-features.md │ ├── 689-improvements.md │ └── 690-bug-fixes.md ├── v2.26.0 │ ├── 689-improvements.md │ ├── 693-bug-fixes.md │ ├── 694-improvements.md │ ├── 696-features.md │ ├── 697-bug-fixes.md │ ├── 697-notes.md │ ├── 699-improvements.md │ ├── 701-improvements.md │ ├── 702-improvements.md │ ├── 704-improvements.md │ ├── 705-improvements.md │ └── 706-features.md ├── v2.26.1 │ └── 723-improvements.md └── v3.0.0 │ ├── 708-improvements.md │ ├── 711-features.md │ ├── 714-features.md │ ├── 715-notes.md │ ├── 716-features.md │ ├── 716-notes.md │ ├── 717-features.md │ ├── 718-features.md │ ├── 720-features.md │ ├── 724-features.md │ ├── 725-features.md │ ├── 726-features.md │ ├── 730-features.md │ ├── 732-features.md │ ├── 734-features.md │ ├── 736-notes.md │ ├── 741-features.md │ ├── 742-bug-fixes.md │ ├── 743-features.md │ ├── 744-features.md │ ├── 745-features.md │ ├── 748-features.md │ ├── 750-notes.md │ ├── 751-features.md │ ├── 752-notes.md │ ├── 756-improvements.md │ ├── 767-improvements.md │ ├── 768-features.md │ ├── 772-improvements.md │ ├── 775-notes.md │ └── 776-features.md ├── .drone.sec ├── .drone.yml ├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── check-code.yml │ └── check-security.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CODING_GUIDELINES.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── TESTING.md ├── ccitypes ├── constants.go └── types.go ├── go.mod ├── go.sum ├── govcd ├── access_control.go ├── access_control_catalog_test.go ├── access_control_test.go ├── access_control_vapp_test.go ├── admincatalog.go ├── adminorg.go ├── adminorg_administration.go ├── adminorg_administration_test.go ├── adminorg_ldap_test.go ├── adminorg_test.go ├── adminorg_unit_test.go ├── adminvdc.go ├── adminvdc_nsxt_test.go ├── adminvdc_test.go ├── anytypeedgegateway.go ├── anytypeedgegateway_test.go ├── api.go ├── api_filter.go ├── api_filter_test.go ├── api_json.go ├── api_test.go ├── api_token.go ├── api_token_test.go ├── api_token_unit_test.go ├── api_vcd.go ├── api_vcd_request_test.go ├── api_vcd_test.go ├── api_vcd_test_unit.go ├── api_vcd_versions.go ├── api_vcd_versions_test.go ├── catalog.go ├── catalog_subscription_test.go ├── catalog_test.go ├── catalogitem.go ├── catalogitem_test.go ├── certificate_management.go ├── certificate_management_test.go ├── certificates_embedded_test.go ├── common_test.go ├── cse.go ├── cse │ ├── 4.1 │ │ ├── autoscaler.tmpl │ │ ├── capiyaml_cluster.tmpl │ │ ├── capiyaml_mhc.tmpl │ │ ├── capiyaml_workerpool.tmpl │ │ └── rde.tmpl │ ├── 4.2 │ │ ├── autoscaler.tmpl │ │ ├── capiyaml_cluster.tmpl │ │ ├── capiyaml_mhc.tmpl │ │ ├── capiyaml_workerpool.tmpl │ │ └── rde.tmpl │ └── tkg_versions.json ├── cse_internal.go ├── cse_internal_unit_test.go ├── cse_test.go ├── cse_type.go ├── cse_util.go ├── cse_util_unit_test.go ├── cse_yaml.go ├── cse_yaml_unit_test.go ├── defined_entity.go ├── defined_entity_test.go ├── defined_interface.go ├── defined_interface_test.go ├── disk.go ├── disk_test.go ├── dse_data_solution.go ├── dse_data_solution_instance_template.go ├── dse_data_solution_org_config.go ├── dse_data_solution_test.go ├── edgegateway.go ├── edgegateway_test.go ├── edgegateway_unit_test.go ├── ejecttask.go ├── entity.go ├── entity_client.go ├── entity_supervisor_namespace_test.go ├── entity_test.go ├── extension.go ├── external_endpoint.go ├── external_endpoint_test.go ├── external_network_v2.go ├── external_network_v2_test.go ├── externalnetwork.go ├── externalnetwork_test.go ├── feture_flag.go ├── feture_flag_test.go ├── filter_condition.go ├── filter_engine.go ├── filter_engine_test.go ├── filter_engine_unit_test.go ├── filter_helpers.go ├── filter_interface.go ├── filter_util.go ├── filter_util_unit_test.go ├── generic_functions.go ├── generic_functions_unit_test.go ├── global_role.go ├── global_role_test.go ├── group.go ├── group_test.go ├── importable_dvpg.go ├── importable_dvpg_test.go ├── internal │ └── udf │ │ ├── cdrom.go │ │ ├── perms.go │ │ ├── reader.go │ │ └── udf.go ├── ip_space.go ├── ip_space_allocation.go ├── ip_space_allocation_test.go ├── ip_space_org_assignment.go ├── ip_space_org_assignment_test.go ├── ip_space_test.go ├── ip_space_uplink.go ├── ip_space_uplink_test.go ├── lb.go ├── lb_test.go ├── lb_unit_test.go ├── lbappprofile.go ├── lbappprofile_test.go ├── lbapprule.go ├── lbapprule_test.go ├── lbserverpool.go ├── lbserverpool_test.go ├── lbservicemonitor.go ├── lbservicemonitor_test.go ├── lbvirtualserver.go ├── lbvirtualserver_test.go ├── media.go ├── media_test.go ├── metadata.go ├── metadata_openapi.go ├── metadata_openapi_test.go ├── metadata_openapi_unit_test.go ├── metadata_test.go ├── metadata_v2.go ├── metadata_v2_test.go ├── metadata_v2_unit_test.go ├── monitor.go ├── multi_site.go ├── multi_site_test.go ├── network_pool.go ├── network_pool_test.go ├── nsxt_alb_clouds.go ├── nsxt_alb_clouds_test.go ├── nsxt_alb_controllers.go ├── nsxt_alb_controllers_test.go ├── nsxt_alb_importable_clouds.go ├── nsxt_alb_importable_clouds_test.go ├── nsxt_alb_importable_service_engine_groups.go ├── nsxt_alb_importable_service_engine_groups_test.go ├── nsxt_alb_pool.go ├── nsxt_alb_pool_test.go ├── nsxt_alb_service_engine_group_assignment.go ├── nsxt_alb_service_engine_group_assignment_test.go ├── nsxt_alb_service_engine_groups.go ├── nsxt_alb_service_engine_groups_test.go ├── nsxt_alb_settings.go ├── nsxt_alb_settings_test.go ├── nsxt_alb_virtual_service.go ├── nsxt_alb_virtual_service_http_policy.go ├── nsxt_alb_virtual_service_test.go ├── nsxt_application_profile.go ├── nsxt_application_profile_test.go ├── nsxt_distributed_firewall.go ├── nsxt_distributed_firewall_test.go ├── nsxt_edge_cluster.go ├── nsxt_edge_cluster_test.go ├── nsxt_edgegateway.go ├── nsxt_edgegateway_bgp_configuration.go ├── nsxt_edgegateway_bgp_configuration_test.go ├── nsxt_edgegateway_bgp_ip_prefix_list.go ├── nsxt_edgegateway_bgp_ip_prefix_list_test.go ├── nsxt_edgegateway_bgp_neighbor.go ├── nsxt_edgegateway_bgp_neighbor_test.go ├── nsxt_edgegateway_dns.go ├── nsxt_edgegateway_dns_test.go ├── nsxt_edgegateway_qos_profile.go ├── nsxt_edgegateway_qos_profile_test.go ├── nsxt_edgegateway_static_route.go ├── nsxt_edgegateway_static_route_test.go ├── nsxt_edgegateway_test.go ├── nsxt_edgegateway_unit_test.go ├── nsxt_firewall.go ├── nsxt_firewall_group.go ├── nsxt_firewall_group_dynamic_security_group_test.go ├── nsxt_firewall_group_ip_set_test.go ├── nsxt_firewall_group_static_security_group_test.go ├── nsxt_firewall_test.go ├── nsxt_importable_switch.go ├── nsxt_importable_switch_test.go ├── nsxt_ipsec_vpn_tunnel.go ├── nsxt_ipsec_vpn_tunnel_test.go ├── nsxt_l2_vpn_tunnel.go ├── nsxt_l2_vpn_tunnel_test.go ├── nsxt_manager.go ├── nsxt_manager_openapi.go ├── nsxt_manager_openapi_test.go ├── nsxt_manager_test.go ├── nsxt_nat_rule.go ├── nsxt_nat_rule_test.go ├── nsxt_network_context_profile.go ├── nsxt_network_context_profile_test.go ├── nsxt_route_advertisement.go ├── nsxt_route_advertisement_test.go ├── nsxt_segment_profile_template.go ├── nsxt_segment_profile_template_test.go ├── nsxt_segment_profiles.go ├── nsxt_segment_profiles_test.go ├── nsxt_test.go ├── nsxt_tier0_router.go ├── nsxt_transport_zones.go ├── nsxv_dhcplease.go ├── nsxv_dhcprelay.go ├── nsxv_dhcprelay_test.go ├── nsxv_distributed_firewall.go ├── nsxv_distributed_firewall_test.go ├── nsxv_firewall.go ├── nsxv_firewall_test.go ├── nsxv_ipset.go ├── nsxv_ipset_test.go ├── nsxv_nat.go ├── nsxv_nat_test.go ├── openapi.go ├── openapi_endpoints.go ├── openapi_endpoints_unit_test.go ├── openapi_generic_inner_entities.go ├── openapi_generic_outer_entities.go ├── openapi_generic_unit_test.go ├── openapi_org_network.go ├── openapi_org_network_dhcp.go ├── openapi_org_network_dhcp_binding.go ├── openapi_org_network_test.go ├── openapi_test.go ├── openapi_unit_test.go ├── openapi_user.go ├── openapi_user_tm_test.go ├── org.go ├── org_oidc.go ├── org_oidc_test.go ├── org_saml.go ├── org_saml_test.go ├── org_saml_unit_test.go ├── org_test.go ├── orgs.go ├── orgs_test.go ├── orgvdcnetwork.go ├── orgvdcnetwork_test.go ├── productsection.go ├── provider_vdc.go ├── provider_vdc_test.go ├── query.go ├── query_metadata.go ├── query_metadata_test.go ├── query_test.go ├── rights.go ├── rights_bundle.go ├── rights_bundle_test.go ├── rights_test.go ├── roles.go ├── roles_test.go ├── saml_auth.go ├── saml_auth_test.go ├── saml_auth_unit_test.go ├── sample_govcd_test_config.yaml ├── security_tags.go ├── security_tags_test.go ├── service_account.go ├── service_account_test.go ├── session_info.go ├── session_info_test.go ├── solution_add_on.go ├── solution_add_on_instance.go ├── solution_add_on_instance_publishing.go ├── solution_add_on_instance_test.go ├── solution_add_on_test.go ├── solution_add_on_unit_test.go ├── solution_landing_zone.go ├── solution_landing_zone_test.go ├── system.go ├── system_test.go ├── system_unit_test.go ├── task.go ├── task_test.go ├── tenant_context.go ├── tenant_context_test.go ├── test-resources │ ├── capiYaml.yaml │ ├── cert.pem │ ├── key.pem │ ├── rootCA.pem │ ├── saml-test-idp.xml │ ├── saml-test-sp-invalid.xml │ ├── saml-test-sp.xml │ ├── test.json │ ├── test_empty.json │ └── test_emptyJSON.json ├── tm_common_test.go ├── tm_content_library.go ├── tm_content_library_item.go ├── tm_content_library_item_test.go ├── tm_content_library_test.go ├── tm_edge_cluster.go ├── tm_edge_cluster_test.go ├── tm_ip_space.go ├── tm_ip_space_associations.go ├── tm_ip_space_test.go ├── tm_ldap.go ├── tm_ldap_test.go ├── tm_org.go ├── tm_org_test.go ├── tm_provider_gateway.go ├── tm_provider_gateway_test.go ├── tm_region.go ├── tm_region_quota.go ├── tm_region_quota_storage_policy.go ├── tm_region_quota_storage_policy_test.go ├── tm_region_quota_test.go ├── tm_region_storage_policy.go ├── tm_region_storage_policy_test.go ├── tm_region_test.go ├── tm_region_vm_class.go ├── tm_region_vm_class_test.go ├── tm_regional_networking_settings.go ├── tm_regional_networking_settings_test.go ├── tm_storage_class.go ├── tm_storage_class_test.go ├── tm_supervisor.go ├── tm_supervisor_test.go ├── tm_supervisor_zone.go ├── tm_tier0_gateway.go ├── tm_zone.go ├── trusted_certificates.go ├── trusted_certificates_test.go ├── ui_plugin.go ├── ui_plugin_test.go ├── ui_plugin_unit_test.go ├── upload.go ├── uploadtask.go ├── user.go ├── user_test.go ├── vapp.go ├── vapp_clone_test.go ├── vapp_concurrent_test.go ├── vapp_network.go ├── vapp_network_test.go ├── vapp_test.go ├── vapp_vm_test.go ├── vapptemplate.go ├── vapptemplate_test.go ├── vcd_test_help.go ├── vdc.go ├── vdc_group.go ├── vdc_group_common_test.go ├── vdc_group_test.go ├── vdc_network_profile.go ├── vdc_network_profile_test.go ├── vdc_template.go ├── vdc_template_test.go ├── vdc_test.go ├── vdccomputepolicy.go ├── vdccomputepolicy_test.go ├── vdccomputepolicy_v2.go ├── vdccomputepolicy_v2_test.go ├── vgpu_profile.go ├── vm.go ├── vm_affinity_rule.go ├── vm_affinity_rule_test.go ├── vm_concurrent_test.go ├── vm_dhcp_test.go ├── vm_groups.go ├── vm_groups_test.go ├── vm_groups_unit_test.go ├── vm_test.go ├── vm_unit_test.go ├── vsphere_distributed_switch.go ├── vsphere_resource_pool.go ├── vsphere_resource_pool_test.go ├── vsphere_storage_profile.go ├── vsphere_storage_profile_test.go ├── vsphere_vcenter.go ├── vsphere_vcenter_test.go └── vsphere_vcenter_tm_test.go ├── hack └── coverage ├── samples ├── discover │ ├── discover.go │ ├── sample_config.json │ └── sample_config.yaml ├── openapi │ ├── README.md │ └── main.go └── saml_auth_adfs │ ├── README.md │ └── main.go ├── scripts ├── changelog-links.sh ├── get_token.sh ├── gofmtcheck.sh ├── gosec-config.sh ├── gosec.sh ├── licensecheck.sh ├── make-changelog.sh ├── staticcheck-config.sh ├── staticcheck.sh └── test-tags.sh ├── support ├── Dockerfile.jenkins ├── Jenkinsfile ├── build.sh ├── lib.groovy └── run_in_docker.sh ├── test-resources ├── golden │ ├── TestSamlAdfsAuthenticateWithCookie_REQ_adfs_services_trust_13_usernamemixed.golden │ ├── TestSamlAdfsAuthenticateWithCookie_REQ_api_sessions.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_HEADER_login_my-org_saml_login_alias_vcd.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_adfs_services_trust_13_usernamemixed.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_api_org.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_api_sessions.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_api_versions.golden │ ├── TestSamlAdfsAuthenticateWithCookie_RESP_cloud_org_my-org_saml_metadata_alias_vcd.golden │ ├── TestSamlAdfsAuthenticate_REQ_adfs_services_trust_13_usernamemixed.golden │ ├── TestSamlAdfsAuthenticate_REQ_api_sessions.golden │ ├── TestSamlAdfsAuthenticate_RESP_HEADER_login_my-org_saml_login_alias_vcd.golden │ ├── TestSamlAdfsAuthenticate_RESP_adfs_services_trust_13_usernamemixed.golden │ ├── TestSamlAdfsAuthenticate_RESP_api_org.golden │ ├── TestSamlAdfsAuthenticate_RESP_api_sessions.golden │ ├── TestSamlAdfsAuthenticate_RESP_api_versions.golden │ └── TestSamlAdfsAuthenticate_RESP_cloud_org_my-org_saml_metadata_alias_vcd.golden ├── rde_type.json ├── template_with_custom_chunk_size.ova ├── template_without_vmdk_size.ova ├── test.iso ├── test_vapp_template.ova ├── test_vapp_template_ovf │ ├── descriptor.ovf │ └── yVMFromVcd-disk1.vmdk ├── udf_test.iso ├── ui_plugin.zip └── vapp_with_3_vms.ova ├── types └── v56 │ ├── constants.go │ ├── cse.go │ ├── dse.go │ ├── ip_space.go │ ├── link.go │ ├── multi_site.go │ ├── network.go │ ├── nsxt_alb.go │ ├── nsxt_segment_profiles.go │ ├── nsxt_types.go │ ├── nsxv_types.go │ ├── oidc.go │ ├── openapi.go │ ├── saml.go │ ├── slz.go │ ├── tm.go │ ├── types.go │ ├── vm_types.go │ └── vmmarshal.go └── util ├── LOGGING.md ├── logging.go ├── logging_test.go ├── tar.go └── tar_test.go /.changes/README.md: -------------------------------------------------------------------------------- 1 | # Handling of CHANGELOG entries 2 | 3 | ## PR operations 4 | 5 | * All PRs, instead of updating CHANGELOG.md directly, will create individual files in a directory .changes/$version 6 | * The files will be named `xxx-section_name.md`, where xxx is the PR number, and `section_name` is one of 7 | * features 8 | * improvements 9 | * bug-fixes 10 | * deprecations 11 | * notes 12 | * removals 13 | 14 | * The changes files must NOT contain the header 15 | 16 | * You can update the file `.changes/sections` to add more headers 17 | * To see the full change set for the current version (or an old one), use `./scripts/make-changelog.sh [version]` 18 | 19 | 20 | ## Post release initialization 21 | 22 | After a release, the changelog will be initialized with the following template: 23 | 24 | ``` 25 | ## $VERSION (Unreleased) 26 | 27 | Changes in progress for v$VERSION are available at [.changes/v$VERSION](https://github.com/vmware/go-vcloud-director/tree/main/.changes/v$VERSION) until the release. 28 | ``` 29 | 30 | Run `.changes/init.sh version` to get the needed text 31 | -------------------------------------------------------------------------------- /.changes/init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is used at the start of a new release cycle, to 4 | # initialize the CHANGELOG 5 | # Run at the top of the repository, as 6 | # $ .changes/init.sh VERSION 7 | # (without the initial 'v') 8 | 9 | VERSION=$1 10 | 11 | if [ -z "$VERSION" ] 12 | then 13 | echo "Syntax: $0 VERSION (without initial 'v')" 14 | 15 | exit 1 16 | fi 17 | 18 | starts_with_v=$(echo $VERSION | grep '^v') 19 | if [ -n "$starts_with_v" ] 20 | then 21 | echo "The version should be without the initial 'v'" 22 | exit 1 23 | fi 24 | 25 | echo "Copy the following lines at the top of CHANGELOG.md" 26 | echo "" 27 | echo "" 28 | echo "## $VERSION (Unreleased)" 29 | echo "" 30 | echo "Changes in progress for v$VERSION are available at [.changes/v$VERSION](https://github.com/vmware/go-vcloud-director/tree/main/.changes/v$VERSION) until the release." 31 | echo "" 32 | 33 | -------------------------------------------------------------------------------- /.changes/sections: -------------------------------------------------------------------------------- 1 | features 2 | improvements 3 | bug-fixes 4 | deprecations 5 | notes 6 | removals 7 | breaking-changes 8 | -------------------------------------------------------------------------------- /.changes/v2.12.0/364-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `vdc.GetEdgeGatewayRecordsType` [GH-364] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.12.0/364-features.md: -------------------------------------------------------------------------------- 1 | * Added method `vdc.QueryEdgeGateway` [GH-364] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.12.0/367-improvements.md: -------------------------------------------------------------------------------- 1 | * Only send xml.Header when payload is not empty (some WAFs block empty requests with XML header) 2 | [GH-367] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/368-features.md: -------------------------------------------------------------------------------- 1 | * Added NSX-T Firewall Group type (which represents a Security Group or an IP Set) support by using 2 | structures `NsxtFirewallGroup` and `NsxtFirewallGroupMemberVms`. The following methods are 3 | introduced for managing Security Groups and Ip Sets: `Vdc.CreateNsxtFirewallGroup`, 4 | `NsxtEdgeGateway.CreateNsxtFirewallGroup`, `Org.GetAllNsxtFirewallGroups`, 5 | `Vdc.GetAllNsxtFirewallGroups`, `Org.GetNsxtFirewallGroupByName`, 6 | `Vdc.GetNsxtFirewallGroupByName`, `NsxtEdgeGateway.GetNsxtFirewallGroupByName`, 7 | `Org.GetNsxtFirewallGroupById`, `Vdc.GetNsxtFirewallGroupById`, 8 | `NsxtEdgeGateway.GetNsxtFirewallGroupById`, `NsxtFirewallGroup.Update`, 9 | `NsxtFirewallGroup.Delete`, `NsxtFirewallGroup.GetAssociatedVms`, 10 | `NsxtFirewallGroup.IsSecurityGroup`, `NsxtFirewallGroup.IsIpSet` 11 | [GH-368] 12 | * Added methods Org.QueryVmList and Org.QueryVmById to find VM by ID in an Org 13 | [GH-368] 14 | 15 | -------------------------------------------------------------------------------- /.changes/v2.12.0/368-improvements.md: -------------------------------------------------------------------------------- 1 | * Improved test entity cleanup to find standalone VMs in any VDC (not only default NSX-V one) 2 | [GH-368] 3 | * Improved test entity cleanup to allow specifying parent VDC for vApp removals 4 | [GH-368] 5 | 6 | -------------------------------------------------------------------------------- /.changes/v2.12.0/371-breaking-changes.md: -------------------------------------------------------------------------------- 1 | * Field `types.Disk.Size` is replaced with `types.Disk.SizeMb` as size in Kilobytes is not supported in V33.0 2 | [GH-371] 3 | * Field `types.DiskRecordType.SizeB` is replaced with `types.DiskRecordType.SizeMb` as size in Kilobytes is not 4 | supported in V33.0 [GH-371] 5 | 6 | -------------------------------------------------------------------------------- /.changes/v2.12.0/371-improvements.md: -------------------------------------------------------------------------------- 1 | * Methods `GetVDCById` and `GetVDCByName` for `Org` now use queries behind the scenes because Org 2 | structure does not list child VDCs anymore [GH-371], [GH-376], [GH-382] 3 | * Methods `GetCatalogById` and `GetCatalogByName` for `Org` now use queries behind the scenes because Org 4 | structure does not list child Catalogs anymore [GH-371] [GH-376] 5 | 6 | -------------------------------------------------------------------------------- /.changes/v2.12.0/371-notes.md: -------------------------------------------------------------------------------- 1 | * Dropped support for VCD 9.7 which is EOL now [GH-371] 2 | * Bumped Default API Version to V33.0 [GH-371] 3 | * Drop legacy authentication mechanism (vcdAuthorize) and use only new Cloud API provided (vcdCloudApiAuthorize) as 4 | API V33.0 is sufficient for it [GH-371] 5 | 6 | -------------------------------------------------------------------------------- /.changes/v2.12.0/372-breaking-changes.md: -------------------------------------------------------------------------------- 1 | * Added parameter `description` to method `vdc.ComposeRawVapp` [GH-372] 2 | * Added methods `vapp.Rename`, `vapp.UpdateDescription`, `vapp.UpdateNameDescription` [GH-372] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/378-features.md: -------------------------------------------------------------------------------- 1 | * Added `NsxtAppPortProfile` and `types.NsxtAppPortProfile` for NSX-T Application Port Profile management 2 | [GH-378] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/378-improvements.md: -------------------------------------------------------------------------------- 1 | * Improved `OpenApiGetAllItems` to still follow pages in VCD endpoints with BUG which don't return 'nextPage' link for 2 | pagination [GH-378] 3 | * Improved LDAP container related tests to use correct port mapping for latest LDAP container version 4 | [GH-378] 5 | 6 | -------------------------------------------------------------------------------- /.changes/v2.12.0/380-breaking-changes.md: -------------------------------------------------------------------------------- 1 | * Added parameter `additionalHeader map[string]string` to functions `Client.OpenApiDeleteItem`, `Client.OpenApiGetAllItems`, 2 | `Client.OpenApiGetItem`, `Client.OpenApiPostItem`, `Client.OpenApiPutItem`, `Client.OpenApiPutItemAsync`, 3 | `Client.OpenApiPutItemSync` [GH-380] 4 | * Renamed functions `GetOpenApiRoleById` -> `GetRoleById`, `GetOpenApiRoleByName` -> `GetRoleByName`, 5 | `GetAllOpenApiRoles` -> `GetAllRoles` [GH-380] 6 | 7 | -------------------------------------------------------------------------------- /.changes/v2.12.0/380-deprecations.md: -------------------------------------------------------------------------------- 1 | * Removed deprecated method `adminOrg.GetRole` [GH-380] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.12.0/381-features.md: -------------------------------------------------------------------------------- 1 | * Added methods `NsxtEdgeGateway.UpdateNsxtFirewall()`, `NsxtEdgeGateway.GetNsxtFirewall()`, `nsxtFirewall.DeleteAllRules()`, 2 | `nsxtFirewall.DeleteRuleById` [GH-381] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/381-improvements.md: -------------------------------------------------------------------------------- 1 | * Cleanup a few unnecessary type conversions detected by new staticcheck version 2 | [GH-381] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/382-features.md: -------------------------------------------------------------------------------- 1 | * Added NSX-T NAT support with types `NsxtNatRule` and `types.NsxtNatRule` as well as methods `edge.GetAllNsxtNatRules`, 2 | `edge.GetNsxtNatRuleByName`, `edge.GetNsxtNatRuleById`, `edge.CreateNatRule`, `nsxtNatRule.Update`, `nsxtNatRule.Delete`, 3 | `nsxtNatRule.IsEqualTo` [GH-382] 4 | 5 | -------------------------------------------------------------------------------- /.changes/v2.12.0/385-features.md: -------------------------------------------------------------------------------- 1 | * Added `NsxtIpSecVpnTunnel` and `types.NsxtIpSecVpnTunnel` for NSX-T IPsec VPN Tunnel configuration 2 | [GH-385] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.0/387-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Deprecated methods `vdc.ComposeRawVApp` and `vdc.ComposeVApp` [#387](https://github.com/vmware/go-vcloud-director/pull/387) 2 | * Added method `vdc.CreateRawVApp` [#387](https://github.com/vmware/go-vcloud-director/pull/387) 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.12.1/389-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * org.GetCatalogByName and org.GetCatalogById could not retrieve shared catalogs from different Orgs 2 | [GH-389] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.13.0/391-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix handling of `staticcheck` in GitGub Actions [GH-391] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.13.0/391-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `.changes` directory for changelog items [GH-391] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.13.0/392-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix Issue #390: `catalog.Delete()` ignores returned task and responds immediately which could have caused failures [GH-392] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.13.0/393-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `GetStorageProfileByHref` in favor of either `client.GetStorageProfileByHref` or `vcdClient.GetStorageProfileByHref` [GH-393] 2 | * Deprecated `QueryProviderVdcStorageProfileByName` in favor of `VCDClient.QueryProviderVdcStorageProfileByName` [GH-393] 3 | * Deprecated `VCDClient.QueryProviderVdcStorageProfiles` in favor of either `client.QueryProviderVdcStorageProfiles` or `client.QueryAllProviderVdcStorageProfiles` [GH-393] 4 | * Deprecated `Vdc.GetDefaultStorageProfileReference` in favor of `adminVdc.GetDefaultStorageProfileReference` [GH-393] 5 | -------------------------------------------------------------------------------- /.changes/v2.13.0/393-features.md: -------------------------------------------------------------------------------- 1 | * Added method `AdminVdc.AddStorageProfile` [GH-393] 2 | * Added method `AdminVdc.AddStorageProfileWait` [GH-393] 3 | * Added method `AdminVdc.RemoveStorageProfile` [GH-393] 4 | * Added method `AdminVdc.RemoveStorageProfileWait` [GH-393] 5 | * Added method `AdminVdc.SetDefaultStorageProfile` [GH-393] 6 | * Added method `AdminVdc.GetDefaultStorageProfileReference` [GH-393] 7 | * Added method `VCDClient.GetStorageProfileByHref` [GH-393] 8 | * Added method `Client.GetStorageProfileByHref` [GH-393] 9 | * Added method `VCDClient.QueryProviderVdcStorageProfileByName` [GH-393] 10 | * Added method `Client.QueryAllProviderVdcStorageProfiles` [GH-393] 11 | * Added method `Client.QueryProviderVdcStorageProfiles` [GH-393] 12 | -------------------------------------------------------------------------------- /.changes/v2.13.0/396-improvements.md: -------------------------------------------------------------------------------- 1 | * Align build tags to match go fmt with Go 1.17 [GH-396] 2 | * Improve `test-tags.sh` script to handle new build tag format [GH-396] 3 | -------------------------------------------------------------------------------- /.changes/v2.13.0/397-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixes Issue #395 "BUG: can't update EGW - there is no ownerRef field" [GH-397] 2 | -------------------------------------------------------------------------------- /.changes/v2.13.0/398-features.md: -------------------------------------------------------------------------------- 1 | * Added types `NsxtAlbController` and `types.NsxtAlbController` for handling NSX-T ALB Controllers with corresponding 2 | functions `GetAllAlbControllers`, `GetAlbControllerByName`, `GetAlbControllerById`, `GetAlbControllerByUrl`, 3 | `CreateNsxtAlbController`, `Update`, `Delete` [GH-398] 4 | * Added types `NsxtAlbCloud` and `types.NsxtAlbCloud` for handling NSX-T ALB Clouds with corresponding functions 5 | `GetAllAlbClouds`, `GetAlbCloudByName`, `GetAlbCloudById`, `CreateAlbCloud`, `Delete` [GH-398] 6 | * Added type `NsxtAlbImportableCloud` and `types.NsxtAlbImportableCloud` for listing NSX-T ALB Importable Clouds with 7 | corresponding functions `GetAllAlbImportableClouds`, `GetAlbImportableCloudByName`, `GetAlbImportableCloudById` 8 | [GH-398] 9 | * Added types `NsxtAlbServiceEngineGroup` and `types.NsxtAlbServiceEngineGroup` for handling NSX-T ALB Service Engine 10 | Groups with corresponding functions `GetAllNsxtAlbServiceEngineGroups`, `GetAlbServiceEngineGroupByName`, 11 | `GetAlbServiceEngineGroupById`, `CreateNsxtAlbServiceEngineGroup`, `Update`, `Delete`, `Sync` [GH-398] 12 | * Added types `NsxtAlbImportableServiceEngineGroups` and `types.NsxtAlbImportableServiceEngineGroups` for listing NSX-T 13 | ALB Importable Service Engine Groups with corresponding functions `GetAllAlbImportableServiceEngineGroups`, 14 | `GetAlbImportableServiceEngineGroupByName`, `GetAlbImportableServiceEngineGroupById` [GH-398] 15 | -------------------------------------------------------------------------------- /.changes/v2.13.0/399-improvements.md: -------------------------------------------------------------------------------- 1 | * External network type ExternalNetworkV2 automatically elevates API version to maximum available out of 33.0, 35.0 and 2 | 36.0, so that new functionality can be consumed. It uses a controlled version elevation mechanism to consume the newer 3 | features, but at the same time remain tested by not choosing the latest untested version blindly (more information in 4 | openapi_endpoints.go) [GH-399] 5 | * Added new field BackingTypeValue in favor of deprecated BackingType to types.ExternalNetworkV2Backing [GH-399] 6 | * Add new function `GetFilteredNsxtImportableSwitches` to query NSX-T Importable Switches (Segments) [GH-399] 7 | -------------------------------------------------------------------------------- /.changes/v2.14.0/403-features.md: -------------------------------------------------------------------------------- 1 | * Add type `NsxtAlbConfig` and functions `NsxtEdgeGateway.UpdateAlbSettings`, `NsxtEdgeGateway.GetAlbSettings`, 2 | `NsxtEdgeGateway.DisableAlb` [GH-403] 3 | -------------------------------------------------------------------------------- /.changes/v2.14.0/404-features.md: -------------------------------------------------------------------------------- 1 | * Add types `Certificate` and `types.CertificateLibraryItem` for handling Certificates in Certificate Library with corresponding 2 | methods `client.GetCertificateFromLibraryById`, `client.AddCertificateToLibrary`, `client.GetAllCertificatesFromLibrary`, `client.GetCertificateFromLibraryByName`, `adminOrg.GetCertificateFromLibraryById`, `adminOrg.AddCertificateToLibrary`, `adminOrg.GetAllCertificatesFromLibrary`, `adminOrg.GetCertificateFromLibraryByName`, 3 | `certificate.Update`, `certificate.Delete` [GH-404] 4 | -------------------------------------------------------------------------------- /.changes/v2.14.0/405-features.md: -------------------------------------------------------------------------------- 1 | * Add support for ALB Service Engine Group Assignment to NSX-T Edge Gateway via type 2 | `NsxtAlbServiceEngineGroupAssignment` and functions `GetAllAlbServiceEngineGroupAssignments`, 3 | `GetAlbServiceEngineGroupAssignmentById`, `GetAlbServiceEngineGroupAssignmentByName`, 4 | `CreateAlbServiceEngineGroupAssignment`, `Update`, `Delete` [GH-405] 5 | -------------------------------------------------------------------------------- /.changes/v2.14.0/406-features.md: -------------------------------------------------------------------------------- 1 | * Add type `types.ApiTokenRefresh` to contain data from API token refresh [GH-406] 2 | * Add method `VCDClient.GetBearerTokenFromApiToken` to get a bearer token from an API token [GH-406] 3 | * Add method `VCDClient.SetApiToken` to set a token and get a bearer token using and API token and get token details in return [GH-406] 4 | -------------------------------------------------------------------------------- /.changes/v2.14.0/406-improvements.md: -------------------------------------------------------------------------------- 1 | * `VCDClient.SetToken` has now the ability of transparently setting a bearer token when receiving an API token [GH-406] 2 | -------------------------------------------------------------------------------- /.changes/v2.14.0/408-improvements.md: -------------------------------------------------------------------------------- 1 | * Remove Coverity warnings from code [GH-408, GH-412] 2 | -------------------------------------------------------------------------------- /.changes/v2.14.0/409-improvements.md: -------------------------------------------------------------------------------- 1 | * Add session info to go-vcloud-director logs [GH-409] 2 | -------------------------------------------------------------------------------- /.changes/v2.14.0/410-features.md: -------------------------------------------------------------------------------- 1 | * Add types `VdcGroup`, `types.VdcGroup`, `types.ParticipatingOrgVdcs`, `types.CandidateVdc`, `types.DfwPolicies` and `types.DefaultPolicy` for handling VDC groups with corresponding 2 | methods `adminOrg.CreateNsxtVdcGroup`, `adminOrg.CreateVdcGroup`, `adminOrg.GetAllNsxtVdcGroupCandidates`, `adminOrg.GetAllVdcGroupCandidates`, `adminOrg.GetAllVdcGroups`, `adminOrg.GetVdcGroupByName`, `adminOrg.GetVdcGroupById`, `vdcGroup.Update`, `vdcGroup.GenericUpdate`, `vdcGroup.Delete`, `vdcGroup.DisableDefaultPolicy`, `vdcGroup.EnableDefaultPolicy`, `vdcGroup.GetDfwPolicies`, `vdcGroup.DeActivateDfw`, `vdcGroup.ActivateDfw`, `vdcGroup.UpdateDefaultDfwPolicies`, `vdcGroup.UpdateDfwPolicies` [GH-410] 3 | -------------------------------------------------------------------------------- /.changes/v2.14.0/414-features.md: -------------------------------------------------------------------------------- 1 | * Add support for ALB Pool to NSX-T Edge Gateway via type `NsxtAlbPool` and functions `GetAllAlbPools`, 2 | `GetAllAlbPoolSummaries`, `GetAlbPoolByName`, `GetAlbPoolById`, `CreateNsxtAlbPool`, `nsxtAlbPool.Update`, 3 | `nsxtAlbPool.Delete` [GH-414] 4 | -------------------------------------------------------------------------------- /.changes/v2.14.0/417-features.md: -------------------------------------------------------------------------------- 1 | * Add support for ALB Virtual Services to NSX-T Edge Gateway via type `NsxtAlbVirtualService` and functions `GetAllAlbVirtualServices`, 2 | `GetAllAlbGetAllAlbVirtualServiceSummaries`, `GetAlbVirtualServiceByName`, `GetAlbVirtualServiceById`, 3 | `CreateNsxtAlbVirtualService`, `NsxtAlbVirtualService.Update`, `NsxtAlbVirtualService.Delete` [GH-417] 4 | -------------------------------------------------------------------------------- /.changes/v2.14.0/418-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix Issue #728: `vm.UpdateInternalDisksAsync()` didn't send VM description and as a result would delete VM description [GH-418] 2 | -------------------------------------------------------------------------------- /.changes/v2.14.0/419-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Remove hardcoded 0 value for Weight field in `ChangeCPUCountWithCore` function to avoid overriding shares [GH-419] 2 | -------------------------------------------------------------------------------- /.changes/v2.14.0/420-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix issue #421 "Wrong xml name in SourcedVmTemplateParams" [GH-420] 2 | 3 | -------------------------------------------------------------------------------- /.changes/v2.14.0/420-improvements.md: -------------------------------------------------------------------------------- 1 | * Add type `types.UpdateLeaseSettingsSection` to handle vApp lease settings. [GH-420] 2 | * Add methods `vApp.GetLease` and `vApp.RenewLease`, to query the state of the vApp lease and eventually modify it. [GH-420] 3 | * Add `LeaseSettingsSection` to `types.VApp` structure. [GH-420] 4 | -------------------------------------------------------------------------------- /.changes/v2.15.0/383-features.md: -------------------------------------------------------------------------------- 1 | * Added support for Shareable disks, i.e., independent disks that can be attached to multiple VMs which is available from 2 | API v35.0 onwards. Also added uuid to the Disk structure which is a new member that is returned from v36.0 onwards. This 3 | member holds a UUID that can be used to correlate the disk that is attached to a particular VM from the VCD side and the 4 | VM host side. [GH-383] 5 | -------------------------------------------------------------------------------- /.changes/v2.15.0/422-features.md: -------------------------------------------------------------------------------- 1 | * Added support for uploading OVF using URL `catalog.UploadOvfByLink` [GH-422], [GH-426] 2 | * Added support for updating vApp template `vAppTemplate.UpdateAsync` and `vAppTemplate.Update` [GH-422] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/424-features.md: -------------------------------------------------------------------------------- 1 | * Add methods `catalog.PublishToExternalOrganizations` and `adminCatalog.PublishToExternalOrganizations` [GH-424] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/430-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `vm.DeleteMetadata` in favor of `vm.DeleteMetadataEntry` [GH-430] 2 | * Deprecated `vm.AddMetadata` in favor of `vm.AddMetadataEntry` [GH-430] 3 | * Deprecated `vdc.DeleteMetadata` in favor of `vdc.DeleteMetadataEntry` [GH-430] 4 | * Deprecated `vdc.AddMetadata` in favor of `vdc.AddMetadataEntry` [GH-430] 5 | * Deprecated `vdc.AddMetadataAsync` in favor of `vdc.AddMetadataEntryAsync` [GH-430] 6 | * Deprecated `vdc.DeleteMetadataAsync` in favor of `vdc.DeleteMetadataEntryAsync` [GH-430] 7 | * Deprecated `vApp.DeleteMetadata` in favor of `vApp.DeleteMetadataEntry` [GH-430] 8 | * Deprecated `vApp.AddMetadata` in favor of `vApp.AddMetadataEntry` [GH-430] 9 | * Deprecated `vAppTemplate.AddMetadata` in favor of `vAppTemplate.AddMetadataEntry` [GH-430] 10 | * Deprecated `vAppTemplate.AddMetadataAsync` in favor of `vAppTemplate.AddMetadataEntryAsync` [GH-430] 11 | * Deprecated `vAppTemplate.DeleteMetadata` in favor of `vAppTemplate.DeleteMetadataEntry` [GH-430] 12 | * Deprecated `vAppTemplate.DeleteMetadataAsync` in favor of `vAppTemplate.DeleteMetadataEntryAsync` [GH-430] 13 | * Deprecated `mediaRecord.AddMetadata` in favor of `mediaRecord.AddMetadataEntry` [GH-430] 14 | * Deprecated `mediaRecord.AddMetadataAsync` in favor of `mediaRecord.AddMetadataEntryAsync` [GH-430] 15 | * Deprecated `mediaRecord.DeleteMetadata` in favor of `mediaRecord.DeleteMetadataEntry` [GH-430] 16 | * Deprecated `mediaRecord.DeleteMetadataAsync` in favor of `mediaRecord.DeleteMetadataEntryAsync` [GH-430] 17 | * Deprecated `media.AddMetadata` in favor of `media.AddMetadataEntry` [GH-430] 18 | * Deprecated `media.AddMetadataAsync` in favor of `media.AddMetadataEntryAsync` [GH-430] 19 | * Deprecated `media.DeleteMetadata` in favor of `media.DeleteMetadataEntry` [GH-430] 20 | * Deprecated `media.DeleteMetadataAsync` in favor of `media.DeleteMetadataEntryAsync` [GH-430] 21 | -------------------------------------------------------------------------------- /.changes/v2.15.0/430-features.md: -------------------------------------------------------------------------------- 1 | * Added types `types.MetadataStringValue`, `types.MetadataNumberValue`, `types.MetadataDateTimeValue` and `types.MetadataBooleanValue` 2 | for adding different kind of metadata to entities [GH-430] 3 | * Added support to set, get and delete metadata to AdminCatalog with the methods 4 | `AdminCatalog.AddMetadataEntry`, `AdminCatalog.AddMetadataEntryAsync`, `AdminCatalog.GetMetadata`, 5 | `AdminCatalog.DeleteMetadataEntry` and `AdminCatalog.DeleteMetadataEntryAsync`. [GH-430] 6 | * Added support to get metadata from Catalog with method `Catalog.GetMetadata` [GH-430] 7 | * Added to *VM* and *VApp* the methods `DeleteMetadataEntry`, `DeleteMetadataEntryAsync`, `AddMetadataEntry` and `AddMetadataEntryAsync` 8 | so it follows the same convention as the rest of entities that uses metadata. [GH-430] 9 | -------------------------------------------------------------------------------- /.changes/v2.15.0/432-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `vm.ChangeMemorySize` in favor of `vm.ChangeMemory` [GH-432] 2 | * Deprecated `vm.ChangeCPUCount` and `vm.ChangeCPUCountWithCore` in favor of `vm.ChangeCPU` [GH-432] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/432-features.md: -------------------------------------------------------------------------------- 1 | * Add methods `vm.ChangeCPU` and `vm.ChangeMemory` which uses the latest API structure instead deprecated ones [GH-432] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/433-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixes Issue #431 "Wrong order in Task structure" [GH-433] 2 | * Fixes Issue where VDC creation with storage profile `enabled=false` wasn't working. `VdcStorageProfile.enabled` and `VdcStorageProfileConfiguration.enabled` changed to pointers [GH-433] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/434-features.md: -------------------------------------------------------------------------------- 1 | * Add environment variable `GOVCD_API_VERSION` so API version can be set manually [GH-434] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/434-improvements.md: -------------------------------------------------------------------------------- 1 | * Bump Default API Version to V35.0 [GH-434] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/435-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix method `client.GetStorageProfileByHref` to return IOPS `IopsSettings` [GH-435] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/436-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * `Vms.VmReference` changed to array to fix incorrect deserialization [GH-436] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/436-features.md: -------------------------------------------------------------------------------- 1 | * Disk methods have now the ability to access new properties from API version 36.0. They are: `DiskRecordType.SharingType`, `DiskRecordType.UUID`, `DiskRecordType.Encrypted`, `Disk.SharingType`, `Disk.UUID` and `Disk.Encrypted` [GH-436] 2 | * New method added `Disk.GetAttachedVmsHrefs` [GH-436] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/438-features.md: -------------------------------------------------------------------------------- 1 | * Added support to set, get and delete metadata to AdminOrg with the methods 2 | `AdminOrg.AddMetadataEntry`, `AdminOrg.AddMetadataEntryAsync`, `AdminOrg.GetMetadata`, 3 | `AdminOrg.DeleteMetadataEntry` and `AdminOrg.DeleteMetadataEntryAsync`. [GH-438] 4 | * Added support to get metadata to Org with the method 5 | `Org.GetMetadata`. [GH-438] 6 | * Added support to set, get and delete metadata to Disk with the methods 7 | `Disk.AddMetadataEntry`, `Disk.AddMetadataEntryAsync`, `Disk.GetMetadata`, 8 | `Disk.DeleteMetadataEntry` and `Disk.DeleteMetadataEntryAsync`. [GH-438] 9 | -------------------------------------------------------------------------------- /.changes/v2.15.0/439-improvements.md: -------------------------------------------------------------------------------- 1 | * Add support for `User` entities imported from LDAP, with `IsExternal` property [GH-439] 2 | * Add support for users list attribute for `Group` [GH-439] 3 | * Improve `group.Update()` to avoid sending the users list to VCD to avoid unwanted errors [GH-449] 4 | -------------------------------------------------------------------------------- /.changes/v2.15.0/440-improvements.md: -------------------------------------------------------------------------------- 1 | * NSX-T Edge Gateway now supports VDC Groups by switching from `OrgVdc` to `OwnerRef` field. 2 | Additional methods `NsxtEdgeGateway.MoveToVdcOrVdcGroup()`, 3 | `Org.GetNsxtEdgeGatewayByNameAndOwnerId()`, `VdcGroup.GetNsxtEdgeGatewayByName()`, 4 | `VdcGroup.GetAllNsxtEdgeGateways()`, `org.GetVdcGroupById` [GH-440] 5 | * Additional helper functions `OwnerIsVdcGroup()`, `OwnerIsVdc()`, `VdcGroup.GetCapabilities()`, 6 | `VdcGroup.IsNsxt()` [GH-440] -------------------------------------------------------------------------------- /.changes/v2.15.0/441-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * `Catalog.QueryMediaList` method was not working because fmt.Sprintf was being misused [GH-441] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/442-improvements.md: -------------------------------------------------------------------------------- 1 | * Added support to set, get and delete metadata to VDC Networks with the methods 2 | `OrgVDCNetwork.AddMetadataEntry`, `OrgVDCNetwork.AddMetadataEntryAsync`, `OrgVDCNetwork.GetMetadata`, 3 | `OrgVDCNetwork.DeleteMetadataEntry` and `OrgVDCNetwork.DeleteMetadataEntryAsync` [GH-442] 4 | -------------------------------------------------------------------------------- /.changes/v2.15.0/443-features.md: -------------------------------------------------------------------------------- 1 | * Added new structure `AnyTypeEdgeGateway` which supports retreving both types of Edge Gateways 2 | (NSX-V and NSX-T) with methods `AdminOrg.GetAnyTypeEdgeGatewayById`, 3 | `Org.GetAnyTypeEdgeGatewayById`, `AnyTypeEdgeGateway.IsNsxt`, `AnyTypeEdgeGateway.IsNsxv`, 4 | `AnyTypeEdgeGateway.GetNsxtEdgeGateway` [GH-443] 5 | * Added functions `VdcGroup.GetCapabilities`, `VdcGroup.IsNsxt`, 6 | `VdcGroup.GetOpenApiOrgVdcNetworkByName`, `VdcGroup.GetAllOpenApiOrgVdcNetworks`, 7 | `Org.GetOpenApiOrgVdcNetworkByNameAndOwnerId` [GH-443] 8 | 9 | -------------------------------------------------------------------------------- /.changes/v2.15.0/444-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `CanPublishExternally` and `CanSubscribe` attributes to `OrgGeneralSettings` struct. [GH-444] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/450-features.md: -------------------------------------------------------------------------------- 1 | * Add method `AdminOrg.FindCatalogRecords` that allows to query `types.CatalogRecord` by their catalog name. [GH-450] 2 | * Add methods `Client.QueryWithNotEncodedParamsWithHeaders` and `Client.QueryWithNotEncodedParamsWithApiVersionWithHeaders` so HTTP headers can be added now when doing API queries. [GH-450] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/451-features.md: -------------------------------------------------------------------------------- 1 | * Added functions `VdcGroup.GetNsxtFirewallGroupByName` and `VdcGroup.GetNsxtFirewallGroupById` [GH-451] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/452-features.md: -------------------------------------------------------------------------------- 1 | * Add support for for Network Context Profile lookup using `GetAllNetworkContextProfiles` and 2 | `GetNetworkContextProfilesByNameScopeAndContext` functions [GH-452] 3 | * Add support for NSX-T Distributed Firewall rule management using type `DistributedFirewall` and 4 | `VdcGroup.GetDistributedFirewall`, `VdcGroup.UpdateDistributedFirewall`, 5 | `VdcGroup.DeleteAllDistributedFirewallRules`, `DistributedFirewall.DeleteAllRules` [GH-452] 6 | -------------------------------------------------------------------------------- /.changes/v2.15.0/454-features.md: -------------------------------------------------------------------------------- 1 | * Added support to set, get and delete metadata to the following resources via its HREF: 2 | `catalog`, `catalog item`, `edge gateway`, `independent disk`, `media`, `network`, `org`, `PVDC`, `PVDC storage profile`, `vApp`, `vApp template`,`VDC` and `VDC storage profile`; 3 | with the methods 4 | `VCDClient.GetMetadataByHref`, `VCDClient.AddMetadataEntryByHref`, `VCDClient.AddMetadataEntryByHrefAsync`, 5 | `VCDClient.DeleteMetadataEntryByHref` and `VCDClient.DeleteMetadataEntryByHrefAsync` [GH-454] 6 | -------------------------------------------------------------------------------- /.changes/v2.15.0/456-features.md: -------------------------------------------------------------------------------- 1 | * Added functions `VdcGroup.GetOpenApiOrgVdcNetworkById` and `VdcGroup.CreateOpenApiOrgVdcNetwork` [GH-456] 2 | -------------------------------------------------------------------------------- /.changes/v2.15.0/457-notes.md: -------------------------------------------------------------------------------- 1 | * Bump `staticcheck` version to 2022.1 with Go 1.18 support [GH-457] -------------------------------------------------------------------------------- /.changes/v2.15.0/458-improvements.md: -------------------------------------------------------------------------------- 1 | * Add workaround to tests for Org Catalog publishing bug when dealing with LDAP [GH-458] 2 | * Add clean-up actions to some tests that were uploading vAppTemplates/medias to catalogs [GH-458] 3 | -------------------------------------------------------------------------------- /.changes/v2.15.0/459-improvements.md: -------------------------------------------------------------------------------- 1 | * Added support to set, get and delete metadata to OpenAPI VDC Networks through XML with the methods 2 | `OpenApiOrgVdcNetwork.AddMetadataEntry`, `OpenApiOrgVdcNetwork.GetMetadata`, 3 | `OpenApiOrgVdcNetwork.DeleteMetadataEntry` [GH-459] 4 | -------------------------------------------------------------------------------- /.changes/v2.15.0/460-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `Vdc.GetNsxtAppPortProfileByName` and `VdcGroup.GetNsxtAppPortProfileByName` for NSX-T 2 | Application Port Profile lookup [GH-460] -------------------------------------------------------------------------------- /.changes/v2.16.0/465-features.md: -------------------------------------------------------------------------------- 1 | * Added support for `DnsServers` on `OpenApiOrgVdcNetworkDhcp` struct [GH-465] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/466-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed method `adminOrg.FindCatalogRecords` to escape name in query URL [GH-466] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/467-features.md: -------------------------------------------------------------------------------- 1 | * Added new methods `Org.GetAllSecurityTaggedEntities`, `Org.GetAllSecurityTaggedEntitiesByName`, `Org.GetAllSecurityTagValues`, `VM.GetVMSecurityTags`, `Org.UpdateSecurityTag` and `VM.UpdateVMSecurityTags` to deal with security tags [GH-467] 2 | * Added new structs `types.SecurityTag`, `types.SecurityTaggedEntity`, `types.SecurityTagValue` and `types.EntitySecurityTags` [GH-467] 3 | -------------------------------------------------------------------------------- /.changes/v2.16.0/468-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `org.GetVdcComputePolicyById`, `adminOrg.GetVdcComputePolicyById` [GH-468] 2 | * Deprecated `org.GetAllVdcComputePolicies`, `adminOrg.GetAllVdcComputePolicies`, `org.CreateVdcComputePolicy` [GH-468] 3 | -------------------------------------------------------------------------------- /.changes/v2.16.0/468-improvements.md: -------------------------------------------------------------------------------- 1 | * Added methods `client.CreateVdcComputePolicy`, `client.GetVdcComputePolicyById`, `client.GetAllVdcComputePolicies` [GH-468] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/469-improvements.md: -------------------------------------------------------------------------------- 1 | * Added additional methods for convenience of NSX-T Org Network DHCP handling 2 | `OpenApiOrgVdcNetwork.GetOpenApiOrgVdcNetworkDhcp`, `OpenApiOrgVdcNetwork.DeletNetworkDhcp` 3 | `OpenApiOrgVdcNetwork.UpdateDhcp` [GH-469] 4 | -------------------------------------------------------------------------------- /.changes/v2.16.0/470-features.md: -------------------------------------------------------------------------------- 1 | * Added `Vdc.GetControlAccess`, `Vdc.SetControlAccess` and `Vdc.DeleteControlAccess` to get, set and delete control access capabilities to VDCs [GH-470] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/471-features.md: -------------------------------------------------------------------------------- 1 | * Added support to set, get and delete metadata to CatalogItem with the methods 2 | `CatalogItem.AddMetadataEntry`, `CatalogItem.AddMetadataEntryAsync`, `CatalogItem.GetMetadata`, 3 | `CatalogItem.DeleteMetadataEntry` and `CatalogItem.DeleteMetadataEntryAsync`. [GH-471] 4 | -------------------------------------------------------------------------------- /.changes/v2.16.0/473-features.md: -------------------------------------------------------------------------------- 1 | * Added `AdminCatalog.MergeMetadata`,`AdminCatalog.MergeMetadataAsync`, `AdminOrg.MergeMetadata`, `AdminOrg.MergeMetadataAsync`, 2 | `CatalogItem.MergeMetadata`, `CatalogItem.MergeMetadataAsync`, `Disk.MergeMetadata`, `Disk.MergeMetadataAsync`, `Media.MergeMetadata`, 3 | `Media.MergeMetadataAsync`, `MediaRecord.MergeMetadata`, `MediaRecord.MergeMetadataAsync`, `OpenAPIOrgVdcNetwork.MergeMetadata`, 4 | `OpenAPIOrgVdcNetwork.MergeMetadataAsync`, `OrgVDCNetwork.MergeMetadata`, `OrgVDCNetwork.MergeMetadataAsync`, 5 | `VApp.MergeMetadata`, `VApp.MergeMetadataAsync`, `VAppTemplate.MergeMetadata`, `VAppTemplate.MergeMetadataAsync`, 6 | `VM.MergeMetadata`, `VM.MergeMetadataAsync`, `Vdc.MergeMetadata`, `Vdc.MergeMetadataAsync` to merge metadata, 7 | which both updates existing metadata with same key and adds new entries for the non-existent ones [GH-473] 8 | -------------------------------------------------------------------------------- /.changes/v2.16.0/478-features.md: -------------------------------------------------------------------------------- 1 | * Added NSX-T Edge Gateway methods `NsxtEdgeGateway.GetNsxtRouteAdvertisement`, 2 | `NsxtEdgeGateway.GetNsxtRouteAdvertisementWithContext`, 3 | `NsxtEdgeGateway.UpdateNsxtRouteAdvertisement`, 4 | `NsxtEdgeGateway.UpdateNsxtRouteAdvertisementWithContext`, 5 | `NsxtEdgeGateway.DeleteNsxtRouteAdvertisement` and 6 | `NsxtEdgeGateway.DeleteNsxtRouteAdvertisementWithContext` that allow to manage NSX-T Route 7 | Advertisement [GH-478, GH-480] 8 | -------------------------------------------------------------------------------- /.changes/v2.16.0/479-improvements.md: -------------------------------------------------------------------------------- 1 | * Added additional support for UDF type ISO files in `catalog.UploadMediaImage` [GH-479] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/480-features.md: -------------------------------------------------------------------------------- 1 | * Added new methods `NsxtEdgeGateway.GetBgpConfiguration`, `NsxtEdgeGateway.UpdateBgpConfiguration`, 2 | `NsxtEdgeGateway.DisableBgpConfiguration` for BGP Configuration management on NSX-T Edge Gateway 3 | [GH-480] 4 | * Added new structs `types.EdgeBgpConfig`, `types.EdgeBgpGracefulRestartConfig`, 5 | `types.EdgeBgpConfigVersion` for BGP Configuration management on NSX-T Edge Gateway [GH-480] 6 | -------------------------------------------------------------------------------- /.changes/v2.16.0/481-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed method `vm.WaitForDhcpIpByNicIndexes` to ignore not found Edge Gateway [GH-481] 2 | -------------------------------------------------------------------------------- /.changes/v2.16.0/485-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `SupportedFeatureSet` attribute to `NsxtAlbServiceEngineGroup` and `NsxtAlbConfig` to 2 | support v37.0 license management for AVI Load Balancer and replace `LicenseType` from 3 | `NsxtAlbController` [GH-485] 4 | -------------------------------------------------------------------------------- /.changes/v2.16.0/487-features.md: -------------------------------------------------------------------------------- 1 | * Added support for Dynamic Security Groups in VCD 10.3 by expanding `types.NsxtFirewallGroup` to 2 | accommodate fields required for Dynamic Security Groups, implemented automatic API elevation to 3 | v36.0. Added New functions `VdcGroup.CreateNsxtFirewallGroup`, 4 | `NsxtFirewallGroup.IsDynamicSecurityGroup` [GH-487] 5 | -------------------------------------------------------------------------------- /.changes/v2.16.0/488-features.md: -------------------------------------------------------------------------------- 1 | * Added support for managing NSX-T Edge Gateway BGP IP Prefix Lists. It is done by adding types `EdgeBgpIpPrefixList` and 2 | `types.EdgeBgpIpPrefixList` with functions `CreateBgpIpPrefixList`, `GetAllBgpIpPrefixLists`, 3 | `GetBgpIpPrefixListByName`, `GetBgpIpPrefixListById`, `Update` and `Delete` [GH-488] 4 | -------------------------------------------------------------------------------- /.changes/v2.16.0/489-features.md: -------------------------------------------------------------------------------- 1 | * Added support for managing NSX-T Edge Gateway BGP Neighbor. It is done by adding types `EdgeBgpNeighbor` and 2 | `types.EdgeBgpNeighbor` with functions `CreateBgpNeighbor`, `GetAllBgpNeighbors`, 3 | `GetBgpNeighborByIp`, `GetBgpNeighborById`, `Update` and `Delete` [GH-489] 4 | -------------------------------------------------------------------------------- /.changes/v2.17.0/413-improvements.md: -------------------------------------------------------------------------------- 1 | * Added method `VM.Shutdown` to shut down guest OS [GH-413], [GH-496] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/491-improvements.md: -------------------------------------------------------------------------------- 1 | * Add support for MoRef ID on VM record type. Using the MoRef ID, we can then correlate that back to vCenter Server and find the VM with matching MoRef ID [GH-491] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/494-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed type `types.AdminVdc.ResourcePoolRefs` to make unmarshaling work (read-only) [GH-494] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/495-features.md: -------------------------------------------------------------------------------- 1 | * Added new functions to get vApp Templates `Catalog.GetVAppTemplateByName`, `Catalog.GetVAppTemplateById`, `Catalog.GetVAppTemplateByNameOrId`, 2 | `Vdc.GetVAppTemplateByName`, `VCDClient.GetVAppTemplateByHref` and `VCDClient.GetVAppTemplateById` [GH-495], [GH-520] 3 | * Added new functions to query vApp Templates by name `Catalog.QueryVappTemplateWithName`, `Vdc.QueryVappTemplateWithName`, `AdminVdc.QueryVappTemplateWithName` [GH-495] 4 | * Added new functions to delete vApp Templates `VAppTemplate.DeleteAsync` and `VAppTemplate.Delete` [GH-495] 5 | * Added new functions to extract information from vApp Templates `VAppTemplate.GetCatalogName` and `VAppTemplate.GetVdcName` [GH-495] 6 | -------------------------------------------------------------------------------- /.changes/v2.17.0/497-notes.md: -------------------------------------------------------------------------------- 1 | * Ran `make fmt` using Go 1.19 release (`fmt` automatically changes doc comment structure). This 2 | will prevent `make static` errors when running tests in pipeline using Go 1.19 [GH-497] 3 | * Updated branding `vCloud Director` -> `VMware Cloud Director` [GH-497] 4 | * Go officially supports 2 last releases. With Go 1.19 being released it means that Go 1.18 is the 5 | minimum officially supported Go version and this set our hands free to use generics in this SDK 6 | (if there is a need for it). `go.mod` is updated to reflect Go minimum version 1.18 [GH-497] 7 | * package `io/ioutil` is deprecated as of Go 1.16. `staticcheck` started complaining about usage of 8 | deprecated packages. As a result this PR switches packages to either `io` or `os` (still the same 9 | functions are used) [GH-497] 10 | * Adjusted `staticcheck` version naming to new format (from `2021.1.2` to `v0.3.3`) [GH-497] 11 | -------------------------------------------------------------------------------- /.changes/v2.17.0/498-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed Test_NsxtSecurityGroupGetAssociatedVms which had name clash [GH-498] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/499-improvements.md: -------------------------------------------------------------------------------- 1 | * Added support for querying VdcStorageProfile: 2 | - functions `QueryAdminOrgVdcStorageProfileByID` and `QueryOrgVdcStorageProfileByID` 3 | - query types `QtOrgVdcStorageProfile` and `QtAdminOrgVdcStorageProfile` 4 | - data struct `QueryResultAdminOrgVdcStorageProfileRecordType` (non admin struct already was here) 5 | [GH-499] 6 | -------------------------------------------------------------------------------- /.changes/v2.17.0/500-improvements.md: -------------------------------------------------------------------------------- 1 | * Bumped Default API Version to V36.0 (VCD 10.3+) [GH-500] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/501-features.md: -------------------------------------------------------------------------------- 1 | * Added `Client.TestConnection` method to check remote VCD endpoints [GH-447], [GH-501] 2 | * Added `Client.TestConnectionWithDefaults` method that uses `Client.TestConnection` with some 3 | default values [GH-447], [GH-501] 4 | * Changed behavior of `Client.OpenApiPostItem` and `Client.OpenApiPostItemSync` so they accept 5 | response code 200 OK as valid. The reason is `TestConnection` endpoint requires a POST request and 6 | returns a 200OK when successful [GH-447], [GH-501] 7 | -------------------------------------------------------------------------------- /.changes/v2.17.0/502-features.md: -------------------------------------------------------------------------------- 1 | * Added new methods `VCDClient.GetProviderVdcByHref`, `VCDClient.GetProviderVdcById`, `VCDClient.GetProviderVdcByName` and `ProviderVdc.Refresh` to retrieve Provider VDCs [GH-502] 2 | * Added new methods `VCDClient.GetProviderVdcExtendedByHref`, `VCDClient.GetProviderVdcExtendedById`, `VCDClient.GetProviderVdcExtendedByName` and `ProviderVdcExtended.Refresh` to retrieve the extended flavor of Provider VDCs [GH-502] 3 | * Added new methods `ProviderVdcExtended.ToProviderVdc`, to convert from an extended Provider VDC to a regular one [GH-502] 4 | * Added new methods `ProviderVdc.GetMetadata`, `ProviderVdc.AddMetadataEntry`, `ProviderVdc.AddMetadataEntryAsync`, `ProviderVdc.MergeMetadataAsync`, `ProviderVdc.MergeMetadata`, `ProviderVdc.DeleteMetadataEntry` and `ProviderVdc.DeleteMetadataEntryAsync` to manage Provider VDCs metadata [GH-502] 5 | -------------------------------------------------------------------------------- /.changes/v2.17.0/502-improvements.md: -------------------------------------------------------------------------------- 1 | * Created new VDC Compute Policies CRUD methods using OpenAPI v2.0.0: 2 | `VCDClient.GetVdcComputePolicyV2ById`, `VCDClient.GetAllVdcComputePoliciesV2`, `VCDClient.CreateVdcComputePolicyV2`, 3 | `VdcComputePolicyV2.Update`, `VdcComputePolicyV2.Delete` and `AdminVdc.GetAllAssignedVdcComputePoliciesV2`. 4 | This version supports more filtering options like `isVgpuPolicy` [GH-502], [GH-504], [GH-507] 5 | -------------------------------------------------------------------------------- /.changes/v2.17.0/503-enhancement.md: -------------------------------------------------------------------------------- 1 | * Added new field `HostName` in `QueryResultVMRecordType` struct: 2 | * String field containing the hostName value from the XML VMAdminRecord body retrieved 3 | * This info can help to link VM with a cluster since hypervisor is known [GH-503] -------------------------------------------------------------------------------- /.changes/v2.17.0/504-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Changed `VdcComputePolicy.Description` to a non-omitempty pointer, to be able to send null values to VCD to set empty descriptions. [GH-504] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/504-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated OpenAPI v1.0.0 VDC Compute Policies CRUD methods in favor of v2.0.0 ones: 2 | `Client.GetVdcComputePolicyById`, `Client.GetAllVdcComputePolicies`, `Client.CreateVdcComputePolicy` 3 | `VdcComputePolicy.Update`, `VdcComputePolicy.Delete` and `AdminVdc.GetAllAssignedVdcComputePolicies` [GH-504] 4 | -------------------------------------------------------------------------------- /.changes/v2.17.0/504-features.md: -------------------------------------------------------------------------------- 1 | * Added new methods `VCDClient.GetVmGroupById`, `VCDClient.GetVmGroupByNamedVmGroupIdAndProviderVdcUrn` and `VCDClient.GetVmGroupByNameAndProviderVdcUrn` to retrieve VM Groups. These are useful to create VM Placement Policies [GH-504] 2 | * Added new methods `VCDClient.GetLogicalVmGroupById`, `VCDClient.CreateLogicalVmGroup` and `LogicalVmGroup.Delete` to manage Logical VM Groups. These are useful to create VM Placement Policies [GH-504] 3 | -------------------------------------------------------------------------------- /.changes/v2.17.0/505-improvements.md: -------------------------------------------------------------------------------- 1 | * Simplified `Test_LDAP` by using a pre-configured LDAP server [GH-505] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/510-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated the functions `VCDClient.AddMetadataEntryByHrefAsync` 2 | and `VCDClient.AddMetadataEntryByHref` in favor of `VCDClient.AddMetadataEntryWithVisibilityByHrefAsync` 3 | and `VCDClient.AddMetadataEntryWithVisibilityByHref` [GH-510] 4 | * Deprecated the functions `VCDClient.MergeMetadataByHrefAsync` 5 | and `VCDClient.MergeMetadataByHref` in favor of `VCDClient.MergeMetadataWithVisibilityByHrefAsync` 6 | and `VCDClient.MergeMetadataWithVisibilityByHref` [GH-510] 7 | * Deprecated the functions `AddMetadataEntryAsync` and `AddMetadataEntry` from the following entities: 8 | `VM`, `Vdc`, `AdminVdc`, `ProviderVdc`, `VApp`, `VAppTemplate`, `MediaRecord`, `Media`, `AdminCatalog`, `AdminOrg`, `Disk`, 9 | `OrgVDCNetwork`, `CatalogItem` in favor of their `AddMetadataEntryWithVisibilityAsync` and `AddMetadataEntryWithVisibility` 10 | counterparts [GH-510] 11 | * Deprecated the functions `MergeMetadataAsync` and `MergeMetadataAsync` from the following entities: 12 | `VM`, `Vdc`, `AdminVdc`, `ProviderVdc`, `VApp`, `VAppTemplate`, `MediaRecord`, `Media`, `AdminCatalog`, `AdminOrg`, `Disk`, 13 | `OrgVDCNetwork`, `CatalogItem` in favor of their `MergeMetadataWithMetadataValuesAsync` and `MergeMetadataWithMetadataValues` 14 | counterparts [GH-510] 15 | * Deprecated the functions `DeleteMetadata` and `DeleteMetadataAsync` from the following entities: 16 | `VM`, `Vdc`, `AdminVdc`, `ProviderVdc`, `VApp`, `VAppTemplate`, `MediaRecord`, `Media`, `AdminCatalog`, `AdminOrg`, `Disk`, 17 | `OrgVDCNetwork`, `CatalogItem` in favor of their `DeleteMetadataWithDomainAsync` and `DeleteMetadataWithDomain` 18 | counterparts [GH-510] 19 | -------------------------------------------------------------------------------- /.changes/v2.17.0/512-improvements.md: -------------------------------------------------------------------------------- 1 | * Added VCDClient.GetAllNsxtEdgeClusters for lookup of NSX-T Edge Clusters in wider scopes - 2 | Provider VDC, VDC Group or VDC [GH-512] 3 | * Switched VDC.GetAllNsxtEdgeClusters to use 'orgVdcId' filter instead of '_context' (now deprecated) 4 | [GH-512] 5 | -------------------------------------------------------------------------------- /.changes/v2.17.0/513-improvements.md: -------------------------------------------------------------------------------- 1 | * Created `VM.UpdateComputePolicyV2` and `VM.UpdateComputePolicyV2Async` that uses v2.0.0 of VDC Compute Policy endpoint 2 | of OpenAPI and allows updating VM Sizing Policies and also VM Placement Policies for a given VM [GH-513] 3 | -------------------------------------------------------------------------------- /.changes/v2.17.0/515-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `[]tenant` structure to simplify org user testing [GH-515] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/516-notes.md: -------------------------------------------------------------------------------- 1 | * Added a new GitHub Action to run `gosec` on every push and pull request [GH-516] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/517-notes.md: -------------------------------------------------------------------------------- 1 | * Improved documentation for `types.OpenApiOrgVdcNetworkDhcp` [GH-517] 2 | -------------------------------------------------------------------------------- /.changes/v2.17.0/518-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed issue [#514](https://github.com/vmware/go-vcloud-director/issues/514) "ignoring pagination 2 | in network queries" [GH-518] 3 | -------------------------------------------------------------------------------- /.changes/v2.17.0/520-features.md: -------------------------------------------------------------------------------- 1 | * Added `VCDClient.QueryMediaById` to query a media record using a media ID [GH-520] 2 | * Added `Vdc.QueryVappSynchronizedVmTemplate` to query a VM inside a vApp Template that must be synchronized in the catalog [GH-520] 3 | * Added `VCDClient.QueryVmInVAppTemplateByHref` and `VCDClient.QuerySynchronizedVmInVAppTemplateByHref` to query a VM 4 | inside a vApp Template by using the latter's hyper-reference [GH-520] 5 | * Added `VCDClient.QuerySynchronizedVAppTemplateById` to get a synchronized vApp Template query record from a vApp Template ID [GH-520] 6 | -------------------------------------------------------------------------------- /.changes/v2.17.0/520-improvements.md: -------------------------------------------------------------------------------- 1 | * Improved `Vdc.QueryVappVmTemplate` to avoid querying VMs in vApp Templates that are not synchronized in the catalog [GH-520] 2 | -------------------------------------------------------------------------------- /.changes/v2.18.0/530-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed issue that caused VM Group retrieval to fail if the Provider VDC had more than one Resource Pool [GH-530] 2 | -------------------------------------------------------------------------------- /.changes/v2.18.0/530-features.md: -------------------------------------------------------------------------------- 1 | * Added `VCDClient.GetAllAssignedVdcComputePoliciesV2` to retrieve Compute Policies without the need of an `AdminVdc` receiver [GH-530] 2 | -------------------------------------------------------------------------------- /.changes/v2.18.0/531-features.md: -------------------------------------------------------------------------------- 1 | * Added `client` methods `QueryCatalogRecords` and `GetCatalogByHref` [GH-531] 2 | -------------------------------------------------------------------------------- /.changes/v2.18.0/533-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed issue that prevented Org update because of wrong field position in LDAP settings [GH-533] 2 | -------------------------------------------------------------------------------- /.changes/v2.19.0/537-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Removed URL checks from `CreateCatalogFromSubscriptionAsync` to allow catalog creation from non-VCD entities, such as vSphere shared library [GH-537] 2 | -------------------------------------------------------------------------------- /.changes/v2.19.0/537-features.md: -------------------------------------------------------------------------------- 1 | * Added client methods `GetCatalogByHref`, `GetCatalogById`, `GetCatalogByName` to retrieve Catalogs without an Org object [GH-537] 2 | * Added client methods `GetAdminCatalogByHref`, `GetAdminCatalogById`, `GetAdminCatalogByName` to retrieve AdminCatalogs without an AdminOrg object [GH-537] 3 | * Added method `VAppTemplate.GetVappTemplateRecord` to retrieve a VAppTemplate query record [GH-537] 4 | -------------------------------------------------------------------------------- /.changes/v2.19.0/538-notes.md: -------------------------------------------------------------------------------- 1 | * Amended a quirky test `Test_CreateOrgVdcWithFlex` that failed randomly due to recovered VDC Storage Profiles being unordered [GH-538] 2 | * Amended a quirky test `Test_VMPowerOnPowerOff` that failed due to the testing VM not being powered off fast enough [GH-538] 3 | -------------------------------------------------------------------------------- /.changes/v2.19.0/540-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed flaky test `Test_CatalogAccessAsOrgUsers` that failed randomly for timing issues [GH-540] 2 | -------------------------------------------------------------------------------- /.changes/v2.20.0/521-features.md: -------------------------------------------------------------------------------- 1 | * Added method `AdminVdc.IsNsxv` to detect whether an Admin VDC is NSX-V [GH-521] 2 | * Added function `NewNsxvDistributedFirewall` to create a new NSX-V distributed firewall [GH-521] 3 | * Added `NsxvDistributedFirewall` methods `GetConfiguration`, `IsEnabled`, `Enable`, `Disable`, `UpdateConfiguration`, `Refresh` to handle CRUD operations with NSX-V distributed firewalls [GH-521] 4 | * Added `NsxvDistributedFirewall` methods `GetServices`, `GetServiceGroups`, `GetServiceById`, `GetServiceByName`, `GetServiceGroupById`, `GetServiceGroupByName` to retrieve specific services or service groups [GH-521] 5 | * Added `NsxvDistributedFirewall` methods `GetServicesByRegex` and `GetServiceGroupsByRegex` to search services or service groups by regular expression [GH-521] 6 | -------------------------------------------------------------------------------- /.changes/v2.20.0/527-features.md: -------------------------------------------------------------------------------- 1 | * Added support for Runtime Defined Entity Interfaces with client methods `VCDClient.CreateDefinedInterface`, `VCDClient.GetAllDefinedInterfaces`, 2 | `VCDClient.GetDefinedInterface`, `VCDClient.GetDefinedInterfaceById` and methods to manipulate them `DefinedInterface.Update`, 3 | `DefinedInterface.Delete` [GH-527, GH-566] 4 | -------------------------------------------------------------------------------- /.changes/v2.20.0/528-features.md: -------------------------------------------------------------------------------- 1 | * Added method `VM.GetEnvironment` to retrieve OVF Environment [GH-528] -------------------------------------------------------------------------------- /.changes/v2.20.0/532-features.md: -------------------------------------------------------------------------------- 1 | * Added `NsxtEdgeGateway.Refresh` method to reload NSX-T Edge Gateway structure [GH-532] 2 | * Added `NsxtEdgeGateway.GetUsedIpAddresses` method to fetch used IP addresses in NSX-T Edge 3 | Gateway [GH-532] 4 | * Added `NsxtEdgeGateway.GetUsedIpAddressSlice` method to fetch used IP addresses in a slice 5 | [GH-532] 6 | * Added `NsxtEdgeGateway.GetUnusedExternalIPAddresses` method that can help to find an unused 7 | IP address in an Edge Gateway by given constraints [GH-532,GH-567] 8 | * Added `NsxtEdgeGateway.GetAllUnusedExternalIPAddresses` method that can return all unused IP 9 | addresses in an Edge Gateway [GH-532,GH-567] 10 | * Added `NsxtEdgeGateway.GetAllocatedIpCount` method that sums up `TotalIPCount` fields in all 11 | subnets [GH-532] 12 | * Added `NsxtEdgeGateway.QuickDeallocateIpCount` and `NsxtEdgeGateway.DeallocateIpCount` 13 | methods to manually alter Edge Gateway body for IP deallocation [GH-532] 14 | -------------------------------------------------------------------------------- /.changes/v2.20.0/536-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix a bug that prevented returning a specific error while authenticating client with invalid 2 | password [GH-536] 3 | -------------------------------------------------------------------------------- /.changes/v2.20.0/544-features.md: -------------------------------------------------------------------------------- 1 | * Added support for Runtime Defined Entity instances with methods `DefinedEntityType.GetAllRdes`, `DefinedEntityType.GetRdeByName`, 2 | `DefinedEntityType.GetRdeById`, `DefinedEntityType.CreateRde` and methods to manipulate them `DefinedEntity.Resolve`, 3 | `DefinedEntity.Update`, `DefinedEntity.Delete` [GH-544] 4 | * Add generic `Client` methods `OpenApiPostItemAndGetHeaders` and `OpenApiGetItemAndHeaders` to be able to retrieve the 5 | response headers when performing a POST or GET operation to an OpenAPI endpoint [GH-544] 6 | -------------------------------------------------------------------------------- /.changes/v2.20.0/545-features.md: -------------------------------------------------------------------------------- 1 | * Added support for Runtime Defined Entity Types with client methods `VCDClient.CreateRdeType`, `VCDClient.GetAllRdeTypes`, 2 | `VCDClient.GetRdeType`, `VCDClient.GetRdeTypeById` and methods to manipulate them `DefinedEntityType.Update`, 3 | `DefinedEntityType.Delete` [GH-545, GH-566] 4 | -------------------------------------------------------------------------------- /.changes/v2.20.0/546-notes.md: -------------------------------------------------------------------------------- 1 | * Created `Test_RenameCatalog` for making sure the contents of the Catalog don't change after rename [GH-546] 2 | -------------------------------------------------------------------------------- /.changes/v2.20.0/549-improvements.md: -------------------------------------------------------------------------------- 1 | * NSX-T ALB settings for Edge Gateway gain support for IPv6 service network definition (VCD 10.4.0+) 2 | and Transparent mode (VCD 10.4.1+) by adding new fields to `types.NsxtAlbConfig` and automatically 3 | elevating API up to 37.1 [GH-549] 4 | -------------------------------------------------------------------------------- /.changes/v2.20.0/550-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed accessing uninitialized `Features` field while updating a vApp network [GH-550] -------------------------------------------------------------------------------- /.changes/v2.20.0/550-improvements.md: -------------------------------------------------------------------------------- 1 | * Added support for using subnet prefix length while creating vApp networks [GH-550] -------------------------------------------------------------------------------- /.changes/v2.20.0/553-improvements.md: -------------------------------------------------------------------------------- 1 | * Improve NSX-T IPSec VPN type `types.NsxtIpSecVpnTunnel` to support 'Certificate' Authentication 2 | mode [GH-553] 3 | -------------------------------------------------------------------------------- /.changes/v2.20.0/560-improvements.md: -------------------------------------------------------------------------------- 1 | * Add new field `TransparentModeEnabled` to `types.NsxtAlbVirtualService` which allows to preserve 2 | client IP for NSX-T ALB Virtual Service (VCD 10.4.1+) [GH-560] 3 | * Add new field `MemberGroupRef` to `types.NsxtAlbPool` which allows to define NSX-T ALB Pool 4 | membership by using Edge Firewall Group (`NsxtFirewallGroup`) instead of plain IPs (VCD 10.4.1+) 5 | [GH-560] 6 | -------------------------------------------------------------------------------- /.changes/v2.20.0/561-features.md: -------------------------------------------------------------------------------- 1 | * Add support for NSX-T DHCP Bindings via `OpenApiOrgVdcNetworkDhcpBinding`, 2 | `types.OpenApiOrgVdcNetworkDhcpBinding` and functions 3 | `OpenApiOrgVdcNetwork.CreateOpenApiOrgVdcNetworkDhcpBinding`, 4 | `OpenApiOrgVdcNetwork.GetAllOpenApiOrgVdcNetworkDhcpBindings`, 5 | `OpenApiOrgVdcNetwork.GetOpenApiOrgVdcNetworkDhcpBindingById`, 6 | `OpenApiOrgVdcNetwork.GetOpenApiOrgVdcNetworkDhcpBindingByName`, 7 | `OpenApiOrgVdcNetworkDhcpBinding.Update`, `OpenApiOrgVdcNetworkDhcpBinding.Refresh`, 8 | `OpenApiOrgVdcNetworkDhcpBinding.Delete` [GH-561] 9 | -------------------------------------------------------------------------------- /.changes/v2.20.0/561-improvements.md: -------------------------------------------------------------------------------- 1 | * `types.OpenApiOrgVdcNetwork` gets a new read only field `OrgVdcIsNsxTBacked` (available since API 2 | 36.0) which indicates if an Org Network is backed by NSX-T and a function 3 | `OpenApiOrgVdcNetwork.IsNsxt()` [GH-561] 4 | -------------------------------------------------------------------------------- /.changes/v2.20.0/562-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `SetServiceAccountApiToken` method of `*VCDClient` that allows 2 | authenticating using a service account token file and handles the refresh token rotation [GH-562] 3 | -------------------------------------------------------------------------------- /.changes/v2.20.0/563-features.md: -------------------------------------------------------------------------------- 1 | * Added QoS Profile lookup functions `GetAllNsxtEdgeGatewayQosProfiles` and 2 | `GetNsxtEdgeGatewayQosProfileByDisplayName` [GH-563] 3 | * Added NSX-T Edge Gateway QoS (Rate Limiting) configuration support `NsxtEdgeGateway.GetQoS` and 4 | `NsxtEdgeGateway.UpdateQoS` [GH-563] 5 | -------------------------------------------------------------------------------- /.changes/v2.20.0/564-features.md: -------------------------------------------------------------------------------- 1 | * Add support for importable Distributed Virtual Port Group (DVPG) read via types 2 | `VcenterImportableDvpg` and `types.VcenterImportableDvpg` and methods 3 | `VCDClient.GetVcenterImportableDvpgByName`, `VCDClient.GetAllVcenterImportableDvpgs`, 4 | `Vdc.GetVcenterImportableDvpgByName`, `Vdc.GetAllVcenterImportableDvpgs` [GH-564] 5 | -------------------------------------------------------------------------------- /.changes/v2.21.0/571-notes.md: -------------------------------------------------------------------------------- 1 | * Internal - replaced 'takeStringPointer', 'takeIntAddress', 'takeBoolPointer' with generic 'addrOf' 2 | [GH-571] -------------------------------------------------------------------------------- /.changes/v2.21.0/572-notes.md: -------------------------------------------------------------------------------- 1 | * Changed Org enablement status during tests for VCD 10.4.2, to circumvent a VCD bug that prevents creation of disabled Orgs [GH-572] 2 | -------------------------------------------------------------------------------- /.changes/v2.21.0/573-features.md: -------------------------------------------------------------------------------- 1 | * Added NSX-T Edge Gateway DHCP forwarding configuration support `NsxtEdgeGateway.GetDhcpForwarder` and 2 | `NsxtEdgeGateway.UpdateDhcpForwarder` [GH-573] 3 | -------------------------------------------------------------------------------- /.changes/v2.21.0/574-notes.md: -------------------------------------------------------------------------------- 1 | * Skipped test `Test_VdcDuplicatedVmPlacementPolicyGetsACleanError` in 10.4.2 as the relevant bug we check for is fixed in that version [GH-574] 2 | -------------------------------------------------------------------------------- /.changes/v2.21.0/575-features.md: -------------------------------------------------------------------------------- 1 | * Added methods to create, get, publish and delete UI Plugins `VCDClient.AddUIPlugin`, `VCDClient.GetAllUIPlugins`, 2 | `VCDClient.GetUIPluginById`, `VCDClient.GetUIPlugin`, `UIPlugin.Update`, `UIPlugin.GetPublishedTenants`, 3 | `UIPlugin.PublishAll`, `UIPlugin.UnpublishAll`, `UIPlugin.Publish`, `UIPlugin.Unpublish`, `UIPlugin.IsTheSameAs` and `UIPlugin.Delete` [GH-575] 4 | -------------------------------------------------------------------------------- /.changes/v2.21.0/576-features.md: -------------------------------------------------------------------------------- 1 | * Added AdminOrg methods `GetFederationSettings`, `SetFederationSettings`, `UnsetFederationSettings` to handle organization SAML settings [GH-576] 2 | * Added AdminOrg methods `GetServiceProviderSamlMetadata` and `RetrieveServiceProviderSamlMetadata` to retrieve service provider metadata for current organization [GH-576] 3 | * Added method `Client.RetrieveRemoteDocument` to download a document from a URL [GH-576] 4 | * Added function `ValidateSamlServiceProviderMetadata` to validate service oprovider metadata [GH-576] 5 | * Added function `GetErrorMessageFromErrorSlice` to return a single string from a slice of errors [GH-576] 6 | -------------------------------------------------------------------------------- /.changes/v2.21.0/577-features.md: -------------------------------------------------------------------------------- 1 | * Added Service Account CRUD support via `ServiceAccount` and `types.ServiceAccount`: `VCDClient.CreateServiceAccount`, 2 | `Org.GetServiceAccountById`, `Org.GetAllServiceAccounts`, `Org.GetServiceAccountByName`, 3 | `ServiceAccount.Update`, `ServiceAccount.Authorize`, `ServiceAccount.Grant`, `ServiceAccount.Refresh`, 4 | `ServiceAccount.Revoke`, `*ServiceAccount.Delete`, `*ServiceAccount.GetInitialApiToken` [GH-577] 5 | * Added API Token CRUD support via `Token` and `types.Token`: `VCDClient.CreateToken`,`VCDClient.GetTokenById`, 6 | `VCDClient.GetAllTokens`,`VCDClient.GetTokenByNameAndUsername`, `VCDClient.RegisterToken` , `Token.GetInitialApiToken`, `Token.Delete`, `Client.GetApiToken` [GH-577] 7 | 8 | -------------------------------------------------------------------------------- /.changes/v2.21.0/578-features.md: -------------------------------------------------------------------------------- 1 | * Added IP Space CRUD support via `IpSpace` and `types.IpSpace` and `VCDClient.CreateIpSpace`, 2 | `VCDClient.GetAllIpSpaceSummaries`, `VCDClient.GetIpSpaceById`, `VCDClient.GetIpSpaceByName`, 3 | `VCDClient.GetIpSpaceByNameAndOrgId`, `IpSpace.Update`, `IpSpace.Delete` [GH-578] 4 | -------------------------------------------------------------------------------- /.changes/v2.21.0/579-features.md: -------------------------------------------------------------------------------- 1 | * Added IP Space Uplink CRUD support via `IpSpaceUplink` and `types.IpSpaceUplink` and 2 | `VCDClient.CreateIpSpaceUplink`, `VCDClient.GetAllIpSpaceUplinks`, 3 | `VCDClient.GetIpSpaceUplinkById`, `VCDClient.GetIpSpaceUplinkByName`, `IpSpaceUplink.Update`, 4 | `IpSpaceUplink.Delete` [GH-579] 5 | * Added IP Space Allocation CRUD support via `IpSpaceIpAllocation`, `types.IpSpaceIpAllocation`, 6 | `types.IpSpaceIpAllocationRequest`, `types.IpSpaceIpAllocationRequestResult`. Methods 7 | `IpSpace.AllocateIp`, `Org.IpSpaceAllocateIp`, `Org.GetIpSpaceAllocationByTypeAndValue`, 8 | `IpSpace.GetAllIpSpaceAllocations`, `Org.GetIpSpaceAllocationById`, `IpSpaceIpAllocation.Update`, 9 | `IpSpaceIpAllocation.Delete` [GH-579] 10 | * Added IP Space Org assignment to support Custom Quotas via `IpSpaceOrgAssignment`, 11 | `types.IpSpaceOrgAssignment`, `IpSpace.GetAllOrgAssignments`, `IpSpace.GetOrgAssignmentById`, 12 | `IpSpace.GetOrgAssignmentByOrgName`, `IpSpace.GetOrgAssignmentByOrgId`, 13 | `IpSpaceOrgAssignment.Update` [GH-579] -------------------------------------------------------------------------------- /.changes/v2.21.0/579-improvements.md: -------------------------------------------------------------------------------- 1 | * `ExternalNetworkV2` now supports IP Spaces on VCD 10.4.1+ with new fields `UsingIpSpace` and 2 | `DedicatedOrg` [GH-579] -------------------------------------------------------------------------------- /.changes/v2.21.0/580-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed [Issue #1066](https://github.com/vmware/terraform-provider-vcd/issues/1066) - Not possible to handle more than 128 storage profiles [GH-580] 2 | -------------------------------------------------------------------------------- /.changes/v2.21.0/580-features.md: -------------------------------------------------------------------------------- 1 | * Added method `VCDClient.QueryNsxtManagerByHref` to retrieve a NSX-T manager by its ID/HREF [GH-580] 2 | * Added method `VCDClient.CreateProviderVdc` to create a Provider VDC [GH-580] 3 | * Added method `VCDClient.ResourcePoolsFromIds` to convert list of IDs to resource pools [GH-580] 4 | * Added `ProviderVdcExtended` methods `AddResourcePools`, `AddStorageProfiles`, `Delete`, `DeleteResourcePools`,`DeleteStorageProfiles`,`Disable`,`Enable`,`GetResourcePools`,`IsEnabled`,`Rename`,`Update` to fully manage a provider VDC [GH-580] 5 | * Added method `NetworkPool.GetOpenApiUrl` to generate the full URL of a network pool [GH-580] 6 | * Added `ResourcePool` methods `GetAvailableHardwareVersions` and `GetDefaultHardwareVersion` to get hardware versions [GH-580] 7 | * Added `VCDClient` method `GetAllResourcePools` to retrieve all resource pools regardless of vCenter affiliation [GH-580] 8 | * Added `VCDClient` method `GetAllVcenters` to retrieve all vCenters [GH-580] 9 | * Added `VCDClient` methods `GetNetworkPoolById`,`GetNetworkPoolByName`,`GetNetworkPoolSummaries` to retrieve network pools [GH-580] 10 | * Added `VCDClient` methods `GetVcenterById`,`GetVcenterByName` to retrieve vCenters [GH-580] 11 | * Added `VCenter` methods `GetAllResourcePools`,`VCenter.GetResourcePoolById`,`VCenter.GetResourcePoolByName` to retrieve resource pools [GH-580] 12 | * Added `VCenter` methods `GetAllStorageProfiles`,`GetStorageProfileById`,`GetStorageProfileByName` to retrieve storage profiles [GH-580] 13 | * Added method `VCenter.GetVimServerUrl` to retrieve the full URL of a vCenter within a VCD [GH-580] 14 | -------------------------------------------------------------------------------- /.changes/v2.21.0/581-improvements.md: -------------------------------------------------------------------------------- 1 | * Add a new function `WithIgnoredMetadata` to configure the `Client` to ignore specific metadata entries 2 | in all non-deprecated metadata CRUD methods [GH-581] 3 | -------------------------------------------------------------------------------- /.changes/v2.21.0/582-features.md: -------------------------------------------------------------------------------- 1 | * Added NSX-T Edge Gateway SLAAC Profile (DHCPv6) configuration support 2 | `NsxtEdgeGateway.GetSlaacProfile` and `NsxtEdgeGateway.UpdateSlaacProfile` [GH-582] 3 | -------------------------------------------------------------------------------- /.changes/v2.21.0/582-improvements.md: -------------------------------------------------------------------------------- 1 | * NSX-T ALB Virtual Service supports IPv6 Virtual Service using field`IPv6VirtualIpAddress` in 2 | `types.NsxtAlbVirtualService` for VCD 10.4.0+ [GH-582] 3 | * Add field `EnableDualSubnetNetwork` to enable Dual-Stack mode for Org VDC networks in 4 | `types.OpenApiOrgVdcNetwork` [GH-582] 5 | -------------------------------------------------------------------------------- /.changes/v2.21.0/583-notes.md: -------------------------------------------------------------------------------- 1 | * Added `unit` step to GitHub Actions [GH-583] 2 | -------------------------------------------------------------------------------- /.changes/v2.21.0/584-features.md: -------------------------------------------------------------------------------- 1 | * Added RDE Defined Interface Behaviors support with methods `DefinedInterface.AddBehavior`, `DefinedInterface.GetAllBehaviors`, 2 | `DefinedInterface.GetBehaviorById` `DefinedInterface.GetBehaviorByName`, `DefinedInterface.UpdateBehavior` and 3 | `DefinedInterface.DeleteBehavior` [GH-584] 4 | * Added RDE Defined Entity Type Behaviors support with methods `DefinedEntityType.GetAllBehaviors`, 5 | `DefinedEntityType.GetBehaviorById` `DefinedEntityType.GetBehaviorByName`, `DefinedEntityType.UpdateBehaviorOverride` and 6 | `DefinedEntityType.DeleteBehaviorOverride` [GH-584] 7 | * Added RDE Defined Entity Type Behavior Access Controls support with methods `DefinedEntityType.GetAllBehaviorsAccessControls` and 8 | `DefinedEntityType.SetBehaviorAccessControls` [GH-584] 9 | * Added method to invoke Behaviors on Defined Entities `DefinedEntity.InvokeBehavior` and `DefinedEntity.InvokeBehaviorAndMarshal` [GH-584] 10 | -------------------------------------------------------------------------------- /.changes/v2.21.0/586-features.md: -------------------------------------------------------------------------------- 1 | * Added support for NSX-T Edge Gateway Static Route configuration via types 2 | `NsxtEdgeGatewayStaticRoute`, `types.NsxtEdgeGatewayStaticRoute` and methods 3 | `NsxtEdgeGateway.CreateStaticRoute`, `NsxtEdgeGateway.GetAllStaticRoutes`, 4 | `NsxtEdgeGateway.GetStaticRouteByNetworkCidr`, `NsxtEdgeGateway.GetStaticRouteByName`, 5 | `NsxtEdgeGateway.GetStaticRouteById`, `NsxtEdgeGatewayStaticRoute.Update`, 6 | `NsxtEdgeGatewayStaticRoute.Delete` [GH-586] 7 | -------------------------------------------------------------------------------- /.changes/v2.21.0/587-features.md: -------------------------------------------------------------------------------- 1 | * Added types and methods `DistributedFirewallRule`, `VdcGroup.CreateDistributedFirewallRule`, 2 | `DistributedFirewallRule.Update`, `.DistributedFirewallRuleDelete` to manage NSX-T Distributed 3 | Firewall Rules one by one (opposed to managing all at once using `DistributedFirewall`) [GH-587] 4 | -------------------------------------------------------------------------------- /.changes/v2.21.0/588-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated method `Vdc.InstantiateVAppTemplate` (wrong implementation and result) in favor of `Vdc.CreateVappFromTemplate` [GH-588] 2 | -------------------------------------------------------------------------------- /.changes/v2.21.0/588-features.md: -------------------------------------------------------------------------------- 1 | * Added method `Vdc.CreateVappFromTemplate` to create a vApp from a vApp template containing one or more VMs [GH-588] 2 | * Added method `Vdc.CloneVapp` to create a vApp from another vApp [GH-588] 3 | * Added method `VApp.DiscardSuspendedState` to take a vApp out of suspended state [GH-588] 4 | -------------------------------------------------------------------------------- /.changes/v2.21.0/589-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed a bug that caused `Client.GetCertificateFromLibraryByName` and `AdminOrg.GetCertificateFromLibraryByName` to fail 2 | retrieving certificates with `:` character in the name [GH-589] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/557-features.md: -------------------------------------------------------------------------------- 1 | * Added metadata support to Runtime Defined Entities with methods `rde.GetMetadataByKey`, `rde.GetMetadataById` `rde.GetMetadata`, 2 | `rde.AddMetadata` and generic metadata methods `openApiMetadataEntry.Update` and `openApiMetadataEntry.Delete` [GH-557, GH-632] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/559-features.md: -------------------------------------------------------------------------------- 1 | * Added methods `SetReadOnlyAccessControl` and `IsSharedReadOnly` for `Catalog` and `AdminCatalog`, to handle read-only catalog sharing [GH-559] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/559-improvements.md: -------------------------------------------------------------------------------- 1 | * Added catalog parent retrieval to `client.GetCatalogByHref` and `client.GetAdminCatalogByHref` to facilitate tenant context handling [GH-559] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/590-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Added handling of catalog creation task, which was leaving the catalog not ready for action in some cases [GH-590, GH-602] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/594-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix nil pointer dereference bug while fetching a NSX-V Backed Edge Gateway [GH-594] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/595-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fix vApp network related tests [GH-595] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/597-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `VdcGroup.ForceDelete` function to optionally force VDC Group removal, which can be used for 2 | removing VDC Group with child elements [GH-597] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/598-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed [Issue #1098](https://github.com/vmware/terraform-provider-vcd/issues/1098) crash in VDC creation [GH-598] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/599-notes.md: -------------------------------------------------------------------------------- 1 | * Improved the testing configuration to allow customizing the UI Plugin path [GH-599] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/600-notes.md: -------------------------------------------------------------------------------- 1 | * Added a configurable timeout to the testing options available in the Makefile [GH-600] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/601-notes.md: -------------------------------------------------------------------------------- 1 | * Improved test `Test_NsxtApplicationPortProfileTenant` [GH-601] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/605-notes.md: -------------------------------------------------------------------------------- 1 | * Added explicit removal for many resources in tests [GH-605] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/607-deprecations.md: -------------------------------------------------------------------------------- 1 | * Deprecated `UpdateInternalDisksAsync` in favor of `UpdateVmSpecSectionAsync` [GH-607] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/607-features.md: -------------------------------------------------------------------------------- 1 | * Added `Firmware` field to `VmSpecSection` type and `BootOptions` to `Vm` type [GH-607] 2 | * Added `Vdc` methods `GetHardwareVersion`, `GetHighestHardwareVersion`, 3 | `FindOsFromId` [GH-607] 4 | * Added `VM` methods `UpdateBootOptions`, `UpdateBootOptionsAsync` [GH-607] 5 | * API calls for `AddRawVM`, `CreateStandaloneVmAsync`, `VM.Refresh`, 6 | `VM.UpdateVmSpecSectionAsync`, `addEmptyVmAsyncV10`, `getVMByHrefV10` 7 | and `UpdateBootOptionsAsync` get elevated to API version `37.1` if available, for `VmSpecSection.Firmware` and `BootOptions` support [GH-607] 8 | -------------------------------------------------------------------------------- /.changes/v2.22.0/608-notes.md: -------------------------------------------------------------------------------- 1 | * Improved test `Test_InsertOrEjectMedia` [GH-608] 2 | * Addressed `gosec` 2.17.0 errors [GH-608] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/609-improvements.md: -------------------------------------------------------------------------------- 1 | * Bumped up minimal API version to 37.0 (drops support for VCD 10.3.x) [GH-609] 2 | * Add struct `IopsResource` to `types.DiskSettings` (in replacement of dropped field `iops`) initially supported in API 37.0 [GH-609] 3 | * Add field `SslEnabled` to struct `types.NsxtAlbPool` initially supported in API 37.0 [GH-609] 4 | -------------------------------------------------------------------------------- /.changes/v2.22.0/609-notes.md: -------------------------------------------------------------------------------- 1 | * Changed `Test_AddNewVMFromMultiVmTemplate` to use preloaded vApp template [GH-609] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/609-removals.md: -------------------------------------------------------------------------------- 1 | * Removed field `iops` from `types.DiskSettings` (dropped in API version 37.0) [GH-609] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/610-improvements.md: -------------------------------------------------------------------------------- 1 | * New method `NsxtEdgeGateway.GetAllocatedIpCountByUplinkType` complementing existing 2 | `NsxtEdgeGateway.GetAllocatedIpCount`. It will return allocated IP counts by uplink types (works 3 | with VCD 10.4.1+) [GH-610] 4 | * New method `NsxtEdgeGateway.GetPrimaryNetworkAllocatedIpCount` that will return total allocated IP 5 | count for primary uplink (T0 or T0 VRF) [GH-610] 6 | * New field `types.EdgeGatewayUplinks.BackingType` that defines backing type of NSX-T Edge Gateway 7 | Uplink [GH-610] 8 | * NSX-T Edge Gateway functions `GetNsxtEdgeGatewayById`, `GetNsxtEdgeGatewayByName`, 9 | `GetNsxtEdgeGatewayByNameAndOwnerId`, `GetAllNsxtEdgeGateways`, `CreateNsxtEdgeGateway`, 10 | `Refresh`, `Update` will additionally sort uplinks to ensure that element 0 contains primary 11 | network (T0 or T0 VRF) [GH-610] 12 | -------------------------------------------------------------------------------- /.changes/v2.22.0/613-features.md: -------------------------------------------------------------------------------- 1 | * Added `VCDClient` methods `CreateNetworkPool`, `CreateStandaloneVmAsync`, `CreateNetworkPoolGeneve`, `CreateNetworkPoolVlan`, `CreateNetworkPoolPortGroup` to create a network pool [GH-613] 2 | * Added method `VCDClient.GetAllNsxtTransportZones` to retrieve all NSX-T transport zones [GH-613] 3 | * Added method `VCDClient.GetAllVcenterDistributedSwitches` to retrieve all distributed switches [GH-613] 4 | * Added method `VCDClient.QueryNsxtManagers` to retrieve all NSX-T managers [GH-613] 5 | * Added `NetworkPool` methods `Update`, `Delete`, `GetOpenApiUrl` to manage a network pool [GH-613] 6 | -------------------------------------------------------------------------------- /.changes/v2.22.0/615-improvements.md: -------------------------------------------------------------------------------- 1 | * Makes `DefinedEntityType` method `SetBehaviorAccessControls` more robust to avoid NullPointerException errors in VCD 2 | when the input is a nil slice [GH-615] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/618-features.md: -------------------------------------------------------------------------------- 1 | * Added `NsxtManager` type and function `VCDClient.GetNsxtManagerByName` [GH-618] 2 | * Added support for Segment Profile Template management using new types `NsxtSegmentProfileTemplate` and `types.NsxtSegmentProfileTemplate` [GH-618] 3 | * Added support for reading Segment Profiles provided by NSX-T via functions 4 | `GetAllIpDiscoveryProfiles`, `GetIpDiscoveryProfileByName`, `GetAllMacDiscoveryProfiles`, 5 | `GetMacDiscoveryProfileByName`, `GetAllSpoofGuardProfiles`, `GetSpoofGuardProfileByName`, 6 | `GetAllQoSProfiles`, `GetQoSProfileByName`, `GetAllSegmentSecurityProfiles`, 7 | `GetSegmentSecurityProfileByName` [GH-618] 8 | * Added support for setting default Segment Profiles for NSX-T Org VDC Networks 9 | `OpenApiOrgVdcNetwork.GetSegmentProfile()`, `OpenApiOrgVdcNetwork.UpdateSegmentProfile()` [GH-618] 10 | * Added support for setting global default Segment Profiles 11 | `VCDClient.GetGlobalDefaultSegmentProfileTemplates()`, 12 | `VCDClient.UpdateGlobalDefaultSegmentProfileTemplates()` [GH-618] 13 | -------------------------------------------------------------------------------- /.changes/v2.22.0/619-features.md: -------------------------------------------------------------------------------- 1 | * Added new `types` for NSX-T L2 VPN Tunnel session management `NsxtL2VpnTunnel`, `EdgeL2VpnStretchedNetwork`, `types.EdgeL2VpnTunnelStatistics`, `types.EdgeL2VpnTunnelStatus` [GH-619] 2 | * Added new `NsxtEdgeGateway` methods `CreateL2VpnTunnel`, `GetAllL2VpnTunnels`, `GetL2VpnTunnelByName`, `GetL2VpnTunnelById` for creation and retrieval of NSX-T L2 VPN Tunnel sessions [GH-619] 3 | * Added `NsxtL2VpnTunnel` methods `Refresh`, `Update`, `Statistics`, `Status`, `Delete` [GH-619] 4 | -------------------------------------------------------------------------------- /.changes/v2.22.0/621-features.md: -------------------------------------------------------------------------------- 1 | * Added method `Catalog.UploadMediaFile` to upload any file as catalog Media [GH-621,GH-622] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/622-features.md: -------------------------------------------------------------------------------- 1 | * Added method `Media.Download` to download a Media item as a byte stream [GH-622] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/623-features.md: -------------------------------------------------------------------------------- 1 | * Added `VAppTemplate` methods `GetLease` and `RenewLease` to retrieve and change storage lease [GH-623] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/625-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Addressed Issue [1134](https://github.com/vmware/terraform-provider-vcd/issues/1134): Can't use SYSTEM `ldap_mode` [GH-625] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/627-features.md: -------------------------------------------------------------------------------- 1 | * Added `NsxtEdgeGateway` methods `GetDnsConfig` and `UpdateDnsConfig` [GH-627] 2 | * Added types `types.NsxtEdgeGatewayDns`, `types.NsxtDnsForwarderZoneConfig` 3 | for creation and management of DNS forwarder configuration [GH-627] 4 | * Added `NsxtEdgeGatewayDns` methods `Refresh`, `Update` and `Delete` [GH-627] 5 | -------------------------------------------------------------------------------- /.changes/v2.22.0/628-improvements.md: -------------------------------------------------------------------------------- 1 | * `types.IpSpace` support Firewall and NAT rule autocreation configuration using 2 | `types.DefaultGatewayServiceConfig` on VCD 10.5.0+ [GH-628] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/629-notes.md: -------------------------------------------------------------------------------- 1 | * Amended `testMetadataIgnore`, used by all metadata tests, to be compatible with VCD 10.5.1 [GH-629] 2 | -------------------------------------------------------------------------------- /.changes/v2.22.0/632-improvements.md: -------------------------------------------------------------------------------- 1 | * Added metadata ignore support for Runtime Defined Entity metadata methods `rde.GetMetadataByKey`, `rde.GetMetadata`, `rde.AddMetadata`, 2 | `rde.UpdateMetadata` and `rde.DeleteMetadata` [GH-632] 3 | -------------------------------------------------------------------------------- /.changes/v2.22.0/633-features.md: -------------------------------------------------------------------------------- 1 | * Add type `VgpuProfile` and its methods `GetAllVgpuProfiles`, `GetVgpuProfilesByProviderVdc`, `GetVgpuProfileById`, `GetVgpuProfileByName`, `GetVgpuProfileByTenantFacingName`, `Update` and `Refresh` for managing vGPU profiles [GH-633] 2 | * Update `ComputePolicyV2` type with new fields for managing vGPU policies [GH-633] 3 | -------------------------------------------------------------------------------- /.changes/v2.23.0/639-notes.md: -------------------------------------------------------------------------------- 1 | * Removed the conditional API call with outdated API version from `Client.GetStorageProfileByHref` so it works 2 | with the newest VCD versions [GH-639] 3 | -------------------------------------------------------------------------------- /.changes/v2.23.0/643-notes.md: -------------------------------------------------------------------------------- 1 | * Added a delay for all LDAP tests `Test_LDAP` after LDAP configuration, but before using them 2 | [GH-643] 3 | 4 | -------------------------------------------------------------------------------- /.changes/v2.23.0/644-notes.md: -------------------------------------------------------------------------------- 1 | * Added internal generic functions to handle CRUD operations for inner and outer entities [GH-644] 2 | * Added section about OpenAPI CRUD functions to `CODING_GUIDELINES.md` [GH-644] 3 | * Converted `DefinedEntityType`, `DefinedEntity`, `DefinedInterface`, `IpSpace`, `IpSpaceUplink`, 4 | `DistributedFirewall`, `DistributedFirewallRule`, `NsxtSegmentProfileTemplate`, 5 | `GetAllIpDiscoveryProfiles`, `GetAllMacDiscoveryProfiles`, `GetAllSpoofGuardProfiles`, 6 | `GetAllQoSProfiles`, `GetAllSegmentSecurityProfiles` to use newly introduced generic CRUD 7 | functions [GH-644] 8 | -------------------------------------------------------------------------------- /.changes/v2.23.0/646-features.md: -------------------------------------------------------------------------------- 1 | * Added method `client.QueryVmList` to search VMs across VDCs [GH-646] 2 | -------------------------------------------------------------------------------- /.changes/v2.23.0/646-improvements.md: -------------------------------------------------------------------------------- 1 | * Added missing field `vdcName` to `types.QueryResultVMRecordType` [GH-646] 2 | -------------------------------------------------------------------------------- /.changes/v2.23.0/648-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `VCDClient.GetAllIpSpaceFloatingIpSuggestions` and `types.IpSpaceFloatingIpSuggestion` to 2 | retrieve IP Space IP suggestions [GH-648] 3 | -------------------------------------------------------------------------------- /.changes/v2.23.0/650-improvements.md: -------------------------------------------------------------------------------- 1 | * Added support for VM disk consolidation using `vm.ConsolidateDisksAsync` and `vm.ConsolidateDisks` 2 | [GH-650] 3 | -------------------------------------------------------------------------------- /.changes/v2.23.0/652-improvements.md: -------------------------------------------------------------------------------- 1 | * Added public method `VApp.GetParentVDC` to retrieve parent VDC of vApp (previously it was private) 2 | [GH-652] 3 | * Added methods `Catalog.CaptureVappTemplate`, `Catalog.CaptureVappTemplateAsync` and type 4 | `types.CaptureVAppParams` that add support for creating catalog template from existing vApp 5 | [GH-652] 6 | * Added method `Org.GetVAppByHref` to retrieve a vApp by given HREF [GH-652] 7 | * Added methods `VAppTemplate.GetCatalogItemHref` and `VAppTemplate.GetCatalogItemId` that can return 8 | related catalog item ID and HREF [GH-652] 9 | -------------------------------------------------------------------------------- /.changes/v2.24.0/657-features.md: -------------------------------------------------------------------------------- 1 | * Added method `Client.QueryVappNetworks` to retrieve all vApp networks [GH-657] 2 | * Added `VApp` methods `QueryAllVappNetworks`, `QueryVappNetworks`, `QueryVappOrgNetworks` to retrieve various types of vApp networks [GH-657] 3 | -------------------------------------------------------------------------------- /.changes/v2.24.0/663-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed an issue that prevented CSE Kubernetes clusters from being upgraded to an OVA with higher Kubernetes version but same TKG version, 2 | and to an OVA with a higher patch version of Kubernetes [GH-663] 3 | * Fixed an issue that prevented CSE Kubernetes clusters from being upgraded to TKG v2.5.0 with Kubernetes v1.26.11 as it 4 | performed an invalid upgrade of CoreDNS [GH-663] 5 | * Fixed an issue that prevented reading the SSH Public Key from provisioned CSE Kubernetes clusters [GH-663] 6 | -------------------------------------------------------------------------------- /.changes/v2.25.0/656-improvements.md: -------------------------------------------------------------------------------- 1 | * Improved log traceability by sending `X-VMWARE-VCLOUD-CLIENT-REQUEST-ID` header in requests. The 2 | header will be formatted in such format `162-2024-04-11-08-41-34-171-` where the first number 3 | (`162`) is the API call sequence number in the life of that particular process followed by a 4 | hyphen separated date time with millisecond precision (`2024-04-11-08-41-34-171` for April 11th of 5 | year 2024 at time 08:41:34.171). The trailing hyphen `-` is here to separate response header 6 | `X-Vmware-Vcloud-Request-Id` suffix with double hyphen 7 | `162-2024-04-11-08-41-34-171--40d78874-27a3-4cad-bd43-2764f557226b` [GH-656] -------------------------------------------------------------------------------- /.changes/v2.25.0/658-improvements.md: -------------------------------------------------------------------------------- 1 | * Fix bug in `Client.GetSpecificApiVersionOnCondition` that could result in using unsupported API 2 | version [GH-658] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/659-notes.md: -------------------------------------------------------------------------------- 1 | * Patched `Test_NsxtL2VpnTunnel` to match PresharedKey of VCD 10.5.1.1+ as it started returning 2 | `******` instead of PSK itself when performing GET [GH-659] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/660-improvements.md: -------------------------------------------------------------------------------- 1 | * Added fields `NatAndFirewallServiceIntention` and `NetworkRouteAdvertisementIntention` to 2 | `types.ExternalNetworkV2`, which allow users to configure NAT, Firewall and Route Advertisement 3 | intentions for provider gateways in VCD 10.5.1+ [GH-660] 4 | -------------------------------------------------------------------------------- /.changes/v2.25.0/661-improvements.md: -------------------------------------------------------------------------------- 1 | * Added field `ActionValue` to `types.NsxtFirewallRule` instead of `Action` that is deprecated in 2 | VCD API. It allows users to use `REJECT` option [GH-661] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/665-features.md: -------------------------------------------------------------------------------- 1 | * Added types `SolutionLandingZone` and `types.SolutionLandingZone` for Solution Add-on Landing Zone configuration [GH-665] 2 | * Added method `DefinedEntity.Refresh` to reload RDE state [GH-665] 3 | * Added `VCDClient` methods `CreateSolutionLandingZone`, `GetAllSolutionLandingZones`, 4 | `GetExactlyOneSolutionLandingZone`, `GetSolutionLandingZoneById` for handling Solution Landing Zones [GH-665] 5 | * Added `SolutionLandingZone` methods `Refresh`, `RdeId`, `Update`, 6 | `Delete` to help handling of Solution Landing Zones [GH-665] 7 | -------------------------------------------------------------------------------- /.changes/v2.25.0/666-features.md: -------------------------------------------------------------------------------- 1 | * Added `VM` methods `GetExtraConfig`, `UpdateExtraConfig`, `DeleteExtraConfig` to manage VM extra-configuration [GH-666, GH-691] 2 | -------------------------------------------------------------------------------- /.changes/v2.25.0/670-features.md: -------------------------------------------------------------------------------- 1 | * Added types `SolutionAddOn`, `SolutionAddOnConfig` and `types.SolutionAddOn` for Solution Add-on 2 | Landing configuration [GH-670] 3 | * Added `VCDClient` methods `CreateSolutionAddOn`, `GetAllSolutionAddons`, `GetSolutionAddonById`, 4 | `GetSolutionAddonByName` for handling Solution Add-Ons [GH-670] 5 | * Added `SolutionAddOn` methods `Update`, `RdeId`, `Delete` to help handling of Solution Landing 6 | Zones [GH-670] 7 | * Added `VCDClient` method `TrustAddOnImageCertificate` to trust certificate if it is not yet 8 | trusted [GH-670] -------------------------------------------------------------------------------- /.changes/v2.25.0/671-features.md: -------------------------------------------------------------------------------- 1 | * Added `AdminOrg` methods `GetOpenIdConnectSettings`, `SetOpenIdConnectSettings` and `DeleteOpenIdConnectSettings` 2 | to manage OpenID Connect settings [GH-671] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/673-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `DetectedGuestOS` to `QueryResultVMRecordType` [GH-673] 2 | -------------------------------------------------------------------------------- /.changes/v2.25.0/674-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed a bug that caused CSE Kubernetes cluster creation to fail when the configured Organization VDC Network belongs to 2 | a VDC Group [GH-674] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/677-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Patched `vm.UpdateNetworkConnectionSection` method that could sometimes fail due to Go's XML 2 | library mishandling XML namespaces when VCD returns irregular payload [GH-677] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/678-features.md: -------------------------------------------------------------------------------- 1 | * Added autoscaling capabilities when creating or updating CSE Kubernetes clusters, with `CseWorkerPoolSettings.Autoscaler` 2 | and `CseWorkerPoolUpdateInput.Autoscaler`, that allows to configure this mechanism on specific worker pools [GH-678] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/679-features.md: -------------------------------------------------------------------------------- 1 | * Added types `SolutionAddOnInstance` and `types.SolutionAddOnInstance` for Solution Add-on Instance 2 | management [GH-679] 3 | * Added `VCDClient` methods `GetAllSolutionAddonInstanceByName`, `GetAllSolutionAddonInstances`, 4 | `GetSolutionAddOnInstanceById` [GH-679] 5 | * Added `SolutionAddOn` methods `CreateSolutionAddOnInstance`, `GetAllInstances`, 6 | `GetInstanceByName`, `ValidateInputs`, `ConvertInputTypes` [GH-679] 7 | * Added `SolutionAddOnInstance` methods `GetParentSolutionAddOn`, `ReadCreationInputValues` 8 | `Delete`, `RdeId`, `Publishing` [GH-679] 9 | -------------------------------------------------------------------------------- /.changes/v2.25.0/679-improvements.md: -------------------------------------------------------------------------------- 1 | * Added convenience method `DefinedEntity.State()` that will automatically check if path to *State 2 | has no nil pointers [GH-679] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/680-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Patched `VdcGroup.CreateDistributedFirewallRule` method that returned incorrect single rule when 2 | `optionalAboveRuleId` is specified [GH-680] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/681-notes.md: -------------------------------------------------------------------------------- 1 | * Amended the test `Test_RdeAndRdeType` to be compatible with VCD 10.6+ [GH-681] 2 | -------------------------------------------------------------------------------- /.changes/v2.25.0/682-improvements.md: -------------------------------------------------------------------------------- 1 | * Added method `NsxtEdgeGateway.GetUsedAndUnusedExternalIPAddressCountWithLimit` to count used 2 | and unused IPs assigned to Edge Gateway. It supports a `limitTo` argument that can prevent 3 | exhausting system resources when counting IPs in assigned subnets [GH-682] 4 | -------------------------------------------------------------------------------- /.changes/v2.25.0/683-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Patched bug in core OpenAPI handling function `getOpenApiHighestElevatedVersion` that could 2 | sometimes choose unsupported API versions in future VCD versions [GH-683] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/684-notes.md: -------------------------------------------------------------------------------- 1 | * Amended many tests to set `ResourceGuaranteedMemory` when spawning a `Flex` VDC [GH-684, GH-685] 2 | -------------------------------------------------------------------------------- /.changes/v2.25.0/686-features.md: -------------------------------------------------------------------------------- 1 | * Added methods to create, read, update and delete VDC Templates: `VCDClient.CreateVdcTemplate`, `VCDClient.GetVdcTemplateById`, 2 | `VCDClient.GetVdcTemplateByName`, `VdcTemplate.Update` and `VdcTemplate.Delete` [GH-686] 3 | * Added methods to manage the access settings of VDC Templates: `VdcTemplate.SetAccessControl` and `VdcTemplate.GetAccessControl` [GH-686] 4 | * Added the `VdcTemplate.InstantiateVdcAsync` and `VdcTemplate.InstantiateVdc` methods to instantiate VDC Templates [GH-686] 5 | * Added the `VCDClient.QueryAdminVdcTemplates` and `Org.QueryVdcTemplates` methods to get all VDC Template records [GH-686] 6 | -------------------------------------------------------------------------------- /.changes/v2.25.0/688-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed an error that occurred when updating an Edge Gateway configuration, with an Edge cluster configuration section 2 | (`OpenAPIEdgeGatewayEdgeClusterConfig`). If this section was added, the update operation failed in VCD 10.6+ [GH-688] 3 | -------------------------------------------------------------------------------- /.changes/v2.25.0/689-features.md: -------------------------------------------------------------------------------- 1 | * Added types `DataSolution` and `types.DataSolution` for Data Storage Extension (DSE) management 2 | [GH-689] 3 | * Added `DataSolution` methods `RdeId`, `Name`, `Update`, `Publish`, `Unpublish`, 4 | `PublishRightsBundle`, `UnpublishRightsBundle`, `PublishAccessControls`, 5 | `UnpublishAccessControls`, `GetAllAccessControls`, `GetAllAccessControlsForTenant`, 6 | `GetAllInstanceTemplates`, `PublishAllInstanceTemplates`, `UnPublishAllInstanceTemplates`, 7 | `GetAllDataSolutionOrgConfigs`, `GetDataSolutionOrgConfigForTenant` [GH-689] 8 | * Added `VCDClient` methods `GetAllDataSolutions`, `GetDataSolutionById`, `GetDataSolutionByName`, 9 | `GetAllInstanceTemplates` [GH-689] 10 | * Added types `DataSolutionInstanceTemplate` and `types.DataSolutionInstanceTemplate` for Data 11 | Storage Extension (DSE) Solution Instance Template management [GH-689] 12 | * Added `DataSolutionInstanceTemplate` methods `Name`, `GetAllAccessControls`, 13 | `GetAllAccessControlsForTenant`, `Publish`, `Unpublish`, `RdeId` [GH-689] 14 | * Added types `DataSolutionOrgConfig` and `types.DataSolutionOrgConfig` for Data Storage Extension 15 | (DSE) Solution Instance Org Configuration management [GH-689] 16 | * Added `DataSolutionOrgConfig` methods `CreateDataSolutionOrgConfig`, 17 | `GetAllDataSolutionOrgConfigs`, `Delete`, `RdeId` [GH-689] 18 | -------------------------------------------------------------------------------- /.changes/v2.25.0/689-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `Message` field to `types.DefinedEntity` that can return a message for an RDE [GH-689] 2 | * Added convenience method `DefinedEntity.State()` that can return string value of state [GH-689] 3 | * Added `DefinedEntity` methods `SetAccessControl`, `GetAllAccessControls`, `GetAccessControlById`, 4 | `DeleteAccessControl` for managing RDE ACLs [GH-689] 5 | -------------------------------------------------------------------------------- /.changes/v2.25.0/690-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Patched `vm.updateExtraConfig` method that could sometimes fail due to random mishandling of XML namespaces in upstream libraries [GH-690] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/689-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `OpenAPIEdgeGateway.NonDistributedRoutingEnabled` and `Connection.ConnectionTypeValue` for 2 | `OpenApiOrgVdcNetwork` child to support configuring non distributed Org VDC networks in NSX-T Edge 3 | Gateways [GH-698] 4 | -------------------------------------------------------------------------------- /.changes/v2.26.0/693-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed [Issue 1287](https://github.com/vmware/terraform-provider-vcd/issues/1287) Read-only org sharing prevents sharing to users [GH-693] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/694-improvements.md: -------------------------------------------------------------------------------- 1 | * Improve `types.NetworkConnection` structure to support VM Secondary IP allocations (IPv6) [GH-694] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/696-features.md: -------------------------------------------------------------------------------- 1 | * Added CRUD operations for External Endpoints: `VCDClient.CreateExternalEndpoint`, `VCDClient.GetAllExternalEndpoints`, 2 | `VCDClient.GetExternalEndpoint`, `VCDClient.GetExternalEndpointById`, `ExternalEndpoint.Update` and `ExternalEndpoint.Delete` [GH-696] 3 | * Added CRUD operations for API Filters: `VCDClient.CreateApiFilter`, `VCDClient.GetAllApiFilters`, `VCDClient.GetApiFilterById`, 4 | `ApiFilter.Update` and `ApiFilter.Delete` [GH-696, GH-697] 5 | -------------------------------------------------------------------------------- /.changes/v2.26.0/697-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixes an XML error when updating a VM spec section: `Undeclared namespace prefix "ns5"` [GH-697] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/697-notes.md: -------------------------------------------------------------------------------- 1 | * Modifies `Test_CreateDeleteEdgeGatewayAdvanced` to avoid its failure as VCD returns `Connected: true` when retrieving 2 | the Edge Gateway data [GH-697] 3 | -------------------------------------------------------------------------------- /.changes/v2.26.0/699-improvements.md: -------------------------------------------------------------------------------- 1 | * Added `Client.CustomAdfsCookie` and configuration function `WithSamlAdfsAndCookie` that might be 2 | beneficial for ADFS server lookup query when using SAML auth [GH-699] 3 | * SAML ADFS auth flow will use Bearer token instead the old one [GH-699] 4 | -------------------------------------------------------------------------------- /.changes/v2.26.0/701-improvements.md: -------------------------------------------------------------------------------- 1 | * Add VM Hardware Upgrade method `vm.UpgradeHardwareVersion` [GH-701] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/702-improvements.md: -------------------------------------------------------------------------------- 1 | * Add `OrgPasswordPolicySettings` type to be able to set account lockout properties for an Organization [GH-702] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/704-improvements.md: -------------------------------------------------------------------------------- 1 | * Add methods `VCDClient.GetAllTier0RouterInterfaces` and `VCDClient.GetTier0RouterInterfaceByName` 2 | that help to lookup NSX-T Tier-0 Router Interfaces [GH-704] 3 | * Add `IpSpaceUplink.Interfaces` field that can associate Tier-0 Router Interfaces to IP Space 4 | Uplinks on VCD 10.5+ [GH-704] 5 | -------------------------------------------------------------------------------- /.changes/v2.26.0/705-improvements.md: -------------------------------------------------------------------------------- 1 | * Added field `QueryResultVMRecordType.VmNameInVc` [GH-705] 2 | -------------------------------------------------------------------------------- /.changes/v2.26.0/706-features.md: -------------------------------------------------------------------------------- 1 | * Added Read and Update operations for ALB Virtual Service HTTP Request Rules via 2 | `NsxtAlbVirtualService.GetAllHttpRequestRules` and `NsxtAlbVirtualService.UpdateHttpRequestRules` 3 | [GH-706] 4 | * Added Read and Update operations for ALB Virtual Service HTTP Response Rules via 5 | `NsxtAlbVirtualService.GetAllHttpResponseRules` and 6 | `NsxtAlbVirtualService.UpdateHttpResponseRules` [GH-706] 7 | * Added Read and Update operations for ALB Virtual Service HTTP Security Rules via 8 | `NsxtAlbVirtualService.GetAllHttpSecurityRules` and 9 | `NsxtAlbVirtualService.UpdateHttpSecurityRules` [GH-706] 10 | -------------------------------------------------------------------------------- /.changes/v2.26.1/723-improvements.md: -------------------------------------------------------------------------------- 1 | * Added CSE 4.2.2 and 4.2.3 support [GH-723] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/708-improvements.md: -------------------------------------------------------------------------------- 1 | * Improve authentication and API endpoint lookup mechanism to be compatible with API v40.0 [GH-708] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/711-features.md: -------------------------------------------------------------------------------- 1 | * Added `RegionStoragePolicy` and `types.RegionStoragePolicy` structures to read Region Storage Policies 2 | with methods `Region.GetAllStoragePolicies`, `Region.GetStoragePolicyByName`, `Region.GetStoragePolicyById` 3 | `VCDClient.GetRegionStoragePolicyById` [GH-711, GH-721] 4 | * Added `ContentLibrary` and `types.ContentLibrary` structures to manage Content Libraries with 5 | methods `VCDClient.CreateContentLibrary`, `VCDClient.GetAllContentLibraries`, 6 | `VCDClient.GetContentLibraryByName`, `VCDClient.GetContentLibraryById`, `ContentLibrary.Update`, 7 | `ContentLibrary.Delete` [GH-711, GH-721, GH-735, GH-757, GH-770] 8 | -------------------------------------------------------------------------------- /.changes/v3.0.0/714-features.md: -------------------------------------------------------------------------------- 1 | * Add trusted certificate management types `TrustedCertificate` and `types.TrustedCertificate` 2 | together with `VCDClient.AutoTrustCertificate`, `VCDClient.CreateTrustedCertificate`, 3 | `TmOrg.CreateTrustedCertificate`, `VCDClient.GetAllTrustedCertificates`, `TmOrg.GetAllTrustedCertificates`, 4 | `VCDClient.GetTrustedCertificateByName`, `TmOrg.GetTrustedCertificateByName`, 5 | `VCDClient.GetTrustedCertificateById`, `TmOrg.GetTrustedCertificateById`, `TrustedCertificate.Update`, `TrustedCertificate.Delete` 6 | [GH-714, GH-746] 7 | * vCenter management types `VCenter` and `types.VSphereVirtualCenter` adds Create, Update and Delete 8 | methods: `VCDClient.CreateVcenter`, `VCDClient.GetAllVCenters`, `VCDClient.GetVCenterByName`, 9 | `VCDClient.GetVCenterById`, `VCenter.Update`, `VCenter.Delete`, `VCenter.RefreshVcenter`, 10 | `VCenter.Refresh` [GH-714, GH-724, GH-747, GH-753, GH-756, GH-759, GH-760, GH-767, GH-771] 11 | * Add NSX-T Manager management types `NsxtManagerOpenApi`, `types.NsxtManagerOpenApi` and methods 12 | `VCDClient.CreateNsxtManagerOpenApi`, `VCDClient.GetAllNsxtManagersOpenApi`, 13 | `VCDClient.GetNsxtManagerOpenApiById`, `VCDClient.GetNsxtManagerOpenApiByName`, 14 | `TmNsxtManager.Update`, `TmNsxtManager.Delete` [GH-714, GH-722, GH-747, GH-771] 15 | * Added async vCenter creation function `VCDClient.CreateVcenterAsync` that exposes the creation 16 | task of as it is needed in some cases to retrieve ID of incomplete vCenter creation [GH-736] 17 | -------------------------------------------------------------------------------- /.changes/v3.0.0/715-notes.md: -------------------------------------------------------------------------------- 1 | * Bumped module version from `v2` to `v3`: `github.com/vmware/go-vcloud-director/v3` [GH-715] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/716-features.md: -------------------------------------------------------------------------------- 1 | * Added `TmOrg` and `types.TmOrg` structure for OpenAPI management of Organizations with methods 2 | `VCDClient.CreateTmOrg`, `VCDClient.GetAllTmOrgs`, `VCDClient.GetTmOrgByName`, 3 | `VCDClient.GetTmOrgById`, `TmOrg.Update`, `TmOrg.Delete`, `TmOrg.Disable` [GH-716] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/716-notes.md: -------------------------------------------------------------------------------- 1 | * Generic entity handling type `crudConfig` gets new boolean field `requiresTm` to enforce entity 2 | requirement for TM [GH-716] 3 | -------------------------------------------------------------------------------- /.changes/v3.0.0/717-features.md: -------------------------------------------------------------------------------- 1 | * Added `ContentLibraryItem` and `types.ContentLibraryItem` structures to manage Content Library Items 2 | with methods `ContentLibrary.CreateContentLibraryItem`, `ContentLibrary.GetAllContentLibraryItems`, 3 | `ContentLibrary.GetContentLibraryItemByName`, `ContentLibrary.GetContentLibraryItemById`, `ContentLibraryItem.Update`, 4 | `ContentLibraryItem.Delete`, `VCDClient.GetContentLibraryItemById` [GH-717, GH-724, GH-733, GH-734, GH-762, GH-766] 5 | -------------------------------------------------------------------------------- /.changes/v3.0.0/718-features.md: -------------------------------------------------------------------------------- 1 | * Added `VCDClient.GetNsxtManagerOpenApiByUrl` method to retrieve configured NSX-T Manager entry 2 | based on URL [GH-718] 3 | * Added `VCDClient.GetVCenterByUrl` method to retrieve configured vCenter server entry based on URL 4 | [GH-718] 5 | * Added `VCenter.RefreshStorageProfiles` to refresh storage profiles available in vCenter server 6 | [GH-718] 7 | * Added `Region` and `types.Region` structures for OpenAPI management of Regions with methods 8 | `VCDClient.CreateRegion`,`VCDClient.CreateRegionAsync`, `VCDClient.GetAllRegions`, 9 | `VCDClient.GetRegionByName`, `VCDClient.GetRegionById`, `Region.Update`, `Region.Delete` [GH-718, 10 | GH-737, GH-769] 11 | * Added `Supervisor` and `types.Supervisor` structure for reading available Supervisors 12 | `VCDClient.GetAllSupervisors`, `VCDClient.GetSupervisorById`, `VCDClient.GetSupervisorByName`, 13 | `VCDClient.GetSupervisorByNameAndVcenterId`, `Vcenter.GetAllSupervisors`, 14 | `Vcenter.GetSupervisorByName` [GH-718] 15 | * Added `SupervisorZone` and `types.SupervisorZone` structure for reading available Supervisor Zones 16 | `Supervisor.GetAllSupervisorZones`, `Supervisor.GetSupervisorZoneById`, 17 | `Supervisor.GetSupervisorZoneByName`, `Supervisor.`, `VCDClient.GetAllSupervisors`, 18 | `VCDClient.GetSupervisorById`, `VCDClient.GetSupervisorByName`, `Vcenter.GetAllSupervisors` 19 | [GH-718] 20 | -------------------------------------------------------------------------------- /.changes/v3.0.0/720-features.md: -------------------------------------------------------------------------------- 1 | * Added types `RegionQuota` and `types.TmVdc` for managing Tenant Manager Org VDCs with methods 2 | `VCDClient.CreateRegionQuota`, `VCDClient.GetAllRegionQuotas`, `VCDClient.GetRegionQuotaByName`, 3 | `VCDClient.GetRegionQuotaByNameAndOrgId`, `VCDClient.GetRegionQuotaById`, `RegionQuota.Update`, `RegionQuota.Delete`, 4 | `VCDClient.AssignVmClassesToRegionQuota`, `RegionQuota.AssignVmClasses`, 5 | `VCDClient.GetVmClassesFromRegionQuota` [GH-720, GH-738, GH-748] 6 | * Added types `Zone` and `types.Zone` for reading Region Zones with methods `VCDClient.GetAllZones`, 7 | `VCDClient.GetZoneByName`, `VCDClient.GetZoneById`, `Region.GetAllZones`, `Region.GetZoneByName` 8 | [GH-720] 9 | -------------------------------------------------------------------------------- /.changes/v3.0.0/724-features.md: -------------------------------------------------------------------------------- 1 | * Added `TmIpSpace` and `types.TmIpSpace` structures for OpenAPI management of TM IP Spaces with 2 | methods `VCDClient.CreateTmIpSpace`, `VCDClient.CreateTmIpSpaceAsync`, 3 | `VCDClient.GetAllTmIpSpaces`, `VCDClient.GetTmIpSpaceByName`, `VCDClient.GetTmIpSpaceById`, 4 | `VCDClient.GetTmIpSpaceByNameAndRegionId`, `TmIpSpace.Update`, `TmIpSpace.Delete` [GH-724, GH-769] 5 | -------------------------------------------------------------------------------- /.changes/v3.0.0/725-features.md: -------------------------------------------------------------------------------- 1 | * Added `TmProviderGateway` and `types.TmProviderGateway` structures and methods 2 | `VCDClient.CreateTmProviderGateway`, `VCDClient.GetAllTmProviderGateways`, 3 | `VCDClient.GetTmProviderGatewayByName`, `VCDClient.GetTmProviderGatewayById`, 4 | `VCDClient.GetTmProviderGatewayByNameAndRegionId`, `TmProviderGateway.Update`, 5 | `TmProviderGateway.Delete` to manage Provider Gateways [GH-725] 6 | * Added `TmTier0Gateway` and `types.TmTier0Gateway` structures and methods 7 | `VCDClient.GetAllTmTier0GatewaysWithContext`, `VCDClient.GetTmTier0GatewayWithContextByName` to 8 | read Tier 0 Gateways that are available for TM consumption [GH-725] 9 | * Added `TmIpSpaceAssociation` and `types.TmIpSpaceAssociation` structures and methods 10 | `VCDClient.CreateTmIpSpaceAssociation`, `VCDClient.GetAllTmIpSpaceAssociations`, 11 | `VCDClient.GetTmIpSpaceAssociationById`, 12 | `VCDClient.GetAllTmIpSpaceAssociationsByProviderGatewayId`, 13 | `VCDClient.GetAllTmIpSpaceAssociationsByIpSpaceId`, `TmIpSpaceAssociation.Delete` to manage IP 14 | Space associations with Provider Gateways [GH-725] 15 | * Added `VCDClient.CreateTmProviderGateway` that exposes the creation task it is needed in 16 | some cases to retrieve ID of incomplete Provider Gateway creation [GH-739] 17 | -------------------------------------------------------------------------------- /.changes/v3.0.0/726-features.md: -------------------------------------------------------------------------------- 1 | * Added types `StorageClass` and `types.StorageClass` for reading Tenant Manager Storage Classes with methods 2 | `VCDClient.GetAllStorageClasses`, `Region.GetStorageClassByName`, `VCDClient.GetStorageClassByName`, 3 | `VCDClient.GetStorageClassById` [GH-726] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/730-features.md: -------------------------------------------------------------------------------- 1 | * Added types `TmEdgeCluster` and `types.TmEdgeCluster` for reading TM Edge Clusters and managing 2 | their QoS settings `VCDClient.GetAllTmEdgeClusters`, `VCDClient.GetTmEdgeClusterByName`, 3 | `VCDClient.GetTmEdgeClusterByNameAndRegionId`, `VCDClient.GetTmEdgeClusterById`, 4 | `VCDClient.TmSyncEdgeClusters`, `TmEdgeCluster.Update`, `TmEdgeCluster.Delete`, 5 | `TmEdgeCluster.GetTransportNodeStatus` [GH-730, GH-735] 6 | -------------------------------------------------------------------------------- /.changes/v3.0.0/732-features.md: -------------------------------------------------------------------------------- 1 | * Created new type `TmLdapSettings` to manage LDAP settings for the Tenant Manager [GH-732, GH-746] 2 | * Added methods `VCDClient.TmLdapConfigure`, `TmOrg.LdapConfigure`, `VCDClient.TmLdapDisable`, `TmOrg.LdapDisable`, 3 | `VCDClient.TmGetLdapConfiguration`, `TmOrg.GetLdapConfiguration` to configure LDAP in Tenant Manager and regular Organizations [GH-732, GH-746, GH-774] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/734-features.md: -------------------------------------------------------------------------------- 1 | * Added types `RegionQuotaStoragePolicy`, `types.VirtualDatacenterStoragePolicies` and `types.VirtualDatacenterStoragePolicy` 2 | to manage VDC Storage Policies, with methods `VCDClient.CreateRegionQuotaStoragePolicies`, `RegionQuota.CreateStoragePolicies`, 3 | `VCDClient.GetAllRegionQuotaStoragePolicies`, `RegionQuota.GetAllStoragePolicies`, 4 | `RegionQuota.GetStoragePolicyByName`, `VCDClient.GetRegionQuotaStoragePolicyById`, 5 | `RegionQuota.GetStoragePolicyById`, `VCDClient.UpdateRegionQuotaStoragePolicy`, `RegionQuotaStoragePolicy.Update`, 6 | `VCDClient.DeleteRegionQuotaStoragePolicy`, `RegionQuotaStoragePolicy.Delete` [GH-734, GH-748] 7 | -------------------------------------------------------------------------------- /.changes/v3.0.0/736-notes.md: -------------------------------------------------------------------------------- 1 | * Added a new generic internal method `createInnerEntityAsync` to handle async resource creation and 2 | Task exposure [GH-736] 3 | -------------------------------------------------------------------------------- /.changes/v3.0.0/741-features.md: -------------------------------------------------------------------------------- 1 | Added type `types.TmOrgNetworkingSettings` and methods `TmOrg.GetOrgNetworkingSettings`, 2 | `TmOrg.UpdateOrgNetworkingSettings` for managing Organization Networking Settings [GH-741] 3 | -------------------------------------------------------------------------------- /.changes/v3.0.0/742-bug-fixes.md: -------------------------------------------------------------------------------- 1 | * Fixed panic when OIDC server doesn't provide claim mappings on well-known endpoint [GH-742] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/743-features.md: -------------------------------------------------------------------------------- 1 | * Added types `TmRegionalNetworkingSetting` and `types.TmRegionalNetworkingSetting` for managing Org 2 | Regional Networking Configuration `VCDClient.CreateTmRegionalNetworkingSetting`, 3 | `VCDClient.CreateTmRegionalNetworkingSettingAsync`, 4 | `VCDClient.GetAllTmRegionalNetworkingSettings`, `VCDClient.GetTmRegionalNetworkingSettingByName`, 5 | `VCDClient.GetTmRegionalNetworkingSettingById`, 6 | `VCDClient.GetTmRegionalNetworkingSettingByNameAndOrgId`, 7 | `VCDClient.GetTmRegionalNetworkingSettingByNameAndRegionId`, `TmRegionalNetworkingSetting.Update`, 8 | `TmRegionalNetworkingSetting.Delete` [GH-743] 9 | -------------------------------------------------------------------------------- /.changes/v3.0.0/744-features.md: -------------------------------------------------------------------------------- 1 | * Added type `types.TmRegionalNetworkingVpcConnectivityProfile` and methods 2 | `TmRegionalNetworkingSetting.GetDefaultVpcConnectivityProfile` and 3 | `TmRegionalNetworkingSetting.UpdateDefaultVpcConnectivityProfile` for managing Regional Networking 4 | VPC QoS [GH-744] 5 | -------------------------------------------------------------------------------- /.changes/v3.0.0/745-features.md: -------------------------------------------------------------------------------- 1 | * Added types `OpenApiUser` and `types.OpenApiUser` for managing Org Users using OpenAPI 2 | `VCDClient.CreateUser`, `VCDClient.GetAllUsers`, `VCDClient.GetUserByName`, 3 | `VCDClient.GetUserById`, `OpenApiUser.Update`, `OpenApiUser.Delete` [GH-745, GH-755] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/748-features.md: -------------------------------------------------------------------------------- 1 | * Added types `RegionVirtualMachineClass` to read Region VM Classes with methods 2 | `VCDClient.GetAllRegionVirtualMachineClasses`, `VCDClient.GetRegionVirtualMachineClassByNameAndRegionId`, 3 | `VCDClient.GetRegionVirtualMachineClassById` [GH-748] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/750-notes.md: -------------------------------------------------------------------------------- 1 | * Fix `staticcheck` 2025.1 compatibility [GH-750] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/751-features.md: -------------------------------------------------------------------------------- 1 | * Added new types package `ccitypes` for CCI related types [GH-751] 2 | * Added `Client` low level API interaction methods `GetEntityUrl`, `PostEntity`, `GetEntity`, 3 | `DeleteEntity` [GH-751] 4 | -------------------------------------------------------------------------------- /.changes/v3.0.0/752-notes.md: -------------------------------------------------------------------------------- 1 | * Bump `gosec` to v2.22.1 [GH-752] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/756-improvements.md: -------------------------------------------------------------------------------- 1 | * `vcdEndpoint` in `NewVCDClient` does not require the URL to contain `/api` suffix [GH-765] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/767-improvements.md: -------------------------------------------------------------------------------- 1 | * Remove a workaround that was used for certificate management endpoint with a typo on VCD < 10.3 [GH-767] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/768-features.md: -------------------------------------------------------------------------------- 1 | * Added `types.TmOrgSettings` structure for OpenAPI management of Organization Settings with methods 2 | `TmOrg.GetSettings`, `TmOrg.UpdateSettings` [GH-716] 3 | -------------------------------------------------------------------------------- /.changes/v3.0.0/772-improvements.md: -------------------------------------------------------------------------------- 1 | * Updated CCI types to v1alpha2 [GH-772] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/775-notes.md: -------------------------------------------------------------------------------- 1 | * Bump golang.org/x/net from 0.33.0 to 0.36.0 [GH-775] 2 | -------------------------------------------------------------------------------- /.changes/v3.0.0/776-features.md: -------------------------------------------------------------------------------- 1 | * Added `*VCDClient` methods `UpdateFeatureFlag`, `GetFeatureFlagById`, `GetAllFeatureFlags` [GH-776] 2 | -------------------------------------------------------------------------------- /.drone.sec: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.EzU68jFMwC0TkBylRGGaySvi6cCvTcTcLMPRO459K645v7iu2-MAUP79R-vaQQZGmcvmNj_ceiBxKI4JeLHySI07vrUusSdEZa-F0atRw6LcjRovXSZNu_lBfcVmGVPeJ24M1lzVOdde5dCUfihqTQJRu23XydNN0Kwhrm1Q1WDIEz_rdg2rtAHXwTWS22MbgpYXSQX-SgNHFJ-QCaPbBW1VXlooPIR1T2qEfdZBps2BQHItNQMgaW3WqKhFGWWqOccUYL7z2A6DKrpzvlRJ1zOTgi9ivP4mIGaoqnKBMu-Lbacma5ee3Go7nSX-uavvG-0edsI1agVO6yAA7hKS4Q.JiVcAR1qyRG3B1MJ.AqJDtq_X8kqON7t-WGdpju7rzf_OdiTTTmcSnJI951nEyZ63cHkh7Ua16Y2UUbC56UxVjzbb3Eew74-NLn2zDZbNiTgtlaQc9zd8fUwePnv2Y1vuOFu5-Toi_ulHN5LBha-NIz_pB-VvddoG00MAUinkNQdLMvRnqMOAutoORIJ5NuG8A3It5dFgLbSpg117xyk4.DCblIGvAB20KhHNs5RGZpA -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | build: 2 | image: golang 3 | commands: 4 | - go get -t 5 | - go get golang.org/x/tools/cmd/cover 6 | - go get github.com/mattn/goveralls 7 | - hack/coverage 8 | - goveralls -coverprofile=.cover/cover.out -service drone.io 9 | environment: 10 | - COVERALLS_TOKEN=rV578IYwiOWZLEujCjHhS7ciQ4vd4I8Cn 11 | notify: 12 | webhook: 13 | urls: 14 | - https://webhooks.gitter.im/e/ec455a4f33bad0f3c06b 15 | on_success: true 16 | on_failure: true 17 | publish: 18 | coverage: 19 | server: https://coverage.vmware.run 20 | token: $$COVERAGE_TOKEN 21 | when: 22 | branch: main 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 2 10 | trim_trailing_whitespace = true 11 | 12 | # Set default charset 13 | [*.{js,py,go,scala,rb,java,html,css,less,sass,md}] 14 | charset = utf-8 15 | 16 | # Tab indentation (no size specified) 17 | [*.go] 18 | indent_style = tab 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | 23 | # Matches the exact files either package.json or .travis.yml 24 | [{package.json,.travis.yml}] 25 | indent_style = space 26 | indent_size = 2 27 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in the repo. Unless a later match takes 2 | # precedence all these users will be requested for review when someone opens a pull request. 3 | * @lvirbalas @Didainius @adambarreiro 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | To help us diagnose issues efficiently, please include: 2 | 3 | - A short but descriptive title 4 | - A detailed description of the problem including relevant software versions and steps to reproduce 5 | - A fix or workaround if you know it 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## IMPORTANT 2 | 3 | To help us process your pull request efficiently, please follow the 4 | guidelines shown below. 5 | 6 | ## A Pull Request should be associated with an Issue 7 | 8 | We wish to have discussions in Issues. A single issue may be targeted by multiple PRs. 9 | If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues, 10 | and potentially we'll be able to point development in a particular direction. 11 | 12 | We accept PRs without associated issues provided the change is sufficiently evident 13 | from the commit message. If you have typos or simple bug fixes go for it. 14 | 15 | ## Description 16 | 17 | Related issue: (``) 18 | 19 | - (Required) Short description of changes in the PR subject 20 | 21 | - (Required) Detailed description of changes include tests and 22 | documentation. If the pull request contains multiple commits with 23 | detailed messages, refer to those instead 24 | 25 | - (Optional) Names of reviewers using @ sign + name 26 | -------------------------------------------------------------------------------- /.github/workflows/check-code.yml: -------------------------------------------------------------------------------- 1 | name: check-code 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | name: Check 7 | runs-on: ubuntu-latest 8 | env: 9 | GO111MODULE: on 10 | 11 | steps: 12 | 13 | - name: Set up Go 1.x 14 | uses: actions/setup-go@v3 15 | with: 16 | go-version: '1.22' 17 | 18 | - name: Check out code into the Go module directory 19 | uses: actions/checkout@v3 20 | 21 | - name: licensecheck 22 | run: make licensecheck 23 | 24 | - name: vet 25 | run: make vet 26 | 27 | - name: static 28 | run: make static 29 | 30 | - name: verify 31 | run: make tagverify 32 | 33 | - name: unit 34 | run: make testunit 35 | -------------------------------------------------------------------------------- /.github/workflows/check-security.yml: -------------------------------------------------------------------------------- 1 | name: Run Gosec 2 | on: [ push, pull_request ] 3 | jobs: 4 | gosec: 5 | runs-on: ubuntu-latest 6 | env: 7 | GO111MODULE: on 8 | steps: 9 | - name: Set up Go 1.x 10 | uses: actions/setup-go@v3 11 | with: 12 | go-version: '1.22' 13 | - name: Checkout Source 14 | uses: actions/checkout@v2 15 | - name: gosec 16 | run: make security 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | .cover 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | # Test coverage profiles 16 | *.cover 17 | 18 | *.cgo1.go 19 | *.cgo2.c 20 | _cgo_defun.c 21 | _cgo_gotypes.go 22 | _cgo_export.* 23 | 24 | _testmain.go 25 | 26 | *.exe 27 | *.test 28 | *.prof 29 | 30 | secrets.yml 31 | 32 | # Pycharm IDE 33 | .idea 34 | 35 | # VScode IDE 36 | .vscode 37 | 38 | # IntelliJ IDE 39 | *.iml 40 | 41 | # Test artifacts 42 | govcd/govcd_test_config*.yaml 43 | govcd/govcd_test_config*.json 44 | govcd/go-vcloud-director*.log 45 | govcd/test_cleanup_list*.json 46 | *.log 47 | 48 | # editor files 49 | *~ 50 | *.bak 51 | *.swp 52 | 53 | # File cache directory 54 | govcd/test-resources/cache/* 55 | 56 | # MacOS artefacts 57 | .DS_Store 58 | 59 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | Contributor Code of Conduct 2 | ====================== 3 | 4 | As contributors and maintainers of this project, we pledge to respect 5 | everyone who contributes by posting issues, updating documentation, 6 | submitting pull requests, providing feedback in comments, and any other 7 | activities. 8 | 9 | Communication through any project channels (GitHub, mailing lists, 10 | Twitter, and so on) must be constructive and never resort to personal 11 | attacks, trolling, public or private harassment, insults, or other 12 | unprofessional conduct. 13 | 14 | We promise to extend courtesy and respect to everyone involved in 15 | this project, regardless of gender, gender identity, sexual 16 | orientation, disability, age, race, ethnicity, religious beliefs, 17 | or level of experience. We expect anyone contributing to this project 18 | to do the same. 19 | 20 | If any member of the community violates this code of conduct, the 21 | maintainers of this project may take action, including removing issues, 22 | comments, and PRs or blocking accounts, as deemed appropriate. 23 | 24 | If you are subjected to or witness unacceptable behavior, or have any 25 | other concerns, please communicate with us. 26 | 27 | If you have suggestions to improve the code of conduct, please submit 28 | an issue or PR. 29 | 30 | 31 | **Attribution** 32 | 33 | This Code of Conduct is adapted from the VMware Clarity project, available at this page: https://github.com/vmware/clarity/blob/next/docs/CODE_OF_CONDUCT.md 34 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | go-vcloud-director 2 | 3 | Copyright (c) 2018 VMware, Inc. All Rights Reserved. 4 | 5 | This product is licensed to you under the Apache 2.0 license (the 6 | "License"). You may not use this product except in compliance with 7 | the Apache 2.0 License. 8 | 9 | This product may include a number of subcomponents with separate 10 | copyright notices and license terms. Your use of these subcomponents 11 | is subject to the terms and conditions of the subcomponent's license, 12 | as noted in the LICENSE file. 13 | -------------------------------------------------------------------------------- /ccitypes/constants.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package ccitypes 6 | 7 | const ( 8 | SupervisorNamespaceKind = "SupervisorNamespace" 9 | SupervisorNamespaceAPI = "infrastructure.cci.vmware.com" 10 | SupervisorNamespaceVersion = "v1alpha2" 11 | SupervisorNamespacesURL = "/apis/" + SupervisorNamespaceAPI + "/" + SupervisorNamespaceVersion + "/namespaces/%s/supervisornamespaces" 12 | 13 | ProjectAPI = "project.cci.vmware.com" 14 | ProjectKind = "Project" 15 | ProjectVersion = "v1alpha2" 16 | ProjectsURL = "/apis/" + ProjectAPI + "/" + ProjectVersion + "/projects" 17 | 18 | KubernetesSubpath = "%s://%s/cci/kubernetes" 19 | ) 20 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/vmware/go-vcloud-director/v3 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.0 6 | 7 | require ( 8 | github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195 9 | github.com/hashicorp/go-version v1.2.0 10 | github.com/kr/pretty v0.2.1 11 | github.com/peterhellberg/link v1.1.0 12 | golang.org/x/exp v0.0.0-20240119083558-1b970713d09a 13 | golang.org/x/text v0.23.0 14 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 15 | gopkg.in/yaml.v2 v2.4.0 16 | k8s.io/apimachinery v0.32.1 17 | sigs.k8s.io/yaml v1.4.0 18 | ) 19 | 20 | require ( 21 | github.com/fxamacker/cbor/v2 v2.7.0 // indirect 22 | github.com/go-logr/logr v1.4.2 // indirect 23 | github.com/gogo/protobuf v1.3.2 // indirect 24 | github.com/google/gofuzz v1.2.0 // indirect 25 | github.com/json-iterator/go v1.1.12 // indirect 26 | github.com/kr/text v0.1.0 // indirect 27 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 28 | github.com/modern-go/reflect2 v1.0.2 // indirect 29 | github.com/x448/float16 v0.8.4 // indirect 30 | golang.org/x/net v0.38.0 // indirect 31 | gopkg.in/inf.v0 v0.9.1 // indirect 32 | k8s.io/klog/v2 v2.130.1 // indirect 33 | k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect 34 | sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect 35 | sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect 36 | ) 37 | 38 | replace ( 39 | gopkg.in/check.v1 => github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c 40 | gopkg.in/yaml.v2 => github.com/go-yaml/yaml/v2 v2.4.0 41 | ) 42 | -------------------------------------------------------------------------------- /govcd/api_token_unit_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "reflect" 11 | "testing" 12 | ) 13 | 14 | func Test_readFileAndUnmarshalJSON(t *testing.T) { 15 | type args struct { 16 | filename string 17 | object *testEntity 18 | } 19 | tests := []struct { 20 | name string 21 | args args 22 | want *testEntity 23 | wantErr bool 24 | }{ 25 | { 26 | name: "simpleCase", 27 | args: args{ 28 | filename: "test-resources/test.json", 29 | object: &testEntity{}, 30 | }, 31 | want: &testEntity{Name: "test"}, 32 | wantErr: false, 33 | }, 34 | { 35 | name: "emptyFile", 36 | args: args{ 37 | filename: "test-resources/test_empty.json", 38 | object: &testEntity{}, 39 | }, 40 | want: &testEntity{}, 41 | wantErr: true, 42 | }, 43 | { 44 | name: "emptyJSON", 45 | args: args{ 46 | filename: "test-resources/test_emptyJSON.json", 47 | object: &testEntity{}, 48 | }, 49 | want: &testEntity{}, 50 | wantErr: false, 51 | }, 52 | { 53 | name: "nonexistentFile", 54 | args: args{ 55 | filename: "thisfiledoesntexist.json", 56 | object: &testEntity{}, 57 | }, 58 | want: &testEntity{}, 59 | wantErr: true, 60 | }, 61 | } 62 | for _, tt := range tests { 63 | t.Run(tt.name, func(t *testing.T) { 64 | err := readFileAndUnmarshalJSON(tt.args.filename, tt.args.object) 65 | if (err != nil) != tt.wantErr { 66 | t.Errorf("readFileAndUnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) 67 | return 68 | } 69 | 70 | if !reflect.DeepEqual(tt.args.object, tt.want) { 71 | t.Errorf("readFileAndUnmarshalJSON() = %v, want %v", tt.args.object, tt.want) 72 | } 73 | }) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /govcd/certificates_embedded_test.go: -------------------------------------------------------------------------------- 1 | //go:build functional || openapi || certificate || alb || nsxt || network || tm || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | _ "embed" 11 | ) 12 | 13 | var ( 14 | //go:embed test-resources/cert.pem 15 | certificate string 16 | 17 | //go:embed test-resources/key.pem 18 | privateKey string 19 | 20 | //go:embed test-resources/rootCA.pem 21 | rootCaCertificate string 22 | ) 23 | -------------------------------------------------------------------------------- /govcd/cse/4.1/capiyaml_mhc.tmpl: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineHealthCheck 3 | metadata: 4 | name: "{{.ClusterName}}" 5 | namespace: "{{.TargetNamespace}}" 6 | labels: 7 | clusterctl.cluster.x-k8s.io: "" 8 | clusterctl.cluster.x-k8s.io/move: "" 9 | spec: 10 | clusterName: "{{.ClusterName}}" 11 | maxUnhealthy: "{{.MaxUnhealthyNodePercentage}}" 12 | nodeStartupTimeout: "{{.NodeStartupTimeout}}" 13 | selector: 14 | matchLabels: 15 | cluster.x-k8s.io/cluster-name: "{{.ClusterName}}" 16 | unhealthyConditions: 17 | - type: Ready 18 | status: Unknown 19 | timeout: "{{.NodeUnknownTimeout}}" 20 | - type: Ready 21 | status: "False" 22 | timeout: "{{.NodeNotReadyTimeout}}" 23 | -------------------------------------------------------------------------------- /govcd/cse/4.1/capiyaml_workerpool.tmpl: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: VCDMachineTemplate 3 | metadata: 4 | name: "{{.NodePoolName}}" 5 | namespace: "{{.TargetNamespace}}" 6 | spec: 7 | template: 8 | spec: 9 | catalog: "{{.Catalog}}" 10 | template: "{{.VAppTemplate}}" 11 | sizingPolicy: "{{.NodePoolSizingPolicy}}" 12 | placementPolicy: "{{.NodePoolPlacementPolicy}}" 13 | storageProfile: "{{.NodePoolStorageProfile}}" 14 | diskSize: "{{.NodePoolDiskSize}}" 15 | enableNvidiaGPU: {{.NodePoolEnableGpu}} 16 | --- 17 | apiVersion: cluster.x-k8s.io/v1beta1 18 | kind: MachineDeployment 19 | metadata: 20 | name: "{{.NodePoolName}}" 21 | namespace: "{{.TargetNamespace}}" 22 | {{- if and .AutoscalerMaxSize .AutoscalerMinSize}} 23 | annotations: 24 | cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "{{.AutoscalerMaxSize}}" 25 | cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "{{.AutoscalerMinSize}}" 26 | {{- end}} 27 | spec: 28 | clusterName: "{{.ClusterName}}" 29 | {{- if .NodePoolMachineCount}} 30 | replicas: {{.NodePoolMachineCount}} 31 | {{- end}} 32 | selector: 33 | matchLabels: null 34 | template: 35 | spec: 36 | bootstrap: 37 | configRef: 38 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 39 | kind: KubeadmConfigTemplate 40 | name: "{{.ClusterName}}-kct" 41 | namespace: "{{.TargetNamespace}}" 42 | clusterName: "{{.ClusterName}}" 43 | infrastructureRef: 44 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 45 | kind: VCDMachineTemplate 46 | name: "{{.NodePoolName}}" 47 | namespace: "{{.TargetNamespace}}" 48 | version: "{{.KubernetesVersion}}" 49 | -------------------------------------------------------------------------------- /govcd/cse/4.1/rde.tmpl: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "capvcd.vmware.com/v1.1", 3 | "kind": "CAPVCDCluster", 4 | "name": "{{.Name}}", 5 | "metadata": { 6 | "name": "{{.Name}}", 7 | "orgName": "{{.Org}}", 8 | "site": "{{.VcdUrl}}", 9 | "virtualDataCenterName": "{{.Vdc}}" 10 | }, 11 | "spec": { 12 | "vcdKe": { 13 | "isVCDKECluster": true, 14 | "markForDelete": {{.Delete}}, 15 | "forceDelete": {{.ForceDelete}}, 16 | "autoRepairOnErrors": {{.AutoRepairOnErrors}}, 17 | {{- if .DefaultStorageClassName }} 18 | "defaultStorageClassOptions": { 19 | "filesystem": "{{.DefaultStorageClassFileSystem}}", 20 | "k8sStorageClassName": "{{.DefaultStorageClassName}}", 21 | "vcdStorageProfileName": "{{.DefaultStorageClassStorageProfile}}", 22 | "useDeleteReclaimPolicy": {{.DefaultStorageClassUseDeleteReclaimPolicy}} 23 | }, 24 | {{- end }} 25 | "secure": { 26 | "apiToken": "{{.ApiToken}}" 27 | } 28 | }, 29 | "capiYaml": "{{.CapiYaml}}" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /govcd/cse/4.2/capiyaml_mhc.tmpl: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineHealthCheck 3 | metadata: 4 | name: "{{.ClusterName}}" 5 | namespace: "{{.TargetNamespace}}" 6 | labels: 7 | clusterctl.cluster.x-k8s.io: "" 8 | clusterctl.cluster.x-k8s.io/move: "" 9 | spec: 10 | clusterName: "{{.ClusterName}}" 11 | maxUnhealthy: "{{.MaxUnhealthyNodePercentage}}" 12 | nodeStartupTimeout: "{{.NodeStartupTimeout}}" 13 | selector: 14 | matchLabels: 15 | cluster.x-k8s.io/cluster-name: "{{.ClusterName}}" 16 | unhealthyConditions: 17 | - type: Ready 18 | status: Unknown 19 | timeout: "{{.NodeUnknownTimeout}}" 20 | - type: Ready 21 | status: "False" 22 | timeout: "{{.NodeNotReadyTimeout}}" 23 | -------------------------------------------------------------------------------- /govcd/cse/4.2/capiyaml_workerpool.tmpl: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: VCDMachineTemplate 3 | metadata: 4 | name: "{{.NodePoolName}}" 5 | namespace: "{{.TargetNamespace}}" 6 | spec: 7 | template: 8 | spec: 9 | catalog: "{{.Catalog}}" 10 | template: "{{.VAppTemplate}}" 11 | sizingPolicy: "{{.NodePoolSizingPolicy}}" 12 | placementPolicy: "{{.NodePoolPlacementPolicy}}" 13 | storageProfile: "{{.NodePoolStorageProfile}}" 14 | diskSize: "{{.NodePoolDiskSize}}" 15 | enableNvidiaGPU: {{.NodePoolEnableGpu}} 16 | --- 17 | apiVersion: cluster.x-k8s.io/v1beta1 18 | kind: MachineDeployment 19 | metadata: 20 | name: "{{.NodePoolName}}" 21 | namespace: "{{.TargetNamespace}}" 22 | {{- if and .AutoscalerMaxSize .AutoscalerMinSize}} 23 | annotations: 24 | cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "{{.AutoscalerMaxSize}}" 25 | cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "{{.AutoscalerMinSize}}" 26 | {{- end}} 27 | spec: 28 | clusterName: "{{.ClusterName}}" 29 | {{- if .NodePoolMachineCount}} 30 | replicas: {{.NodePoolMachineCount}} 31 | {{- end}} 32 | selector: 33 | matchLabels: null 34 | template: 35 | spec: 36 | bootstrap: 37 | configRef: 38 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 39 | kind: KubeadmConfigTemplate 40 | name: "{{.ClusterName}}-kct" 41 | namespace: "{{.TargetNamespace}}" 42 | clusterName: "{{.ClusterName}}" 43 | infrastructureRef: 44 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 45 | kind: VCDMachineTemplate 46 | name: "{{.NodePoolName}}" 47 | namespace: "{{.TargetNamespace}}" 48 | version: "{{.KubernetesVersion}}" 49 | -------------------------------------------------------------------------------- /govcd/cse/4.2/rde.tmpl: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "capvcd.vmware.com/v1.1", 3 | "kind": "CAPVCDCluster", 4 | "name": "{{.Name}}", 5 | "metadata": { 6 | "name": "{{.Name}}", 7 | "orgName": "{{.Org}}", 8 | "site": "{{.VcdUrl}}", 9 | "virtualDataCenterName": "{{.Vdc}}" 10 | }, 11 | "spec": { 12 | "vcdKe": { 13 | "isVCDKECluster": true, 14 | "markForDelete": {{.Delete}}, 15 | "forceDelete": {{.ForceDelete}}, 16 | "autoRepairOnErrors": {{.AutoRepairOnErrors}}, 17 | {{- if .DefaultStorageClassName }} 18 | "defaultStorageClassOptions": { 19 | "filesystem": "{{.DefaultStorageClassFileSystem}}", 20 | "k8sStorageClassName": "{{.DefaultStorageClassName}}", 21 | "vcdStorageProfileName": "{{.DefaultStorageClassStorageProfile}}", 22 | "useDeleteReclaimPolicy": {{.DefaultStorageClassUseDeleteReclaimPolicy}} 23 | }, 24 | {{- end }} 25 | "secure": { 26 | "apiToken": "{{.ApiToken}}" 27 | } 28 | }, 29 | "capiYaml": "{{.CapiYaml}}", 30 | "projector": { "operations": [] } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /govcd/extension.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "github.com/vmware/go-vcloud-director/v3/types/v56" 9 | "net/http" 10 | ) 11 | 12 | // Deprecated: please use GetExternalNetwork function instead 13 | func GetExternalNetworkByName(vcdClient *VCDClient, networkName string) (*types.ExternalNetworkReference, error) { 14 | extNetworkRefs := &types.ExternalNetworkReferences{} 15 | 16 | extNetworkHREF, err := getExternalNetworkHref(&vcdClient.Client) 17 | if err != nil { 18 | return &types.ExternalNetworkReference{}, err 19 | } 20 | 21 | _, err = vcdClient.Client.ExecuteRequest(extNetworkHREF, http.MethodGet, 22 | "", "error retrieving external networks: %s", nil, extNetworkRefs) 23 | if err != nil { 24 | return &types.ExternalNetworkReference{}, err 25 | } 26 | 27 | for _, netRef := range extNetworkRefs.ExternalNetworkReference { 28 | if netRef.Name == networkName { 29 | return netRef, nil 30 | } 31 | } 32 | 33 | return &types.ExternalNetworkReference{}, nil 34 | } 35 | -------------------------------------------------------------------------------- /govcd/feture_flag_test.go: -------------------------------------------------------------------------------- 1 | //go:build tm || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | . "gopkg.in/check.v1" 11 | ) 12 | 13 | func (vcd *TestVCD) Test_FeatureFlag(check *C) { 14 | skipNonTm(vcd, check) 15 | sysadminOnly(vcd, check) 16 | 17 | allFFs, err := vcd.client.GetAllFeatureFlags() 18 | check.Assert(err, IsNil) 19 | check.Assert(len(allFFs) > 0, Equals, true) 20 | 21 | // Specific FF 22 | ffId := "urn:vcloud:featureflag:CLASSIC_TENANT_CREATION" 23 | ffById, err := vcd.client.GetFeatureFlagById(ffId) 24 | check.Assert(err, IsNil) 25 | 26 | originalValue := ffById.Enabled 27 | 28 | // flip value 29 | ffById.Enabled = !ffById.Enabled 30 | updatedFF, err := vcd.client.UpdateFeatureFlag(ffById) 31 | check.Assert(err, IsNil) 32 | check.Assert(updatedFF.Enabled, Equals, !originalValue) 33 | 34 | // restore state by flipping it once more 35 | updatedFF.Enabled = !updatedFF.Enabled 36 | restoredFF, err := vcd.client.UpdateFeatureFlag(updatedFF) 37 | check.Assert(err, IsNil) 38 | check.Assert(restoredFF.Enabled, Equals, originalValue) 39 | } 40 | -------------------------------------------------------------------------------- /govcd/lb.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "path" 10 | "strings" 11 | ) 12 | 13 | // extractNsxObjectIdFromPath parses proxied NSX API response Location header and 14 | // extracts ID for newly created object from it. The object ID is the last element in path. 15 | // It expects the path to have at least one "/" to be a valid path and cleans up the trailing slash 16 | // if there is one. 17 | // 18 | // Sample locationPath from API: /network/edges/edge-3/loadbalancer/config/monitors/monitor-5 19 | // Expected ID to be returned: monitor-5 20 | func extractNsxObjectIdFromPath(locationPath string) (string, error) { 21 | if locationPath == "" { 22 | return "", fmt.Errorf("unable to get ID from empty path") 23 | } 24 | 25 | cleanPath := path.Clean(locationPath) // Removes trailing slash if there is one 26 | splitPath := strings.Split(cleanPath, "/") 27 | 28 | if len(splitPath) < 2 { 29 | return "", fmt.Errorf("path does not contain url path: %s", splitPath) 30 | } 31 | 32 | objectID := splitPath[len(splitPath)-1] 33 | 34 | return objectID, nil 35 | } 36 | -------------------------------------------------------------------------------- /govcd/lb_unit_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit || lb || lbAppProfile || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import "testing" 10 | 11 | func Test_extractNSXObjectIDFromPath(t *testing.T) { 12 | type args struct { 13 | header string 14 | } 15 | tests := []struct { 16 | name string 17 | args args 18 | want string 19 | wantErr bool 20 | }{ 21 | { 22 | name: "Empty", 23 | args: args{header: ""}, 24 | want: "", 25 | wantErr: true, 26 | }, 27 | { 28 | name: "No URL in Path", 29 | args: args{header: "invalid_location_header"}, 30 | want: "", 31 | wantErr: true, 32 | }, 33 | { 34 | name: "No Slash", 35 | args: args{header: "applicationProfile-4"}, 36 | want: "", 37 | wantErr: true, 38 | }, 39 | { 40 | name: "Trailing Slash", 41 | args: args{header: "/network/edges/edge-3/loadbalancer/config/applicationprofiles/applicationProfile-4/"}, 42 | want: "applicationProfile-4", 43 | wantErr: false, 44 | }, 45 | { 46 | name: "No Trailing Slash", 47 | args: args{header: "/network/edges/edge-3/loadbalancer/config/applicationprofiles/applicationProfile-4"}, 48 | want: "applicationProfile-4", 49 | wantErr: false, 50 | }, 51 | } 52 | for _, tt := range tests { 53 | t.Run(tt.name, func(t *testing.T) { 54 | got, err := extractNsxObjectIdFromPath(tt.args.header) 55 | if (err != nil) != tt.wantErr { 56 | t.Errorf("extractNsxObjectIdFromPath() error = %v, wantErr %v", err, tt.wantErr) 57 | return 58 | } 59 | if got != tt.want { 60 | t.Errorf("extractNsxObjectIdFromPath() = %v, want %v", got, tt.want) 61 | } 62 | }) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /govcd/nsxt_alb_importable_clouds_test.go: -------------------------------------------------------------------------------- 1 | //go:build nsxt || alb || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | func (vcd *TestVCD) Test_GetAllAlbImportableClouds(check *C) { 16 | if vcd.skipAdminTests { 17 | check.Skip(fmt.Sprintf(TestRequiresSysAdminPrivileges, check.TestName())) 18 | } 19 | skipNoNsxtAlbConfiguration(vcd, check) 20 | 21 | albController := spawnAlbController(vcd, check) 22 | 23 | // Test client function with explicit ALB Controller ID requirement 24 | clientImportableClouds, err := vcd.client.GetAllAlbImportableClouds(albController.NsxtAlbController.ID, nil) 25 | check.Assert(err, IsNil) 26 | check.Assert(len(clientImportableClouds) > 0, Equals, true) 27 | 28 | // Test functions attached directly to NsxtAlbController 29 | controllerImportableClouds, err := albController.GetAllAlbImportableClouds(nil) 30 | check.Assert(err, IsNil) 31 | check.Assert(len(controllerImportableClouds) > 0, Equals, true) 32 | 33 | controllerImportableCloudByName, err := albController.GetAlbImportableCloudByName(vcd.config.VCD.Nsxt.NsxtAlbImportableCloud) 34 | check.Assert(err, IsNil) 35 | check.Assert(controllerImportableCloudByName, NotNil) 36 | check.Assert(controllerImportableCloudByName.NsxtAlbImportableCloud.ID, Equals, controllerImportableClouds[0].NsxtAlbImportableCloud.ID) 37 | 38 | // Cleanup 39 | err = albController.Delete() 40 | check.Assert(err, IsNil) 41 | } 42 | -------------------------------------------------------------------------------- /govcd/nsxt_edge_cluster_test.go: -------------------------------------------------------------------------------- 1 | //go:build network || nsxt || functional || openapi || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | "net/url" 12 | 13 | . "gopkg.in/check.v1" 14 | ) 15 | 16 | func (vcd *TestVCD) Test_GetAllNsxtEdgeClusters(check *C) { 17 | skipNoNsxtConfiguration(vcd, check) 18 | 19 | if vcd.skipAdminTests { 20 | check.Skip(fmt.Sprintf(TestRequiresSysAdminPrivileges, check.TestName())) 21 | } 22 | 23 | nsxtVdc, err := vcd.org.GetVDCByNameOrId(vcd.config.VCD.Nsxt.Vdc, true) 24 | check.Assert(err, IsNil) 25 | 26 | edgeClusters, err := nsxtVdc.GetAllNsxtEdgeClusters(nil) 27 | check.Assert(err, IsNil) 28 | check.Assert(edgeClusters, NotNil) 29 | check.Assert(len(edgeClusters) > 0, Equals, true) 30 | 31 | queryParams := url.Values{} 32 | queryParams.Add("filter", fmt.Sprintf("orgVdcId==%s", nsxtVdc.Vdc.ID)) 33 | allEdgeClusters, err := vcd.client.GetAllNsxtEdgeClusters(queryParams) 34 | check.Assert(err, IsNil) 35 | check.Assert(allEdgeClusters, NotNil) 36 | check.Assert(len(allEdgeClusters) > 0, Equals, true) 37 | } 38 | 39 | func (vcd *TestVCD) Test_GetNsxtEdgeClusterByName(check *C) { 40 | skipNoNsxtConfiguration(vcd, check) 41 | 42 | if vcd.skipAdminTests { 43 | check.Skip(fmt.Sprintf(TestRequiresSysAdminPrivileges, check.TestName())) 44 | } 45 | 46 | nsxtVdc, err := vcd.org.GetVDCByNameOrId(vcd.config.VCD.Nsxt.Vdc, true) 47 | check.Assert(err, IsNil) 48 | 49 | edgeCluster, err := nsxtVdc.GetNsxtEdgeClusterByName(vcd.config.VCD.Nsxt.NsxtEdgeCluster) 50 | check.Assert(err, IsNil) 51 | check.Assert(edgeCluster, NotNil) 52 | check.Assert(edgeCluster.NsxtEdgeCluster.Name, Equals, vcd.config.VCD.Nsxt.NsxtEdgeCluster) 53 | 54 | } 55 | -------------------------------------------------------------------------------- /govcd/nsxt_edgegateway_qos_profile_test.go: -------------------------------------------------------------------------------- 1 | //go:build ALL || openapi || functional || nsxt 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | 12 | "github.com/vmware/go-vcloud-director/v3/types/v56" 13 | . "gopkg.in/check.v1" 14 | ) 15 | 16 | func (vcd *TestVCD) Test_NsxtEdgeGatewayQosProfiles(check *C) { 17 | if vcd.skipAdminTests { 18 | check.Skip(fmt.Sprintf(TestRequiresSysAdminPrivileges, check.TestName())) 19 | } 20 | skipOpenApiEndpointTest(vcd, check, types.OpenApiPathVersion1_0_0+types.OpenApiEndpointQosProfiles) 21 | 22 | skipNoNsxtConfiguration(vcd, check) 23 | if vcd.config.VCD.Nsxt.GatewayQosProfile == "" { 24 | check.Skip("No NSX-T Edge Gateway QoS Profile configured") 25 | } 26 | 27 | nsxtManagers, err := vcd.client.QueryNsxtManagerByName(vcd.config.VCD.Nsxt.Manager) 28 | check.Assert(err, IsNil) 29 | check.Assert(len(nsxtManagers), Equals, 1) 30 | 31 | uuid, err := GetUuidFromHref(nsxtManagers[0].HREF, true) 32 | check.Assert(err, IsNil) 33 | urn, err := BuildUrnWithUuid("urn:vcloud:nsxtmanager:", uuid) 34 | check.Assert(err, IsNil) 35 | 36 | // Fetch all profiles 37 | allQosProfiles, err := vcd.client.GetAllNsxtEdgeGatewayQosProfiles(urn, nil) 38 | check.Assert(err, IsNil) 39 | check.Assert(len(allQosProfiles) > 0, Equals, true) 40 | 41 | // Fetch one by one based on DisplayName 42 | for _, profile := range allQosProfiles { 43 | printVerbose("# Fetching QoS profile '%s' by Name\n", profile.NsxtEdgeGatewayQosProfile.DisplayName) 44 | qosProfile, err := vcd.client.GetNsxtEdgeGatewayQosProfileByDisplayName(urn, profile.NsxtEdgeGatewayQosProfile.DisplayName) 45 | check.Assert(err, IsNil) 46 | check.Assert(qosProfile, NotNil) 47 | check.Assert(qosProfile.NsxtEdgeGatewayQosProfile.ID, Equals, profile.NsxtEdgeGatewayQosProfile.ID) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /govcd/nsxt_manager_test.go: -------------------------------------------------------------------------------- 1 | //go:build network || nsxt || functional || openapi || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "strings" 11 | 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | func (vcd *TestVCD) Test_NsxtManager(check *C) { 16 | skipNoNsxtConfiguration(vcd, check) 17 | vcd.skipIfNotSysAdmin(check) 18 | 19 | nsxtManager, err := vcd.client.GetNsxtManagerByName(vcd.config.VCD.Nsxt.Manager) 20 | check.Assert(err, IsNil) 21 | check.Assert(nsxtManager, NotNil) 22 | 23 | urn, err := nsxtManager.Urn() 24 | check.Assert(err, IsNil) 25 | check.Assert(strings.HasPrefix(urn, "urn:vcloud:nsxtmanager:"), Equals, true) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /govcd/nsxt_test.go: -------------------------------------------------------------------------------- 1 | //go:build ALL || openapi || functional || nsxt 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | func (vcd *TestVCD) Test_QueryNsxtManagerByName(check *C) { 16 | vcd.skipIfNotSysAdmin(check) 17 | skipNoNsxtConfiguration(vcd, check) 18 | nsxtManagers, err := vcd.client.QueryNsxtManagerByName(vcd.config.VCD.Nsxt.Manager) 19 | check.Assert(err, IsNil) 20 | check.Assert(len(nsxtManagers), Equals, 1) 21 | } 22 | 23 | func (vcd *TestVCD) Test_GetAllNsxtTier0Routers(check *C) { 24 | if vcd.skipAdminTests { 25 | check.Skip(fmt.Sprintf(TestRequiresSysAdminPrivileges, check.TestName())) 26 | } 27 | skipNoNsxtConfiguration(vcd, check) 28 | 29 | nsxtManagers, err := vcd.client.QueryNsxtManagerByName(vcd.config.VCD.Nsxt.Manager) 30 | check.Assert(err, IsNil) 31 | check.Assert(len(nsxtManagers), Equals, 1) 32 | 33 | uuid, err := GetUuidFromHref(nsxtManagers[0].HREF, true) 34 | check.Assert(err, IsNil) 35 | urn, err := BuildUrnWithUuid("urn:vcloud:nsxtmanager:", uuid) 36 | check.Assert(err, IsNil) 37 | 38 | tier0Router, err := vcd.client.GetImportableNsxtTier0RouterByName(vcd.config.VCD.Nsxt.Tier0router, urn) 39 | check.Assert(err, IsNil) 40 | check.Assert(tier0Router, NotNil) 41 | } 42 | -------------------------------------------------------------------------------- /govcd/nsxt_transport_zones.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "github.com/vmware/go-vcloud-director/v3/types/v56" 10 | "net/url" 11 | ) 12 | 13 | func (vcdClient *VCDClient) GetAllNsxtTransportZones(nsxtManagerId string, queryParameters url.Values) ([]*types.TransportZone, error) { 14 | if nsxtManagerId == "" { 15 | return nil, fmt.Errorf("empty NSX-T manager ID") 16 | } 17 | 18 | if !isUrn(nsxtManagerId) { 19 | return nil, fmt.Errorf("NSX-T manager ID is not URN (e.g. 'urn:vcloud:nsxtmanager:09722307-aee0-4623-af95-7f8e577c9ebc)', got: %s", nsxtManagerId) 20 | } 21 | 22 | client := vcdClient.Client 23 | endpoint := types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointImportableTransportZones 24 | apiVersion, err := client.checkOpenApiEndpointCompatibility(endpoint) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | urlRef, err := client.OpenApiBuildEndpoint(endpoint) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | queryParams := copyOrNewUrlValues(queryParameters) 35 | filterField := "_context" 36 | if client.APIClientVersionIs(">=38.0") { 37 | // field "networkProviderId" does not exist prior to API 38.0, where field "_context" is deprecated 38 | filterField = "networkProviderId" 39 | } 40 | queryParams = queryParameterFilterAnd(fmt.Sprintf("%s==%s", filterField, nsxtManagerId), queryParams) 41 | var typeResponses []*types.TransportZone 42 | err = client.OpenApiGetAllItems(apiVersion, urlRef, queryParams, &typeResponses, nil) 43 | if err != nil { 44 | return nil, err 45 | } 46 | 47 | return typeResponses, nil 48 | } 49 | -------------------------------------------------------------------------------- /govcd/openapi_unit_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "net/url" 11 | "reflect" 12 | "testing" 13 | ) 14 | 15 | func Test_defaultPageSize(t *testing.T) { 16 | type args struct { 17 | queryParams url.Values 18 | defaultPageSize string 19 | } 20 | tests := []struct { 21 | name string 22 | args args 23 | want url.Values 24 | }{ 25 | { 26 | name: "NilQueryParams", 27 | args: args{nil, "128"}, 28 | want: map[string][]string{"pageSize": []string{"128"}}, 29 | }, 30 | { 31 | name: "NotNilQueryParams", 32 | args: args{map[string][]string{"otherField": []string{"randomValue"}}, "128"}, 33 | want: map[string][]string{"pageSize": []string{"128"}, "otherField": []string{"randomValue"}}, 34 | }, 35 | { 36 | name: "CustomPageSize", 37 | args: args{map[string][]string{"pageSize": []string{"1"}}, "128"}, 38 | want: map[string][]string{"pageSize": []string{"1"}}, 39 | }, 40 | { 41 | name: "CustomPageSizeWithOtherFields", 42 | args: args{map[string][]string{"pageSize": []string{"1"}, "otherField": []string{"randomValue"}}, "128"}, 43 | want: map[string][]string{"pageSize": []string{"1"}, "otherField": []string{"randomValue"}}, 44 | }, 45 | } 46 | for _, tt := range tests { 47 | t.Run(tt.name, func(t *testing.T) { 48 | if got := defaultPageSize(tt.args.queryParams, tt.args.defaultPageSize); !reflect.DeepEqual(got, tt.want) { 49 | t.Errorf("defaultPageSize() = %v, want %v", got, tt.want) 50 | } 51 | }) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /govcd/org_saml_unit_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | _ "embed" 11 | "fmt" 12 | "testing" 13 | ) 14 | 15 | //go:embed test-resources/saml-test-sp.xml 16 | var md1 string 17 | 18 | //go:embed test-resources/saml-test-sp-invalid.xml 19 | var md2 string 20 | 21 | const md3 = ` 22 | 23 | 24 | 25 | 26 | ` 27 | 28 | func TestNormalizeSamlMetadata(t *testing.T) { 29 | 30 | type mdSample struct { 31 | name string 32 | data string 33 | wantErr bool 34 | } 35 | var samples = []mdSample{ 36 | {"correct", md1, false}, 37 | {"no-tags", md2, false}, 38 | {"empty-SPSSODescriptor", md3, true}, 39 | } 40 | 41 | for i, sample := range samples { 42 | t.Run(fmt.Sprintf("%02d-%s", i, sample.name), func(t *testing.T) { 43 | result, err := normalizeServiceProviderSamlMetadata(sample.data) 44 | if err != nil { 45 | if !sample.wantErr { 46 | t.Fatalf("unwanted error: %s ", err) 47 | } 48 | t.Logf("expected error found: %s\n", err) 49 | } else { 50 | if sample.wantErr { 51 | t.Logf("%s\n", result) 52 | t.Fatalf("expected an error but returned success") 53 | } 54 | } 55 | if len(result) == 0 { 56 | t.Fatalf("unexpected 0 length for result\n") 57 | } 58 | 59 | errors := ValidateSamlServiceProviderMetadata(result) 60 | 61 | if errors != nil { 62 | message := GetErrorMessageFromErrorSlice(errors) 63 | t.Logf("%s\n", message) 64 | if !sample.wantErr { 65 | t.Fatalf("validation errors found\n") 66 | } 67 | } 68 | }) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /govcd/orgs.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "github.com/vmware/go-vcloud-director/v3/types/v56" 9 | "net/url" 10 | ) 11 | 12 | type OpenApiOrg struct { 13 | Org *types.OpenApiOrg 14 | vcdClient *VCDClient 15 | } 16 | 17 | const LabelOrgs = "Organization" 18 | 19 | // wrap is a hidden helper that facilitates the usage of a generic CRUD function 20 | // 21 | //lint:ignore U1000 this method is used in generic functions, but annoys staticcheck 22 | func (org OpenApiOrg) wrap(inner *types.OpenApiOrg) *OpenApiOrg { 23 | org.Org = inner 24 | return &org 25 | } 26 | 27 | // GetAllOrgs retrieve all organizations visible to the user 28 | // When 'multiSite' is set, it will also check the organizations available from associated sites 29 | func (vcdClient *VCDClient) GetAllOrgs(queryParameters url.Values, multiSite bool) ([]*OpenApiOrg, error) { 30 | c := crudConfig{ 31 | endpoint: types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointOrgs, 32 | entityLabel: LabelOrgs, 33 | queryParameters: queryParameters, 34 | } 35 | if multiSite { 36 | c.additionalHeader = map[string]string{"Accept": "{{MEDIA_TYPE}};version={{API_VERSION}};multisite=global"} 37 | } 38 | 39 | outerType := OpenApiOrg{vcdClient: vcdClient} 40 | return getAllOuterEntities[OpenApiOrg, types.OpenApiOrg](&vcdClient.Client, outerType, c) 41 | } 42 | -------------------------------------------------------------------------------- /govcd/orgs_test.go: -------------------------------------------------------------------------------- 1 | //go:build org || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | "github.com/kr/pretty" 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | func (vcd *TestVCD) Test_GetOrgs(check *C) { 16 | 17 | if !vcd.client.Client.APIClientVersionIs(">= 37.0") { 18 | check.Skip(fmt.Sprintf("Minimum API version required for this test is 37.0. Found: %s", vcd.client.Client.APIVersion)) 19 | } 20 | orgs, err := vcd.client.GetAllOrgs(nil, true) 21 | check.Assert(err, IsNil) 22 | for i, org := range orgs { 23 | fmt.Printf("%d %# v\n", i, pretty.Formatter(org.Org)) 24 | } 25 | fmt.Println() 26 | orgs2, err := vcd.client.GetAllOrgs(nil, false) 27 | check.Assert(err, IsNil) 28 | for i, org := range orgs2 { 29 | fmt.Printf("%d %# v\n", i, pretty.Formatter(org.Org)) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /govcd/productsection.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | 11 | "github.com/vmware/go-vcloud-director/v3/types/v56" 12 | ) 13 | 14 | // setProductSectionList is a shared function for both vApp and VM 15 | func setProductSectionList(client *Client, href string, productSection *types.ProductSectionList) error { 16 | if href == "" { 17 | return fmt.Errorf("href cannot be empty to set product section") 18 | } 19 | 20 | productSection.Xmlns = types.XMLNamespaceVCloud 21 | productSection.Ovf = types.XMLNamespaceOVF 22 | 23 | task, err := client.ExecuteTaskRequest(href+"/productSections", http.MethodPut, 24 | types.MimeProductSection, "error setting product section: %s", productSection) 25 | 26 | if err != nil { 27 | return fmt.Errorf("unable to set product section: %s", err) 28 | } 29 | 30 | err = task.WaitTaskCompletion() 31 | if err != nil { 32 | return fmt.Errorf("task for setting product section failed: %s", err) 33 | } 34 | 35 | return nil 36 | } 37 | 38 | // getProductSectionList is a shared function for both vApp and VM 39 | func getProductSectionList(client *Client, href string) (*types.ProductSectionList, error) { 40 | if href == "" { 41 | return nil, fmt.Errorf("href cannot be empty to get product section") 42 | } 43 | productSection := &types.ProductSectionList{} 44 | 45 | _, err := client.ExecuteRequest(href+"/productSections", http.MethodGet, 46 | types.MimeProductSection, "error retrieving product section : %s", nil, productSection) 47 | 48 | if err != nil { 49 | return nil, fmt.Errorf("unable to retrieve product section: %s", err) 50 | } 51 | 52 | return productSection, nil 53 | } 54 | -------------------------------------------------------------------------------- /govcd/query_metadata_test.go: -------------------------------------------------------------------------------- 1 | //go:build query || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "github.com/vmware/go-vcloud-director/v3/types/v56" 11 | . "gopkg.in/check.v1" 12 | ) 13 | 14 | func (vcd *TestVCD) Test_CheckCumulativeQuery(check *C) { 15 | vcd.skipIfNotSysAdmin(check) 16 | pvdcs, err := vcd.client.QueryProviderVdcs() 17 | check.Assert(err, IsNil) 18 | var storageProfileMap = make(map[string]bool) 19 | 20 | for _, pvdcRec := range pvdcs { 21 | pvdc, err := vcd.client.GetProviderVdcByHref(pvdcRec.HREF) 22 | check.Assert(err, IsNil) 23 | for _, sp := range pvdc.ProviderVdc.StorageProfiles.ProviderVdcStorageProfile { 24 | storageProfileMap[sp.Name] = true 25 | } 26 | } 27 | if len(storageProfileMap) < 2 { 28 | check.Skip("not enough storage profiles found for this test") 29 | } 30 | 31 | checkQuery := func(pageSize string) { 32 | var foundStorageProfileMap = make(map[string]bool) 33 | results, err := vcd.client.Client.cumulativeQuery(types.QtProviderVdcStorageProfile, nil, map[string]string{ 34 | "type": types.QtProviderVdcStorageProfile, 35 | "pageSize": pageSize, 36 | }) 37 | 38 | check.Assert(err, IsNil) 39 | check.Assert(results, NotNil) 40 | check.Assert(results.Results, NotNil) 41 | check.Assert(results.Results.ProviderVdcStorageProfileRecord, NotNil) 42 | 43 | // Removing duplicates from results 44 | for _, sp := range results.Results.ProviderVdcStorageProfileRecord { 45 | foundStorageProfileMap[sp.Name] = true 46 | } 47 | check.Assert(len(foundStorageProfileMap), Equals, len(storageProfileMap)) 48 | } 49 | checkQuery("1") 50 | checkQuery("2") 51 | checkQuery("25") 52 | } 53 | -------------------------------------------------------------------------------- /govcd/query_test.go: -------------------------------------------------------------------------------- 1 | //go:build query || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | . "gopkg.in/check.v1" 11 | ) 12 | 13 | // TODO: Need to add a check to check the contents of the query 14 | func (vcd *TestVCD) Test_Query(check *C) { 15 | // Get the Org populated 16 | _, err := vcd.client.Query(map[string]string{"type": "vm"}) 17 | check.Assert(err, IsNil) 18 | } 19 | -------------------------------------------------------------------------------- /govcd/session_info_test.go: -------------------------------------------------------------------------------- 1 | //go:build api || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "encoding/json" 11 | "fmt" 12 | 13 | . "gopkg.in/check.v1" 14 | ) 15 | 16 | func (vcd *TestVCD) Test_GetSessionInfo(check *C) { 17 | info, err := vcd.client.Client.GetSessionInfo() 18 | check.Assert(err, IsNil) 19 | check.Assert(info, NotNil) 20 | 21 | if testVerbose { 22 | var data []byte 23 | data, err = json.MarshalIndent(info, " ", " ") 24 | check.Assert(err, IsNil) 25 | fmt.Printf("%s\n", data) 26 | org, err := vcd.client.GetAdminOrgById(info.Org.ID) 27 | check.Assert(err, IsNil) 28 | for _, roleRef := range info.RoleRefs { 29 | role, err := org.GetRoleById(roleRef.ID) 30 | check.Assert(err, IsNil) 31 | fmt.Printf("%s\n", role.Role.Name) 32 | rights, err := role.GetRights(nil) 33 | check.Assert(err, IsNil) 34 | for i, right := range rights { 35 | fmt.Printf("\t%3d %s\n", i, right.Name) 36 | } 37 | } 38 | } 39 | check.Assert(info.Org, NotNil) 40 | check.Assert(info.Org.Name, Not(Equals), "") 41 | if vcd.client.Client.IsSysAdmin { 42 | check.Assert(info.Org.Name, Equals, "System") 43 | } 44 | check.Assert(info.User, Not(Equals), "") 45 | check.Assert(len(info.Roles), Not(Equals), 0) 46 | } 47 | 48 | func (vcd *TestVCD) Test_GetExtendedSessionInfo(check *C) { 49 | info, err := vcd.client.GetExtendedSessionInfo() 50 | check.Assert(err, IsNil) 51 | check.Assert(info, NotNil) 52 | if testVerbose { 53 | text, err := json.MarshalIndent(info, " ", " ") 54 | check.Assert(err, IsNil) 55 | fmt.Printf("%s\n", text) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /govcd/solution_add_on_instance_publishing.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "strings" 10 | 11 | "github.com/vmware/go-vcloud-director/v3/types/v56" 12 | ) 13 | 14 | var addOnInstancePublishBehaviorId = "urn:vcloud:behavior-interface:invoke:vmware:solutions_add_on_instance:1.0.0" 15 | 16 | // Publishing manages publish and Unpublish operations, which are managed in the same API call 17 | // To unpublish, the `scopeAll` has to be `false and `scope` must be empty 18 | func (addonInstance *SolutionAddOnInstance) Publishing(scope []string, scopeAll bool) (string, error) { 19 | arguments := make(map[string]interface{}) 20 | arguments["operation"] = "publish instance" 21 | arguments["name"] = addonInstance.SolutionAddOnInstance.Name 22 | if scope != nil { 23 | arguments["scope"] = strings.Join(scope, ",") 24 | } else { 25 | arguments["scope"] = "" 26 | } 27 | arguments["scope-all"] = scopeAll 28 | 29 | behaviorInvocation := types.BehaviorInvocation{ 30 | Arguments: arguments, 31 | } 32 | 33 | parentRde := addonInstance.DefinedEntity 34 | result, err := parentRde.InvokeBehavior(addOnInstancePublishBehaviorId, behaviorInvocation) 35 | if err != nil { 36 | return "", fmt.Errorf("error invoking publish behavior of Solution Add-On instance '%s': %s", addonInstance.SolutionAddOnInstance.Name, err) 37 | } 38 | 39 | return result, nil 40 | } 41 | -------------------------------------------------------------------------------- /govcd/test-resources/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEgzCCAusCCQDsvB5Pim4CNzANBgkqhkiG9w0BAQsFADBPMR4wHAYDVQQKExVt 3 | a2NlcnQgZGV2ZWxvcG1lbnQgQ0ExEjAQBgNVBAsTCVRlcnJhZm9ybTEZMBcGA1UE 4 | AxMQbWtjZXJ0IFRlcnJhZm9ybTAgFw0yMzAzMDIwNjM0MjZaGA8yMTIzMDIwNjA2 5 | MzQyNlowNjELMAkGA1UEBhMCVVMxDTALBgNVBAMMBGNlcnQxGDAWBgkqhkiG9w0B 6 | CQEWCWNlcnRAdGVzdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKS2 7 | q+REopxvA3HY1zHRcNO9AcBZ3pGkVR2bSJ+awL9xZk7yjMrhqZ29XtScvs4ZUguS 8 | 3i6hrsY2hUqFWgbucJSObvUc6OBYoelUmNGtzhdwcsppFdZiJSTp2h6+/cZkX+fm 9 | 3xJcrTfzZVeBSniGGuzJHoJNXOaps9ilrOibm7/OZNF13NAe/VIjKPlQA1V3gdGd 10 | 6MAZ0p1IUF3flA9s29bCdsDcdbD6yjIfWfvztWIEx1PbARu9pd6tmg8jc3fvkqru 11 | d/nfNb3y3rHnSITXxJg3zO8OERXHmw/lGPiJahmzXjTvsk2Qwfb8TKnwtuh7eCEo 12 | VM54hyY4kxlWKQlpPRv1D+dLzp1BlzJjJxcg+U+86OlwNIaA9+bv9Kzfsw111IOG 13 | L4CWgxV4F7iYt2CAHdygEqkLImmPpjSXGZN96Rnf3vkSlNMIHatQDIYRZHKP8bq5 14 | Ww0zIC+pflTA8s1+KfN5qccgiqAwRXv1AKqA9YYx35chljp2qdNbyBQcsnNPiyA5 15 | XDSgNGsjinKiKWy/VLv947nvgRrPv+iJTuzNyIhmdZr1dDJDPhtjWa7nMgv668e+ 16 | NuAQOitQcFDN9NxjZ6CCJmw33hz0bjXESKsCvUlvfNra/DpESZ8MRKB8CoTgx0ey 17 | r72C1u/6o+qXZS3mzWdNmyzqR7mUeiRozmxqmiczAgMBAAEwDQYJKoZIhvcNAQEL 18 | BQADggGBAEf+CntVZefcgpzRNdxgpnEFh4SRiJyjUK7n2mVzd+kzk9K+E9lvJ1Ho 19 | PPIOdFRvj9rY3k+Q7G4eZL+2tNlN1KSfeRus5awp8tmFDd75kRGSkdCFWjebaq2k 20 | xvMkxp0E7v/zAN+OghF3ek7JLGQC4e4gCiyYDdB/Rvq3zEex471riqQu8vbs0CCV 21 | rz8d0NBSWc2XRKFRhLjODhDTLkLnJjIKW7863iFxXxYGHw4ngIXuctXN+QzRuX2r 22 | OioQSkmmtcmDwugDCX8YcHxZQgqz5+FthO76MugBTcgyBJK4UrJlyW56RZ6orLf3 23 | 527ZRRzWNd2xXMkcXQaneVvqhWydXfk2+vShN+iaU4GMZANP+d+imZuNyHHJKZcP 24 | CjQJbSQfO3cupfddXUuhEYoCE9WA8GNOWKWBbdyG1gQDyrINCU7XpH0sNH9Sbukz 25 | iobq+k9KqwClkUOpVr6OIFjmh0s1hdIY3qVa8OVp5Y687FcIGzE/euDqsoFMvkEL 26 | BIQP07pT0Q== 27 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /govcd/test-resources/rootCA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEbzCCAtegAwIBAgIQYl7uyKCXFwpi+qNH8QN6pTANBgkqhkiG9w0BAQsFADBP 3 | MR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExEjAQBgNVBAsTCVRlcnJh 4 | Zm9ybTEZMBcGA1UEAxMQbWtjZXJ0IFRlcnJhZm9ybTAgFw0yMzAzMDIwNjE4MDNa 5 | GA8zMTIzMDMwMjA2MTgwM1owTzEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50 6 | IENBMRIwEAYDVQQLEwlUZXJyYWZvcm0xGTAXBgNVBAMTEG1rY2VydCBUZXJyYWZv 7 | cm0wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCwlYSqjG7xrleLkO2D 8 | aOB3Z2cZQH1XCLFD//o8ctIDY1mmvlthlZ47H8FOpbI9/O+40oon27XmBxPCuYyy 9 | +/ZbmdBf4QB3BBcGGxhR8gInuCT65rraoAeLSRqNOwYcPduRBvrdNeCj2vyK98kR 10 | 4U8M+K64nx0hQlusu6Cyd5KiOyKg6CuoXnBKWZ1W2s8En23SIaxg+rydPM/jtjmW 11 | G6ArF2TtzuBPZ/z0rqroHw2Kwtna5r6mTaW9u4EKIaPyWn1Ay7iFABIs6DS/BEiS 12 | xnZHeXTqRD32HnMKXawrG0Fm++MX1c+qA2/k5JM2CF2BtoPbnekK7gWj38JHSrNg 13 | YLafYkMA5d/eTR8EnrGLGvHUTRQwK8CpG1bHRJSdbDwhvgQxgjLpcbeZzv+g42v8 14 | vXaXImDZEhiLeMIDM4XphyfH3l2W0WztqBM1GlM3Ycf9LvISqTH5z9QRM3JX0mRS 15 | xYFfCb8XC7vWaWkWoIHJ5RYQ6tHZ8wTtrvO34qtEAVSIte0CAwEAAaNFMEMwDgYD 16 | VR0PAQH/BAQDAgIEMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFNA4nzDg 17 | xEjwbJXhr47p/mub8cKEMA0GCSqGSIb3DQEBCwUAA4IBgQAyg+3HGr4dUnEJXpk3 18 | FocS0Bup2ds+wREejACEIgP1PzbcdJpHG4Qswt/6FvIRAzH84nGucZVeWdRI7jOk 19 | qT5I8nOQ/UTlZkEnt5QBIQX/ghg77mQrRY6neeI99NRm/28k9SERrpfpJStLeDwH 20 | jNnAGkfSxZP1QZACebrTPFAY8vGGGIDZ1ZeUwxJgfbrD9dF5cTJYftSwOndQVeKS 21 | SeRBsgwe7NLCmLzQOlmlo83KoGoGd6n9P7vTtB8Uj8WPv7O12+XTNjv8CuWR1Zhq 22 | LERLEBwtHd6POAjSvi1/58UKRJIPqa04dCSCGRrF5eeJVAzP3IiFWZz0aGZNj/gW 23 | Ynp8DVyF5ur5fGrA9Ao5r12avoYMnqzbgRPTY/u55Ab1SowU4xLbSzTGmD/Msg3s 24 | A2+dDBPQn3+6z88TZSVFKy/t83qXM156YMpgk2f37yIxHcPp+MJNNxKp1GzkrCXJ 25 | uo41rJCOGpVx/gWXsG+DKr0ZITWf5/oQF6AsWWxIIfaUEjU= 26 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /govcd/test-resources/test.json: -------------------------------------------------------------------------------- 1 | { "Name": "test" } 2 | -------------------------------------------------------------------------------- /govcd/test-resources/test_empty.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/govcd/test-resources/test_empty.json -------------------------------------------------------------------------------- /govcd/test-resources/test_emptyJSON.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /govcd/tm_region_vm_class_test.go: -------------------------------------------------------------------------------- 1 | //go:build tm || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | . "gopkg.in/check.v1" 11 | ) 12 | 13 | func (vcd *TestVCD) Test_RegionVmClass(check *C) { 14 | skipNonTm(vcd, check) 15 | sysadminOnly(vcd, check) 16 | 17 | nsxtManager, nsxtManagerCleanup := getOrCreateNsxtManager(vcd, check) 18 | defer nsxtManagerCleanup() 19 | vc, vcCleanup := getOrCreateVCenter(vcd, check) 20 | defer vcCleanup() 21 | 22 | supervisor, err := vc.GetSupervisorByName(vcd.config.Tm.VcenterSupervisor) 23 | check.Assert(err, IsNil) 24 | region, regionCleanup := getOrCreateRegion(vcd, nsxtManager, supervisor, check) 25 | defer regionCleanup() 26 | 27 | vmClasses, err := region.GetAllVmClasses(nil) 28 | check.Assert(err, IsNil) 29 | 30 | vmClasses2, err := vcd.client.GetAllRegionVirtualMachineClasses(nil) 31 | check.Assert(err, IsNil) 32 | check.Assert(len(vmClasses2) >= len(vmClasses), Equals, true) 33 | 34 | // Remaining test requires at least one Region VM Class in VCFA 35 | if len(vmClasses) == 0 { 36 | check.Skip("there are not enough Region VM Classes to continue with test") 37 | } 38 | 39 | vmClass, err := vcd.client.GetRegionVirtualMachineClassByNameAndRegionId(vmClasses[0].Name, region.Region.ID) 40 | check.Assert(err, IsNil) 41 | check.Assert(*vmClass.RegionVirtualMachineClass, DeepEquals, *vmClasses[0]) 42 | 43 | vmClass, err = vcd.client.GetRegionVirtualMachineClassById(vmClasses[0].ID) 44 | check.Assert(err, IsNil) 45 | check.Assert(*vmClass.RegionVirtualMachineClass, DeepEquals, *vmClasses[0]) 46 | 47 | } 48 | -------------------------------------------------------------------------------- /govcd/uploadtask.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | ) 11 | 12 | type UploadTask struct { 13 | uploadProgress *mutexedProgress 14 | *Task 15 | uploadError *error 16 | } 17 | 18 | // Creates wrapped Task which is dedicated for upload functionality and 19 | // provides additional functionality to monitor upload progress. 20 | func NewUploadTask(task *Task, uploadProgress *mutexedProgress, uploadError *error) *UploadTask { 21 | return &UploadTask{ 22 | uploadProgress, 23 | task, 24 | uploadError, 25 | } 26 | } 27 | 28 | func (uploadTask *UploadTask) GetUploadProgress() string { 29 | return fmt.Sprintf("%.2f", uploadTask.uploadProgress.LockedGet()) 30 | } 31 | 32 | func (uploadTask *UploadTask) ShowUploadProgress() error { 33 | fmt.Printf("Waiting...") 34 | 35 | for { 36 | if *uploadTask.uploadError != nil { 37 | return *uploadTask.uploadError 38 | } 39 | 40 | fmt.Printf("\rUpload progress %.2f%%", uploadTask.uploadProgress.LockedGet()) 41 | if uploadTask.uploadProgress.LockedGet() == 100.00 { 42 | fmt.Println() 43 | break 44 | } 45 | // Upload may be cancelled by user on GUI manually, detect task status 46 | if err := uploadTask.Refresh(); err != nil { 47 | return err 48 | } 49 | if uploadTask.Task.Task.Status != "queued" && uploadTask.Task.Task.Status != "preRunning" && uploadTask.Task.Task.Status != "running" { 50 | fmt.Println() 51 | break 52 | } 53 | time.Sleep(1 * time.Second) 54 | } 55 | return nil 56 | } 57 | 58 | func (uploadTask *UploadTask) GetUploadError() error { 59 | return *uploadTask.uploadError 60 | } 61 | -------------------------------------------------------------------------------- /govcd/vapp_concurrent_test.go: -------------------------------------------------------------------------------- 1 | //go:build concurrent 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "sync" 11 | 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | // Test_VAPPRefreshConcurrent is meant to prove and show that structures across 16 | // go-vcloud-director are not thread-safe. Go tests must be run with -race flag 17 | // to capture race condition. It is also guarded by `concurrent` build tag and 18 | // is not run by default. 19 | // 20 | // Run with go test -race -tags "concurrent" -check.vv -check.f Test_VAPPRefreshConcurrent . 21 | func (vcd *TestVCD) Test_VAPPRefreshConcurrent(check *C) { 22 | var waitgroup sync.WaitGroup 23 | 24 | if vcd.skipVappTests { 25 | check.Skip("Skipping test because vapp was not successfully created at setup") 26 | } 27 | vapp, err := vcd.vdc.GetVAppByName(vcd.vapp.VApp.Name, false) 28 | check.Assert(err, IsNil) 29 | 30 | for counter := 0; counter < 5; counter++ { 31 | waitgroup.Add(1) 32 | go func() { 33 | _ = vapp.Refresh() 34 | waitgroup.Done() 35 | // check.Assert(err, IsNil) 36 | }() 37 | } 38 | waitgroup.Wait() 39 | } 40 | -------------------------------------------------------------------------------- /govcd/vcd_test_help.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import "strings" 8 | 9 | // Gets the two or three components of a "parent" string, as passed to AddToCleanupList 10 | // If the number of split strings is not 2 or 3 it return 3 empty strings 11 | // Example input parent: my-org|my-vdc|my-edge-gw, separator: | 12 | // Output : first: my-org, second: my-vdc, third: my-edge-gw 13 | func splitParent(parent string, separator string) (first, second, third string) { 14 | strList := strings.Split(parent, separator) 15 | if len(strList) < 2 || len(strList) > 3 { 16 | return "", "", "" 17 | } 18 | first = strList[0] 19 | second = strList[1] 20 | 21 | if len(strList) == 3 { 22 | third = strList[2] 23 | } 24 | 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /govcd/vm_concurrent_test.go: -------------------------------------------------------------------------------- 1 | //go:build concurrent 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "sync" 11 | 12 | . "gopkg.in/check.v1" 13 | ) 14 | 15 | // Test_VMRefreshConcurrent is meant to prove and show that structures across 16 | // go-vcloud-director are not thread-safe. Go tests must be run with -race flag 17 | // to capture race condition. It is also guarded by `concurrent` build tag and 18 | // is not run by default. 19 | // 20 | // Run with go test -race -tags "concurrent" -check.vv -check.f Test_VMRefreshConcurrent . 21 | func (vcd *TestVCD) Test_VMRefreshConcurrent(check *C) { 22 | var waitgroup sync.WaitGroup 23 | 24 | // Find VApp 25 | if vcd.vapp.VApp == nil { 26 | check.Skip("skipping test because no vApp is found") 27 | } 28 | 29 | vapp := vcd.findFirstVapp() 30 | vmType, vmName := vcd.findFirstVm(vapp) 31 | if vmName == "" { 32 | check.Skip("skipping test because no VM is found") 33 | } 34 | vm := NewVM(&vcd.client.Client) 35 | vm.VM = &vmType 36 | 37 | for counter := 0; counter < 5; counter++ { 38 | waitgroup.Add(1) 39 | go func() { 40 | _ = vm.Refresh() 41 | waitgroup.Done() 42 | // check.Assert(err, IsNil) 43 | }() 44 | } 45 | waitgroup.Wait() 46 | 47 | } 48 | -------------------------------------------------------------------------------- /govcd/vsphere_distributed_switch.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package govcd 6 | 7 | import ( 8 | "fmt" 9 | "github.com/vmware/go-vcloud-director/v3/types/v56" 10 | "net/url" 11 | ) 12 | 13 | func (vcdClient *VCDClient) GetAllVcenterDistributedSwitches(vCenterId string, queryParameters url.Values) ([]*types.VcenterDistributedSwitch, error) { 14 | if vCenterId == "" { 15 | return nil, fmt.Errorf("empty vCenter ID") 16 | } 17 | 18 | if !isUrn(vCenterId) { 19 | return nil, fmt.Errorf("vCenter ID is not URN (e.g. 'urn:vcloud:vimserver:09722307-aee0-4623-af95-7f8e577c9ebc)', got: %s", vCenterId) 20 | } 21 | 22 | client := vcdClient.Client 23 | endpoint := types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointVCenterDistributedSwitch 24 | apiVersion, err := client.checkOpenApiEndpointCompatibility(endpoint) 25 | if err != nil { 26 | return nil, err 27 | } 28 | queryParams := copyOrNewUrlValues(queryParameters) 29 | queryParams = queryParameterFilterAnd("virtualCenter.id=="+vCenterId, queryParams) 30 | 31 | urlRef, err := client.OpenApiBuildEndpoint(endpoint) 32 | if err != nil { 33 | return nil, err 34 | } 35 | 36 | var typeResponses []*types.VcenterDistributedSwitch 37 | err = client.OpenApiGetAllItems(apiVersion, urlRef, queryParams, &typeResponses, nil) 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | return typeResponses, nil 43 | } 44 | -------------------------------------------------------------------------------- /govcd/vsphere_resource_pool_test.go: -------------------------------------------------------------------------------- 1 | //go:build vsphere || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | "github.com/kr/pretty" 12 | . "gopkg.in/check.v1" 13 | "strings" 14 | ) 15 | 16 | func (vcd *TestVCD) Test_GetResourcePools(check *C) { 17 | 18 | if !vcd.client.Client.IsSysAdmin { 19 | check.Skip("this test requires system administrator privileges") 20 | } 21 | vcenters, err := vcd.client.GetAllVCenters(nil) 22 | check.Assert(err, IsNil) 23 | 24 | check.Assert(len(vcenters) > 0, Equals, true) 25 | 26 | vc := vcenters[0] 27 | 28 | allResourcePools, err := vc.GetAllResourcePools(nil) 29 | check.Assert(err, IsNil) 30 | 31 | for i, rp := range allResourcePools { 32 | rpByID, err := vc.GetResourcePoolById(rp.ResourcePool.Moref) 33 | check.Assert(err, IsNil) 34 | check.Assert(rpByID.ResourcePool.Moref, Equals, rp.ResourcePool.Moref) 35 | check.Assert(rpByID.ResourcePool.Name, Equals, rp.ResourcePool.Name) 36 | rpByName, err := vc.GetResourcePoolByName(rp.ResourcePool.Name) 37 | if err != nil && strings.Contains(err.Error(), "more than one") { 38 | if testVerbose { 39 | fmt.Printf("%s\n", err) 40 | } 41 | continue 42 | } 43 | check.Assert(err, IsNil) 44 | check.Assert(rpByName.ResourcePool.Moref, Equals, rp.ResourcePool.Moref) 45 | check.Assert(rpByName.ResourcePool.Name, Equals, rp.ResourcePool.Name) 46 | if testVerbose { 47 | fmt.Printf("%2d %# v\n", i, pretty.Formatter(rp.ResourcePool)) 48 | } 49 | hw, err := rp.GetAvailableHardwareVersions() 50 | check.Assert(err, IsNil) 51 | if testVerbose { 52 | fmt.Printf("%s %#v\n", rp.ResourcePool.Name, hw) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /govcd/vsphere_storage_profile_test.go: -------------------------------------------------------------------------------- 1 | //go:build vsphere || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | "fmt" 11 | "github.com/kr/pretty" 12 | . "gopkg.in/check.v1" 13 | "strings" 14 | ) 15 | 16 | func (vcd *TestVCD) Test_GetStorageProfiles(check *C) { 17 | if !vcd.client.Client.IsSysAdmin { 18 | check.Skip("this test requires system administrator privileges") 19 | } 20 | vcenters, err := vcd.client.GetAllVCenters(nil) 21 | check.Assert(err, IsNil) 22 | 23 | check.Assert(len(vcenters) > 0, Equals, true) 24 | 25 | vc := vcenters[0] 26 | 27 | if vcd.config.Vsphere.ResourcePoolForVcd1 == "" { 28 | check.Skip("no resource pool found for this VCD") 29 | } 30 | 31 | resourcePool, err := vc.GetResourcePoolByName(vcd.config.Vsphere.ResourcePoolForVcd1) 32 | check.Assert(err, IsNil) 33 | 34 | allStorageProfiles, err := vc.GetAllStorageProfiles(resourcePool.ResourcePool.Moref, nil) 35 | check.Assert(err, IsNil) 36 | 37 | for i, sp := range allStorageProfiles { 38 | spById, err := vc.GetStorageProfileById(resourcePool.ResourcePool.Moref, sp.StorageProfile.Moref) 39 | check.Assert(err, IsNil) 40 | check.Assert(spById.StorageProfile.Moref, Equals, sp.StorageProfile.Moref) 41 | check.Assert(spById.StorageProfile.Name, Equals, sp.StorageProfile.Name) 42 | spByName, err := vc.GetStorageProfileByName(resourcePool.ResourcePool.Moref, sp.StorageProfile.Name) 43 | if err != nil && strings.Contains(err.Error(), "more than one") { 44 | fmt.Printf("%s\n", err) 45 | continue 46 | } 47 | check.Assert(err, IsNil) 48 | check.Assert(spByName.StorageProfile.Moref, Equals, sp.StorageProfile.Moref) 49 | check.Assert(spByName.StorageProfile.Name, Equals, sp.StorageProfile.Name) 50 | if testVerbose { 51 | fmt.Printf("%2d %# v\n", i, pretty.Formatter(sp.StorageProfile)) 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /govcd/vsphere_vcenter_test.go: -------------------------------------------------------------------------------- 1 | //go:build vsphere || functional || ALL 2 | 3 | // © Broadcom. All Rights Reserved. 4 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package govcd 8 | 9 | import ( 10 | . "gopkg.in/check.v1" 11 | ) 12 | 13 | func (vcd *TestVCD) Test_GetVcenters(check *C) { 14 | 15 | if !vcd.client.Client.IsSysAdmin { 16 | check.Skip("this test requires system administrator privileges") 17 | } 18 | vcenters, err := vcd.client.GetAllVCenters(nil) 19 | check.Assert(err, IsNil) 20 | 21 | check.Assert(len(vcenters) > 0, Equals, true) 22 | 23 | for _, vc := range vcenters { 24 | vcenterById, err := vcd.client.GetVCenterById(vc.VSphereVCenter.VcId) 25 | check.Assert(err, IsNil) 26 | check.Assert(vc.VSphereVCenter.VcId, Equals, vcenterById.VSphereVCenter.VcId) 27 | vcenterByName, err := vcd.client.GetVCenterByName(vc.VSphereVCenter.Name) 28 | check.Assert(err, IsNil) 29 | check.Assert(vc.VSphereVCenter.VcId, Equals, vcenterByName.VSphereVCenter.VcId) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hack/coverage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate test coverage statistics for Go packages. 3 | # 4 | # Works around the fact that `go test -coverprofile` currently does not work 5 | # with multiple packages, see https://code.google.com/p/go/issues/detail?id=6909 6 | # 7 | # Usage: script/coverage [--html|--coveralls] 8 | # 9 | # --html Additionally create HTML report and open it in browser 10 | # --coveralls Push coverage statistics to coveralls.io 11 | # 12 | 13 | set -e 14 | 15 | workdir=.cover 16 | profile="$workdir/cover.out" 17 | mode=count 18 | 19 | generate_cover_data() { 20 | rm -rf "$workdir" 21 | mkdir "$workdir" 22 | 23 | for pkg in "$@"; do 24 | f="$workdir/$(echo $pkg | tr / -).cover" 25 | go test -covermode="$mode" -coverprofile="$f" "$pkg" 26 | done 27 | 28 | echo "mode: $mode" >"$profile" 29 | grep -h -v "^mode:" "$workdir"/*.cover >>"$profile" 30 | } 31 | 32 | show_cover_report() { 33 | go tool cover -${1}="$profile" 34 | } 35 | 36 | push_to_coveralls() { 37 | echo "Pushing coverage statistics to coveralls.io" 38 | } 39 | 40 | generate_cover_data $(go list ./...) 41 | show_cover_report func 42 | case "$1" in 43 | "") 44 | ;; 45 | --html) 46 | show_cover_report html ;; 47 | --coveralls) 48 | push_to_coveralls ;; 49 | *) 50 | echo >&2 "error: invalid option: $1"; exit 1 ;; 51 | esac 52 | -------------------------------------------------------------------------------- /samples/discover/sample_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": "", 3 | "password": "", 4 | "org": "", 5 | "href": "https://YOUR_VCD_IP/api", 6 | "vdc": "", 7 | "insecure": true 8 | } 9 | -------------------------------------------------------------------------------- /samples/discover/sample_config.yaml: -------------------------------------------------------------------------------- 1 | user: 2 | password: 3 | org: 4 | href: https://YOUR_VCD_IP/api 5 | vdc: 6 | insecure: true 7 | -------------------------------------------------------------------------------- /samples/saml_auth_adfs/README.md: -------------------------------------------------------------------------------- 1 | # SAML authentication with ADFS as IdP 2 | This is an example how to use Active Directory Federation Services as SAML IdP for vCD. 3 | `main()` function has an example how to setup vCD client with SAML auth. On successful login it will 4 | list Edge Gateways. 5 | To run this command please supply parameters as per below example: 6 | ``` 7 | go build -o auth 8 | ./auth --username test@test-forest.net --password my-password --org my-org --endpoint https://_YOUR_HOSTNAME_/api 9 | ``` 10 | 11 | Results should look similar to: 12 | ``` 13 | Found 1 Edge Gateways 14 | my-edge-gw 15 | ``` 16 | 17 | 18 | ## More details 19 | Main trick for making SAML with ADFS work is to use configuration option function 20 | `WithSamlAdfs(useSaml bool, customAdfsRptId string)` in `govcd.NewVCDClient()`. 21 | At the moment ADFS WS-TRUST endpoint "/adfs/services/trust/13/usernamemixed" is the only one 22 | supported and it must be enabled on ADFS server to work properly. 23 | 24 | ## Troubleshooting 25 | Environment variable `GOVCD_LOG=1` can be used to enable API call logging. It should log all API 26 | calls (including the ones to ADFS server) with obfuscated credentials to aid troubleshooting. -------------------------------------------------------------------------------- /scripts/changelog-links.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script rewrites [GH-nnnn]-style references in the CHANGELOG.md file to 4 | # be Markdown links to the given github issues. 5 | # 6 | # This is run during releases so that the issue references in all of the 7 | # released items are presented as clickable links, but we can just use the 8 | # easy [GH-nnnn] shorthand for quickly adding items to the "Unrelease" section 9 | # while merging things between releases. 10 | 11 | set -e 12 | 13 | if [[ ! -f CHANGELOG.md ]]; then 14 | echo "ERROR: CHANGELOG.md not found in pwd." 15 | echo "Please run this from the root of the go-vcloud-director repository" 16 | exit 1 17 | fi 18 | 19 | if [[ `uname` == "Darwin" ]]; then 20 | echo "Using BSD sed" 21 | SED="sed -i.bak -E -e" 22 | else 23 | echo "Using GNU sed" 24 | SED="sed -i.bak -r -e" 25 | fi 26 | 27 | GOVCD_URL="https:\/\/github.com\/vmware\/go-vcloud-director\/pull" 28 | 29 | $SED "s/GH-([0-9]+)/\[#\1\]\($GOVCD_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md 30 | if [ "$?" != "0" ] ; then exit 1 ; fi 31 | rm CHANGELOG.md.bak 32 | -------------------------------------------------------------------------------- /scripts/get_token.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script will connect to the vCD using username and password, 3 | # and show the headers that contain a bearer or authorization token. 4 | # 5 | user=$1 6 | password=$2 7 | org=$3 8 | IP=$4 9 | api_version=$5 10 | 11 | if [ -z "$IP" ] 12 | then 13 | echo "Syntax $0 user password organization hostname_or_IP_address [API version]" 14 | exit 1 15 | fi 16 | 17 | auth=$(echo -n "$user@$org:$password" |base64) 18 | 19 | [ -z "$api_version" ] && api_version=32 20 | operation=api/sessions 21 | 22 | # if the requested version is greater than 32 (VCD 10.0+), we can use cloudapi 23 | if [[ $api_version -ge 33 ]] 24 | then 25 | # endpoint for system administrator 26 | operation=cloudapi/1.0.0/sessions/provider 27 | if [ "$org" != "System" -a "$org" != "system" ] 28 | then 29 | # endpoint for org users 30 | operation=cloudapi/1.0.0/sessions 31 | fi 32 | fi 33 | 34 | set -x 35 | curl -I -k --header "Accept: application/*;version=${api_version}.0" \ 36 | --header "Authorization: Basic $auth" \ 37 | --request POST https://$IP/$operation 38 | 39 | # If successful, the output of this command will include lines like the following 40 | # X-VCLOUD-AUTHORIZATION: 08a321735de84f1d9ec80c3b3e18fa8b 41 | # X-VMWARE-VCLOUD-ACCESS-TOKEN: eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbmlzdHJhdG9yI[562 more characters] 42 | # 43 | # The string after `X-VCLOUD-AUTHORIZATION:` is the old (deprecated) token. 44 | # The 612-character string after `X-VMWARE-VCLOUD-ACCESS-TOKEN` is the bearer token 45 | # 46 | # Note that using cloudapi we will only get the bearer token 47 | -------------------------------------------------------------------------------- /scripts/gofmtcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # © Broadcom. All Rights Reserved. 5 | # The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | # Check gofmt 10 | echo "==> Checking that code complies with gofmt requirements..." 11 | gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) 12 | if [[ -n ${gofmt_files} ]]; then 13 | echo 'gofmt needs running on the following files:' 14 | echo "${gofmt_files}" 15 | echo "You can use the command: \`make fmt\` to reformat code." 16 | exit 1 17 | fi 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /scripts/gosec-config.sh: -------------------------------------------------------------------------------- 1 | # 2 | # © Broadcom. All Rights Reserved. 3 | # The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # GOSEC_URL is the address of the gosec installation script 8 | export GOSEC_URL=https://raw.githubusercontent.com/securego/gosec/master/install.sh 9 | # NOTE: if we want to get the latest version, we set the variable below to empty ("") 10 | export GOSEC_VERSION=v2.22.1 11 | -------------------------------------------------------------------------------- /scripts/licensecheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | missing_license_files=$(find . -name "*.go" -type f -exec sh -c 'head -n 10 "$0" | grep -q "// © Broadcom. All Rights Reserved." || echo "License missing in: $0"' {} \;) 4 | 5 | if [ -z "$missing_license_files" ]; then 6 | exit 0 7 | else 8 | echo ${missing_license_files} 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /scripts/make-changelog.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script collects the single change files and generates CHANGELOG entries 4 | # for the whole release 5 | 6 | # .changes is the directory where the change files are 7 | sources=.changes 8 | 9 | if [ ! -d $sources ] 10 | then 11 | echo "Directory $sources not found" 12 | exit 1 13 | fi 14 | 15 | function check_eol { 16 | file_name=$1 17 | # Checks the last line of the file. 18 | # Counts the number of lines (==EOL) 19 | has_eol=$(tail -n 1 $file_name | wc -l | tr -d ' ' | tr -d '\t') 20 | 21 | # If there isn't an EOL, we add one on the spot 22 | if [ "$has_eol" == "0" ] 23 | then 24 | echo "" 25 | fi 26 | } 27 | 28 | # We must indicate a version on the command line 29 | version=$1 30 | 31 | # If no version was provided, we use the current release version 32 | if [ -z "$version" ] 33 | then 34 | echo "No version was provided" 35 | exit 1 36 | fi 37 | 38 | 39 | # If the provided version does not exist, there is nothing to do 40 | if [ ! -d $sources/$version ] 41 | then 42 | echo "# Changes directory $sources/$version not found" 43 | exit 1 44 | fi 45 | 46 | # The "sections" file contains the CHANGELOG headers 47 | if [ ! -f $sources/sections ] 48 | then 49 | echo "File $sources/sections not found" 50 | exit 1 51 | fi 52 | sections=$(cat $sources/sections) 53 | 54 | cd $sources/$version 55 | 56 | for section in $sections 57 | do 58 | # Check whether we have any file for this section 59 | num=$(ls | grep "\-${section}.md" | wc -l | tr -d ' \t') 60 | # if there are no files for this section, we skip 61 | if [ "$num" == "0" ] 62 | then 63 | continue 64 | fi 65 | 66 | # Generate the header 67 | echo "### $(echo $section | tr 'a-z' 'A-Z' | tr '-' ' ')" 68 | 69 | # Print the changes files, sorted by PR number 70 | for f in $(ls *${section}.md | sort -n) 71 | do 72 | cat $f 73 | check_eol $f 74 | done 75 | echo "" 76 | done 77 | 78 | -------------------------------------------------------------------------------- /scripts/staticcheck-config.sh: -------------------------------------------------------------------------------- 1 | export STATICCHECK_URL=https://github.com/dominikh/go-tools/releases/download 2 | export STATICCHECK_VERSION=2025.1 3 | export STATICCHECK_FILE=staticcheck_linux_amd64.tar.gz 4 | -------------------------------------------------------------------------------- /scripts/test-tags.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This test checks that all the build tags defined in api_vcd_test.go 4 | # can run individually 5 | 6 | if [ ! -d govcd ] 7 | then 8 | echo "./govcd directory missing" 9 | exit 1 10 | fi 11 | cd govcd 12 | 13 | if [ ! -f api_vcd_test.go ] 14 | then 15 | echo "file ./govcd/api_vcd_test.go not found" 16 | exit 1 17 | fi 18 | 19 | start=$(date +%s) 20 | tags=$(head -n 1 api_vcd_test.go | sed -e 's/^.*build //;s/|| //g') 21 | 22 | echo "=== RUN TagsTest" 23 | for tag in $tags 24 | do 25 | 26 | go test -tags $tag -timeout 0 -count=0 -check.vv > /dev/null 27 | 28 | if [ "$?" == "0" ] 29 | then 30 | echo " --- PASS: TagsTest/$tag" 31 | else 32 | echo " --- FAIL: TagsTest/$tag" 33 | failed="$failed $tag" 34 | fi 35 | done 36 | 37 | end=$(date +%s) 38 | elapsed=$((end-start)) 39 | if [ -n "$failed" ] 40 | then 41 | echo "--- FAIL: TagsTest - Tests for tags [$failed] have failed (${elapsed}s)" 42 | exit 1 43 | fi 44 | echo "--- PASS: TagsTest (${elapsed}s)" 45 | exit 0 46 | -------------------------------------------------------------------------------- /support/Dockerfile.jenkins: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.4 2 | 3 | ARG build_user=root 4 | ARG build_uid=0 5 | ARG build_gid=0 6 | 7 | ENV HOME /home/${build_user} 8 | ENV USER ${build_user} 9 | 10 | # Creates the build user with the provided UID/GID 11 | # values to prevent filesystem permissions issues 12 | RUN if [ "${build_uid}" != "0" ]; then \ 13 | groupadd -g ${build_gid} ${build_user}; \ 14 | useradd -c "Build user" -d $HOME -u ${build_uid} \ 15 | -g ${build_gid} -m ${build_user}; \ 16 | fi 17 | 18 | # Switch to the new build user 19 | USER ${build_user} 20 | -------------------------------------------------------------------------------- /support/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "# Build $(date)" 4 | 5 | # Print environment information, useful for troubleshooting 6 | # NOTE: we're working inside a Docker container 7 | 8 | go version 9 | 10 | echo "## USER $USER" 11 | echo "## HOME $HOME" 12 | if [ -z "$HOME" ] 13 | then 14 | echo "\$HOME is not set" 15 | exit 1 16 | fi 17 | 18 | if [ -z "$USER" ] 19 | then 20 | echo "\$USER is not set" 21 | exit 1 22 | fi 23 | 24 | echo "## PWD $PWD" 25 | echo "## GOROOT $GOROOT" 26 | echo "## GOPATH $GOPATH" 27 | echo "## OS $(uname -a)" 28 | echo "## hostname $(hostname)" 29 | 30 | echo "## GOVCD_CONFIG $GOVCD_CONFIG" 31 | if [ -n "$GOVCD_CONFIG" ] 32 | then 33 | if [ ! -f $GOVCD_CONFIG ] 34 | then 35 | echo "## $GOVCD_CONFIG not found" 36 | exit 1 37 | fi 38 | else 39 | echo "## GOVCD_CONFIG not set" 40 | exit 1 41 | fi 42 | 43 | echo "## ls \$HOME" 44 | ls -l $HOME 45 | 46 | echo "## ls -l \$PWD" 47 | ls -l 48 | 49 | echo "# Test $(date)" 50 | make vet 51 | make test 52 | -------------------------------------------------------------------------------- /support/run_in_docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SHOME=`dirname $0` 4 | cd $SHOME 5 | 6 | SRCROOT=`cd ..; pwd` 7 | cd $SRCROOT 8 | 9 | DESTINATION_SRC=/go/src/github.com/vmware/go-vcloud-director 10 | 11 | # Build the Docker image using the current uid/gid so 12 | # repeat iterations of the Jenkins environment can 13 | # properly cleanup the workspace. 14 | DOCKER_BUILD=`docker build -q \ 15 | --build-arg build_user=${USER} \ 16 | --build-arg build_uid=$(id -u) \ 17 | --build-arg build_gid=$(id -g) \ 18 | -f support/Dockerfile.jenkins \ 19 | support` 20 | DOCKER_IMAGE=`echo $DOCKER_BUILD | awk -F: '{print $2}'` 21 | 22 | # Include VCD_CONNECTION as a mounted file and environment variable 23 | VCD_ARGS="" 24 | if [ "$GOVCD_CONFIG" != "" ]; then 25 | VCD_ARGS="-eGOVCD_CONFIG=$GOVCD_CONFIG -v$GOVCD_CONFIG:$GOVCD_CONFIG" 26 | echo "$VCD_ARGS" 27 | else 28 | # If the GOVCD configuration is not set, we can't run the tests 29 | # So we interrupt as early as possible and then investigate 30 | echo "$0: GOVCD_CONFIG not set" 31 | exit 1 32 | fi 33 | 34 | # Run the Docker container with source code mounted along 35 | # with additional files and environment variables 36 | docker run --rm \ 37 | $VCD_ARGS \ 38 | --name=govcd_test \ 39 | --hostname=govcd_test \ 40 | -v$SRCROOT:$DESTINATION_SRC \ 41 | -w$DESTINATION_SRC \ 42 | $DOCKER_IMAGE \ 43 | /bin/bash -c "$*" 44 | 45 | EC=$? 46 | if [ $EC -ne 0 ]; then 47 | exit $EC 48 | fi 49 | -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticateWithCookie_REQ_adfs_services_trust_13_usernamemixed.golden: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue 6 | 7 | http://www.w3.org/2005/08/addressing/anonymous 8 | 9 | REPLACED 10 | 12 | 13 | REPLACED 14 | REPLACED 15 | 16 | 17 | fakeUser 18 | fakePass 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | https://192.168.1.109/cloud/org/my-org/saml/metadata/alias/vcd 27 | 28 | 29 | 0 30 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer 31 | 33 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue 34 | http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0 35 | 36 | 37 | -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticateWithCookie_REQ_api_sessions.golden: -------------------------------------------------------------------------------- 1 | SIGN token="H4sIAAAAAAAA/5xTTY+bMBD9K4jeKiV20l20sRxLEdnDaru5bFX16jUTsIRtZJsS+usrPhdCD6jcPPZ7b95jhj5rYevCQ3JyDqyXRgc3lWt3DEurieFOOqK5Ake8IO+nt+9kv8WED49DRm+gBRlpztzz4EddwDHMvC8IQlVVbatvW2NTtMd4h/ADuqkctPjynIMC7cNOkTREK1B3ktLoN/CZSYJTnhorfaZWkHBw+8doIz5EiBh9hfpFX83g/J9ojPChQSdOpk0P8On5FerewhrXU+z/NW8d3xgOxUal110RMnqWKTi/kmlmxGV81ySAli2NsTCaOPLrER/af9sZTdbG1ENfnCvBvoOVPL8rXrgCFl+Ov+PclElwlhaENzYwNuVa/uHtTMbNuF2l4B4oWsIHxk7gUqoPsGyHowhHD0+HpxEyu78jGppDE7eMojEEILEsMrBdfTj95HkJ7Gv7NSlOq5/nnms+M1PydqKnbyeFucTiYlbqhZY7ySharjr7GwAA///dRZE6/wMAAA==",org="my-org" -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticateWithCookie_RESP_HEADER_login_my-org_saml_login_alias_vcd.golden: -------------------------------------------------------------------------------- 1 | /adfs/ls/?SAMLRequest=lZJBT8MwDIXv%2FIoq9zZpt3UjWjsNJsQkEBMtHLhlqdsFtcmI0wL%2Fnm5lYlyQOFmW7M9P73m%2B%2BGhqrwOLyuiEhAEjHmhpCqWrhDzlN%2F6MLNKLOYqmjvZ82bqdfoS3FtB5S0Swrt%2B7NhrbBmwGtlMSnh7vErJzbo%2Bc0vAyCsJ4FoRByC6prE1bUGMr2nz6h3Lg0ix7oKJWAmknC%2BKterjSwh0VnTjvSvsxq2IWaybKKnD9kF8a25dAg6OiKJHWSIl3Y6yEo9CElKJGIN56lRBRFmxaxFs2epXAKgC5VbvxbBqqSdUfXeNGIKoOfpYQW1hrdEK7hEQsYj4b%2B9E0ZzFnEz4ZBaMJeyHexhpnpKmvlB5ca63mRqBCrkUDyJ3k2fL%2BjkcB49thCPltnm%2F8zUOWE%2B%2F55H50cL%2FPQyMf%2FP6btf8%2BTNIhHn5UbM8JfwPEKUCS%2FieuBpwohBM%2Fmc3puYD0u%2F39LukX&RelayState=aHR0cHM6Ly8xOTIuMTY4LjEuMTA5L3RlbmFudC9teS1vcmc%3D&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=EXL0%2BO1aLhXKAMCKTaqduTW5tWsg94ANZ8hC60MtT4kwitvFUQ7VsQT3qtPj8MFbz0tvN9lX79R0yRwMPilP0zb50uuaVpaJy7qUpHiPyBa5HHA2xG2beyNjlUmC%2BOJSBjfx3k6YMkEzRqfKY6KD%2BKxSMsnSJuazBrWdzihoe4dMgWDS5Dpl2YOC0Ychc1huqedCD2WlE4QRfmtXq0oXlydPVSIYCtHXF1pwYq1j9%2B2q0oK9%2BEEoha0mCMWD74t5hei0kVJldFTcSXx0kgqPi6Rih7aP8%2BlKxnUFu4%2Bo7u9n9Oh8SLV3Tz%2Ba9A9cq4OxdCzyQCOwPRYs3GCb8iIB8g%3D%3D -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticateWithCookie_RESP_api_org.golden: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticate_REQ_adfs_services_trust_13_usernamemixed.golden: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue 6 | 7 | http://www.w3.org/2005/08/addressing/anonymous 8 | 9 | REPLACED 10 | 12 | 13 | REPLACED 14 | REPLACED 15 | 16 | 17 | fakeUser 18 | fakePass 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | https://192.168.1.109/cloud/org/my-org/saml/metadata/alias/vcd 27 | 28 | 29 | 0 30 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer 31 | 33 | http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue 34 | http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0 35 | 36 | 37 | -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticate_REQ_api_sessions.golden: -------------------------------------------------------------------------------- 1 | SIGN token="H4sIAAAAAAAA/5xTTY+bMBD9K4jeKiV20l20sRxLEdnDaru5bFX16jUTsIRtZJsS+usrPhdCD6jcPPZ7b95jhj5rYevCQ3JyDqyXRgc3lWt3DEurieFOOqK5Ake8IO+nt+9kv8WED49DRm+gBRlpztzz4EddwDHMvC8IQlVVbatvW2NTtMd4h/ADuqkctPjynIMC7cNOkTREK1B3ktLoN/CZSYJTnhorfaZWkHBw+8doIz5EiBh9hfpFX83g/J9ojPChQSdOpk0P8On5FerewhrXU+z/NW8d3xgOxUal110RMnqWKTi/kmlmxGV81ySAli2NsTCaOPLrER/af9sZTdbG1ENfnCvBvoOVPL8rXrgCFl+Ov+PclElwlhaENzYwNuVa/uHtTMbNuF2l4B4oWsIHxk7gUqoPsGyHowhHD0+HpxEyu78jGppDE7eMojEEILEsMrBdfTj95HkJ7Gv7NSlOq5/nnms+M1PydqKnbyeFucTiYlbqhZY7ySharjr7GwAA///dRZE6/wMAAA==",org="my-org" -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticate_RESP_HEADER_login_my-org_saml_login_alias_vcd.golden: -------------------------------------------------------------------------------- 1 | /adfs/ls/?SAMLRequest=lZJBT8MwDIXv%2FIoq9zZpt3UjWjsNJsQkEBMtHLhlqdsFtcmI0wL%2Fnm5lYlyQOFmW7M9P73m%2B%2BGhqrwOLyuiEhAEjHmhpCqWrhDzlN%2F6MLNKLOYqmjvZ82bqdfoS3FtB5S0Swrt%2B7NhrbBmwGtlMSnh7vErJzbo%2Bc0vAyCsJ4FoRByC6prE1bUGMr2nz6h3Lg0ix7oKJWAmknC%2BKterjSwh0VnTjvSvsxq2IWaybKKnD9kF8a25dAg6OiKJHWSIl3Y6yEo9CElKJGIN56lRBRFmxaxFs2epXAKgC5VbvxbBqqSdUfXeNGIKoOfpYQW1hrdEK7hEQsYj4b%2B9E0ZzFnEz4ZBaMJeyHexhpnpKmvlB5ca63mRqBCrkUDyJ3k2fL%2BjkcB49thCPltnm%2F8zUOWE%2B%2F55H50cL%2FPQyMf%2FP6btf8%2BTNIhHn5UbM8JfwPEKUCS%2FieuBpwohBM%2Fmc3puYD0u%2F39LukX&RelayState=aHR0cHM6Ly8xOTIuMTY4LjEuMTA5L3RlbmFudC9teS1vcmc%3D&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=EXL0%2BO1aLhXKAMCKTaqduTW5tWsg94ANZ8hC60MtT4kwitvFUQ7VsQT3qtPj8MFbz0tvN9lX79R0yRwMPilP0zb50uuaVpaJy7qUpHiPyBa5HHA2xG2beyNjlUmC%2BOJSBjfx3k6YMkEzRqfKY6KD%2BKxSMsnSJuazBrWdzihoe4dMgWDS5Dpl2YOC0Ychc1huqedCD2WlE4QRfmtXq0oXlydPVSIYCtHXF1pwYq1j9%2B2q0oK9%2BEEoha0mCMWD74t5hei0kVJldFTcSXx0kgqPi6Rih7aP8%2BlKxnUFu4%2Bo7u9n9Oh8SLV3Tz%2Ba9A9cq4OxdCzyQCOwPRYs3GCb8iIB8g%3D%3D -------------------------------------------------------------------------------- /test-resources/golden/TestSamlAdfsAuthenticate_RESP_api_org.golden: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test-resources/rde_type.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "foo": { 4 | "description": "Foo definition", 5 | "properties": { 6 | "key": { 7 | "description": "Key for foo", 8 | "type": "string" 9 | } 10 | }, 11 | "type": "object" 12 | } 13 | }, 14 | "properties": { 15 | "bar": { 16 | "description": "Bar", 17 | "type": "string" 18 | }, 19 | "foo": { 20 | "$ref": "#/definitions/foo" 21 | }, 22 | "prop2": { 23 | "properties": { 24 | "subprop1": { 25 | "type": "string" 26 | }, 27 | "subprop2": { 28 | "items": { 29 | "type": "string" 30 | }, 31 | "type": "array" 32 | } 33 | }, 34 | "type": "object" 35 | } 36 | }, 37 | "required": [ 38 | "foo" 39 | ], 40 | "type": "object" 41 | } 42 | -------------------------------------------------------------------------------- /test-resources/template_with_custom_chunk_size.ova: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/template_with_custom_chunk_size.ova -------------------------------------------------------------------------------- /test-resources/template_without_vmdk_size.ova: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/template_without_vmdk_size.ova -------------------------------------------------------------------------------- /test-resources/test.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/test.iso -------------------------------------------------------------------------------- /test-resources/test_vapp_template.ova: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/test_vapp_template.ova -------------------------------------------------------------------------------- /test-resources/test_vapp_template_ovf/yVMFromVcd-disk1.vmdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/test_vapp_template_ovf/yVMFromVcd-disk1.vmdk -------------------------------------------------------------------------------- /test-resources/udf_test.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/udf_test.iso -------------------------------------------------------------------------------- /test-resources/ui_plugin.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/ui_plugin.zip -------------------------------------------------------------------------------- /test-resources/vapp_with_3_vms.ova: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware/go-vcloud-director/36b6cbcba798a3a4ad612614ce27610973961391/test-resources/vapp_with_3_vms.ova -------------------------------------------------------------------------------- /util/tar_test.go: -------------------------------------------------------------------------------- 1 | // © Broadcom. All Rights Reserved. 2 | // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 3 | // SPDX-License-Identifier: Apache-2.0 4 | 5 | package util 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | // Tests function sanitizedName providing bad paths and expects them be cleaned. 12 | // Possible security issue https://github.com/vmware/pyvcloud/pull/268 13 | func TestSanitizedName(t *testing.T) { 14 | tables := []struct { 15 | badPath string 16 | goodPath string 17 | }{ 18 | {"\\..\\1.txt", "1.txt"}, 19 | {"///foo/bar", "foo/bar"}, 20 | {"C:/loo/bar2", "loo/bar2"}, 21 | {"C:\\loo\\bar2", "loo\\bar2"}, 22 | {"../../foo../../ba..r", "foo../ba..r"}, 23 | {"../my.file", "my.file"}, 24 | } 25 | for _, table := range tables { 26 | fixedPath := sanitizedName(table.badPath) 27 | if fixedPath != table.goodPath { 28 | t.Errorf("expected and fixedPath didn't match - %s : %s", table.goodPath, fixedPath) 29 | } 30 | } 31 | } 32 | --------------------------------------------------------------------------------