├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── acceptance-test.yml │ ├── automated-test.yml │ ├── ok-to-test.yml │ └── release.yml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── GNUmakefile ├── LICENSE ├── README.md ├── examples ├── address_group_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── associate_category_to_volume_group_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── authorization_policies_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── categories │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── categories_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── cluster_add_node_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── clusters_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── deploy_templates_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── directory_services_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── discover_unconfigured_nodes_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── external_subnets │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── floating_ip │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── floating_ip_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── foundation │ ├── file_management │ │ └── main.tf │ ├── hashicorp_vault_and_foundation_imaging │ │ └── main.tf │ ├── image_bare_metal_nodes │ │ └── main.tf │ ├── image_nutanix_imaged_node │ │ └── main.tf │ ├── install.nutanix.com │ │ ├── config.json │ │ └── main.tf │ ├── ipmi_config │ │ └── main.tf │ └── node_discovery_and_network_details │ │ └── main.tf ├── foundationCentral │ ├── api_keys │ │ └── main.tf │ ├── imaged_clusters │ │ └── main.tf │ └── imaged_nodes │ │ └── main.tf ├── hosts_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── image_placement_policy_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── images_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── lcm_config_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── lcm_entities_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── lcm_upgrade_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── ndb │ ├── clone │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── clone_refresh │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── cluster │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── database_instance │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── database_register │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── database_restore │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── database_scale │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── database_snapshot │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── dbservervm_register │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── linked_databases │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── log_catchups │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── maintenance_window │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── network │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── profiles │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── sla │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── tags │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ └── time_machine_clusters │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf ├── network_security_policies_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── ngt_configuration_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── ngt_insert_iso_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── ngt_installations_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── ngt_upgrade_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── operations_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── overlay_subnets │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pbr │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pbr_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_backup_target_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_deploy_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_registration_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_restore_point_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_restore_source_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_restore_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_unregistration_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── pc_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── projects │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── promote_protected_resource_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── protected_resource_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── protection_policy_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── protection_rule │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── recovery_plan │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── recovery_point_replicat_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── recovery_point_restore_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── recovery_point_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── restorable_pcs_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── restore_protected_resource_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── role │ ├── main.tf │ ├── outputs.tf │ ├── variables.tf │ └── versions.tf ├── roles_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── route_tables_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── routes_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── saml_idp_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── security_rules │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── selfservice │ ├── app_provision │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── custom_action │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── patch_action │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── recovery_point │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ └── restore │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── variables.tf ├── service_group_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── static_routes │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── storage_containers_stats_info_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── storage_containers_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── subnets │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── subnets_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── subnets_with_client_side_filters │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── template_guest_os_actions_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── template_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── unconfigured_node_networks_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── user_groups │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── user_groups_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── users_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── virtual_machine │ └── main.tf ├── virtual_machine_clone_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── virtual_machine_gc_update_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── virtual_machine_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── virtual_machine_with_dynamic_disk_list │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── virtual_machine_with_ngt_install │ ├── main.tf │ ├── resources │ │ └── cloud-init │ │ │ └── ubuntu.tpl │ ├── terraform.tfvars │ └── variables.tf ├── vm_cdrom_insert_eject_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vm_network_device_assign_ip_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vm_network_device_migrate_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vm_recovery_point_info_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vm_revert_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vm_shutdown_action_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── volume_group_attach_vm_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── volume_group_disk_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── volume_group_iscsi_client_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── volume_group_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── volume_iscsi_clients_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── vpc │ └── main.tf └── vpc_v2 │ ├── main.tf │ ├── terraform.tfvars │ └── variables.tf ├── future ├── clusters │ ├── data_source_nutanix_cluster_snmp_trap_v2.go.future │ ├── data_source_nutanix_cluster_snmp_user_v2.go.future │ ├── docs │ │ └── r │ │ │ ├── cluster_snmp_add_transport_port_v2.html.markdown.future │ │ │ ├── cluster_snmp_trap_v2.html.markdown.future │ │ │ └── cluster_snmp_user_v2.html.markdown.future │ ├── resource_nutanix_cluster_entity_snmp_add_transport_port_v2.go.future │ ├── resource_nutanix_cluster_entity_snmp_remove_transport_port_v2.go.future │ ├── resource_nutanix_cluster_entity_snmp_trap_v2.go.future │ └── resource_nutanix_cluster_entity_snmp_user_v2.go.future ├── pe_pc_registration_v2 │ ├── datasource_nutanix_pe_pc_registration_entities_v2.go.future │ ├── datasource_nutanix_pe_pc_registration_entities_v2.go.test.go.future │ ├── datasource_nutanix_pe_pc_registration_entity_v2.go.future │ └── datasource_nutanix_pe_pc_registration_entity_v2.go.test.go.future └── volume_group │ ├── data_source_nutanix_volume_group.go.future │ ├── data_source_nutanix_volume_group_test.go.future │ ├── data_source_nutanix_volume_groups.go.future │ ├── data_source_nutanix_volume_groups_test.go.future │ ├── resource_nutanix_volume_group.go.future │ └── resource_nutanix_volume_group_test.go.future ├── go.mod ├── go.sum ├── main.go ├── modules ├── README.md ├── foundation │ ├── aos-based-node-imaging │ │ └── node-serials-filter │ │ │ ├── README.md │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── variables.tf │ │ │ └── version.tf │ ├── discover-nodes-network-details │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── version.tf │ ├── dos-based-node-imaging │ │ └── node-serials-filter │ │ │ ├── README.md │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── variables.tf │ │ │ └── version.tf │ ├── examples │ │ ├── image-bare-metal-nodes │ │ │ └── main.tf │ │ ├── image-cvm-running-nodes │ │ │ └── main.tf │ │ └── image-dos-running-nodes │ │ │ └── main.tf │ └── manual-node-imaging │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ ├── variables.tf │ │ └── version.tf └── foundationCentral │ ├── aos-based-node-imaging │ └── node-serial-filter │ │ ├── main.tf │ │ ├── output.tf │ │ ├── readme.md │ │ ├── variables.tf │ │ └── version.tf │ ├── examples │ ├── image-aos-nodes │ │ └── main.tf │ └── image-manual-nodes │ │ └── main.tf │ └── manual-node-imaging │ └── node-serial-filter │ ├── main.tf │ ├── output.tf │ ├── readme.md │ ├── variables.tf │ └── version.tf ├── nutanix ├── acctest │ └── acctest.go ├── client │ ├── client.go │ └── client_test.go ├── common │ └── common.go ├── config.go ├── config_test.go ├── internal │ └── data_source_assert_helper.go ├── provider │ └── provider.go ├── sdks │ ├── v3 │ │ ├── era │ │ │ ├── era.go │ │ │ ├── era_service.go │ │ │ └── era_structs.go │ │ ├── fc │ │ │ ├── fc.go │ │ │ ├── fc_service.go │ │ │ ├── fc_service_test.go │ │ │ ├── fc_structs.go │ │ │ └── fc_test.go │ │ ├── foundation │ │ │ ├── foundation_api.go │ │ │ ├── foundation_api_test.go │ │ │ ├── foundation_file_management_service.go │ │ │ ├── foundation_file_management_service_test.go │ │ │ ├── foundation_networking_service.go │ │ │ ├── foundation_networking_service_test.go │ │ │ ├── foundation_node_imaging_service.go │ │ │ ├── foundation_node_imaging_service_test.go │ │ │ └── foundation_structs.go │ │ ├── karbon │ │ │ ├── karbon_api.go │ │ │ ├── karbon_api_test.go │ │ │ ├── karbon_cluster_service.go │ │ │ ├── karbon_cluster_structs.go │ │ │ ├── karbon_meta_service.go │ │ │ ├── karbon_meta_structs.go │ │ │ ├── karbon_private_registry_service.go │ │ │ └── karbon_private_registry_structs.go │ │ ├── prism │ │ │ ├── prism.go │ │ │ ├── prism_service.go │ │ │ ├── prism_service_test.go │ │ │ ├── prism_structs.go │ │ │ └── prism_test.go │ │ └── selfservice │ │ │ ├── calm.go │ │ │ ├── calm_service.go │ │ │ ├── calm_structs.go │ │ │ └── constants_api.go │ └── v4 │ │ ├── clusters │ │ └── clusters.go │ │ ├── datapolicies │ │ └── datapolicies.go │ │ ├── dataprotection │ │ └── dataprotection.go │ │ ├── iam │ │ └── iam.go │ │ ├── lcm │ │ └── lcm.go │ │ ├── microseg │ │ └── microseg.go │ │ ├── networking │ │ └── networking.go │ │ ├── prism │ │ └── prism.go │ │ ├── vmm │ │ └── vmm.go │ │ └── volumes │ │ └── volumes.go └── services │ ├── clusters │ ├── categories.go │ ├── categories_schema_migrate.go │ ├── categories_schema_migrate_test.go │ ├── data_source_nutanix_cluster.go │ ├── data_source_nutanix_cluster_test.go │ ├── data_source_nutanix_clusters.go │ ├── data_source_nutanix_clusters_test.go │ ├── data_source_nutanix_host.go │ ├── data_source_nutanix_host_test.go │ ├── data_source_nutanix_hosts.go │ ├── data_source_nutanix_hosts_test.go │ └── helpers.go │ ├── clustersv2 │ ├── data_source_nutanix_cluster_entities_v2.go │ ├── data_source_nutanix_cluster_entities_v2_test.go │ ├── data_source_nutanix_cluster_entity_v2.go │ ├── data_source_nutanix_cluster_entity_v2_test.go │ ├── data_source_nutanix_host_entities_v2.go │ ├── data_source_nutanix_host_entities_v2_test.go │ ├── data_source_nutanix_host_entity_v2.go │ ├── data_source_nutanix_host_entity_v2_test.go │ ├── helper.go │ ├── main_test.go │ ├── resource_nutanix_cluster_discover_unconfigured_nodes_v2.go │ ├── resource_nutanix_cluster_discover_unconfigured_nodes_v2_test.go │ ├── resource_nutanix_cluster_entity_add_node_v2.go │ ├── resource_nutanix_cluster_entity_add_node_v2_test.go │ ├── resource_nutanix_cluster_entity_v2.go │ ├── resource_nutanix_cluster_entity_v2_test.go │ ├── resource_nutanix_cluster_fetch_networks_v2.go │ ├── resource_nutanix_cluster_fetch_networks_v2_test.go │ ├── resource_nutanix_pc_registration_v2.go │ └── resource_nutanix_pc_registration_v2_test.go │ ├── datapoliciesv2 │ ├── data_source_nutanix_protection_policies_v2.go │ ├── data_source_nutanix_protection_policies_v2_test.go │ ├── data_source_nutanix_protection_policy_v2.go │ ├── data_source_nutanix_protection_policy_v2_test.go │ ├── helper_test.go │ ├── main_test.go │ ├── resource_nutanix_protection_policy_v2.go │ └── resource_nutanix_protection_policy_v2_test.go │ ├── dataprotectionv2 │ ├── data_source_nutanix_get_protected_resource_v2.go │ ├── data_source_nutanix_get_protected_resource_v2_test.go │ ├── data_source_nutanix_recovery_point_v2.go │ ├── data_source_nutanix_recovery_point_v2_test.go │ ├── data_source_nutanix_recovery_points_v2.go │ ├── data_source_nutanix_recovery_points_v2_test.go │ ├── data_source_nutanix_vm_recovery_point_info_v2.go │ ├── data_source_nutanix_vm_recovery_point_info_v2_test.go │ ├── helper_test.go │ ├── main_test.go │ ├── resource_nutanix_promote_protected_resource_v2.go │ ├── resource_nutanix_promote_protected_resource_v2_test.go │ ├── resource_nutanix_recovery_points_replicate_v2.go │ ├── resource_nutanix_recovery_points_replicate_v2_test.go │ ├── resource_nutanix_recovery_points_restore_v2.go │ ├── resource_nutanix_recovery_points_restore_v2_test.go │ ├── resource_nutanix_recovery_points_v2.go │ ├── resource_nutanix_recovery_points_v2_test.go │ ├── resource_nutanix_restore_protected_resource_v2.go │ └── resource_nutanix_restore_protected_resource_v2_test.go │ ├── foundation │ ├── data_source_nutanix_foundation_discover_nodes.go │ ├── data_source_nutanix_foundation_discover_nodes_test.go │ ├── data_source_nutanix_foundation_hypervisor_isos.go │ ├── data_source_nutanix_foundation_hypervisor_isos_test.go │ ├── data_source_nutanix_foundation_node_network_details.go │ ├── data_source_nutanix_foundation_node_network_details_test.go │ ├── data_source_nutanix_foundation_nos_packages.go │ ├── data_source_nutanix_foundation_nos_packages_test.go │ ├── main_test.go │ ├── resource_nutanix_foundation_image.go │ ├── resource_nutanix_foundation_image_nodes.go │ ├── resource_nutanix_foundation_image_nodes_test.go │ ├── resource_nutanix_foundation_image_test.go │ ├── resource_nutanix_foundation_ipmi_config.go │ └── resource_nutanix_foundation_ipmi_config_test.go │ ├── foundationCentral │ ├── data_source_nutanix_foundation_central_api_keys.go │ ├── data_source_nutanix_foundation_central_api_keys_test.go │ ├── data_source_nutanix_foundation_central_cluster_details.go │ ├── data_source_nutanix_foundation_central_cluster_details_test.go │ ├── data_source_nutanix_foundation_central_imaged_clusters_list.go │ ├── data_source_nutanix_foundation_central_imaged_clusters_list_test.go │ ├── data_source_nutanix_foundation_central_imaged_node_details.go │ ├── data_source_nutanix_foundation_central_imaged_node_details_test.go │ ├── data_source_nutanix_foundation_central_imaged_nodes_list.go │ ├── data_source_nutanix_foundation_central_imaged_nodes_list_test.go │ ├── data_source_nutanix_foundation_central_list_api_keys.go │ ├── data_source_nutanix_foundation_central_list_api_keys_test.go │ ├── main_test.go │ ├── resource_nutanix_foundation_central_api_keys.go │ ├── resource_nutanix_foundation_central_api_keys_test.go │ ├── resource_nutanix_foundation_central_image_nodes.go │ └── resource_nutanix_foundation_central_image_nodes_test.go │ ├── iam │ ├── categories.go │ ├── data_source_nutanix_access_control_policies.go │ ├── data_source_nutanix_access_control_policies_test.go │ ├── data_source_nutanix_access_control_policy.go │ ├── data_source_nutanix_access_control_policy_test.go │ ├── data_source_nutanix_permission.go │ ├── data_source_nutanix_permission_test.go │ ├── data_source_nutanix_permissions.go │ ├── data_source_nutanix_permissions_test.go │ ├── data_source_nutanix_role.go │ ├── data_source_nutanix_role_test.go │ ├── data_source_nutanix_roles.go │ ├── data_source_nutanix_roles_test.go │ ├── data_source_nutanix_user.go │ ├── data_source_nutanix_user_group.go │ ├── data_source_nutanix_user_group_test.go │ ├── data_source_nutanix_user_groups.go │ ├── data_source_nutanix_user_groups_test.go │ ├── data_source_nutanix_user_test.go │ ├── data_source_nutanix_users.go │ ├── data_source_nutanix_users_test.go │ ├── helpers.go │ ├── main_test.go │ ├── resource_nutanix_role.go │ ├── resource_nutanix_role_test.go │ ├── resource_nutanix_user.go │ ├── resource_nutanix_user_groups.go │ ├── resource_nutanix_user_groups_test.go │ └── resource_nutanix_user_test.go │ ├── iamv2 │ ├── data_source_nutanix_authorization_policies_v2.go │ ├── data_source_nutanix_authorization_policies_v2_test.go │ ├── data_source_nutanix_authorization_policy_v2.go │ ├── data_source_nutanix_authorization_policy_v2_test.go │ ├── data_source_nutanix_directory_service_v2.go │ ├── data_source_nutanix_directory_service_v2_test.go │ ├── data_source_nutanix_directory_services_v2.go │ ├── data_source_nutanix_directory_services_v2_test.go │ ├── data_source_nutanix_operation_v2.go │ ├── data_source_nutanix_operation_v2_test.go │ ├── data_source_nutanix_operations_v2.go │ ├── data_source_nutanix_operations_v2_test.go │ ├── data_source_nutanix_role_v2.go │ ├── data_source_nutanix_role_v2_test.go │ ├── data_source_nutanix_roles_v2.go │ ├── data_source_nutanix_roles_v2_test.go │ ├── data_source_nutanix_saml_idp_v2.go │ ├── data_source_nutanix_saml_idp_v2_test.go │ ├── data_source_nutanix_saml_idps_v2.go │ ├── data_source_nutanix_saml_idps_v2_test.go │ ├── data_source_nutanix_user_group_v2.go │ ├── data_source_nutanix_user_group_v2_test.go │ ├── data_source_nutanix_user_groups_v2.go │ ├── data_source_nutanix_user_groups_v2_test.go │ ├── datasource_nutanix_user_v2.go │ ├── datasource_nutanix_user_v2_test.go │ ├── datasource_nutanix_users_v2.go │ ├── datasource_nutanix_users_v2_test.go │ ├── helper_test.go │ ├── main_test.go │ ├── resource_nutanix_authorization_policies_v2.go │ ├── resource_nutanix_authorization_policies_v2_test.go │ ├── resource_nutanix_directory_services_v2.go │ ├── resource_nutanix_directory_services_v2_test.go │ ├── resource_nutanix_roles_v2.go │ ├── resource_nutanix_roles_v2_test.go │ ├── resource_nutanix_saml_idp_v2.go │ ├── resource_nutanix_saml_idp_v2_test.go │ ├── resource_nutanix_user_groups_v2.go │ ├── resource_nutanix_user_groups_v2_test.go │ ├── resource_nutanix_users_v2.go │ └── resource_nutanix_users_v2_test.go │ ├── lcmv2 │ ├── data_source_lcm_config.go │ ├── data_source_lcm_entities_v2.go │ ├── data_source_lcm_entitiy_v2.go │ ├── data_source_lcm_status_v2.go │ ├── main_test.go │ ├── resource_nutanix_lcm_config_v2.go │ ├── resource_nutanix_lcm_config_v2_test.go │ ├── resource_nutanix_lcm_inventory_v2.go │ ├── resource_nutanix_lcm_inventory_v2_test.go │ ├── resource_nutanix_lcm_prechecks_v2.go │ ├── resource_nutanix_lcm_prechecks_v2_test.go │ ├── resource_nutanix_lcm_upgrade_v2.go │ └── resource_nutanix_lcm_upgrade_v2_test.go │ ├── ndb │ ├── common_era_schema.go │ ├── common_schema_validation.go │ ├── data_source_nutanix_ndb_clone.go │ ├── data_source_nutanix_ndb_clones.go │ ├── data_source_nutanix_ndb_cluster.go │ ├── data_source_nutanix_ndb_cluster_test.go │ ├── data_source_nutanix_ndb_clusters.go │ ├── data_source_nutanix_ndb_clusters_test.go │ ├── data_source_nutanix_ndb_database.go │ ├── data_source_nutanix_ndb_database_test.go │ ├── data_source_nutanix_ndb_databases.go │ ├── data_source_nutanix_ndb_databases_test.go │ ├── data_source_nutanix_ndb_dbserver.go │ ├── data_source_nutanix_ndb_dbserver_test.go │ ├── data_source_nutanix_ndb_dbservers.go │ ├── data_source_nutanix_ndb_dbservers_test.go │ ├── data_source_nutanix_ndb_maintenance_window.go │ ├── data_source_nutanix_ndb_maintenance_window_test.go │ ├── data_source_nutanix_ndb_maintenance_windows_list.go │ ├── data_source_nutanix_ndb_maintenance_windows_list_test.go │ ├── data_source_nutanix_ndb_network.go │ ├── data_source_nutanix_ndb_network_test.go │ ├── data_source_nutanix_ndb_networks.go │ ├── data_source_nutanix_ndb_networks_test.go │ ├── data_source_nutanix_ndb_profile.go │ ├── data_source_nutanix_ndb_profile_test.go │ ├── data_source_nutanix_ndb_profiles.go │ ├── data_source_nutanix_ndb_profiles_available_ips.go │ ├── data_source_nutanix_ndb_profiles_available_ips_test.go │ ├── data_source_nutanix_ndb_profiles_test.go │ ├── data_source_nutanix_ndb_sla.go │ ├── data_source_nutanix_ndb_sla_test.go │ ├── data_source_nutanix_ndb_slas.go │ ├── data_source_nutanix_ndb_slas_test.go │ ├── data_source_nutanix_ndb_snapshot.go │ ├── data_source_nutanix_ndb_snapshot_test.go │ ├── data_source_nutanix_ndb_snapshots.go │ ├── data_source_nutanix_ndb_snapshots_test.go │ ├── data_source_nutanix_ndb_tag.go │ ├── data_source_nutanix_ndb_tag_test.go │ ├── data_source_nutanix_ndb_tags.go │ ├── data_source_nutanix_ndb_tags_test.go │ ├── data_source_nutanix_ndb_time_machine.go │ ├── data_source_nutanix_ndb_time_machine_capability.go │ ├── data_source_nutanix_ndb_time_machine_capability_test.go │ ├── data_source_nutanix_ndb_time_machine_test.go │ ├── data_source_nutanix_ndb_time_machines.go │ ├── data_source_nutanix_ndb_time_machines_test.go │ ├── main_test.go │ ├── resource_nutanix_ndb_authorize_dbservers.go │ ├── resource_nutanix_ndb_clone.go │ ├── resource_nutanix_ndb_clone_refresh.go │ ├── resource_nutanix_ndb_clone_refresh_test.go │ ├── resource_nutanix_ndb_clone_test.go │ ├── resource_nutanix_ndb_cluster.go │ ├── resource_nutanix_ndb_cluster_test.go │ ├── resource_nutanix_ndb_database.go │ ├── resource_nutanix_ndb_database_restore.go │ ├── resource_nutanix_ndb_database_scale.go │ ├── resource_nutanix_ndb_database_scale_test.go │ ├── resource_nutanix_ndb_database_snapshot.go │ ├── resource_nutanix_ndb_database_snapshot_test.go │ ├── resource_nutanix_ndb_database_test.go │ ├── resource_nutanix_ndb_dbservervm.go │ ├── resource_nutanix_ndb_dbservervm_register.go │ ├── resource_nutanix_ndb_dbservervm_test.go │ ├── resource_nutanix_ndb_linked_databases.go │ ├── resource_nutanix_ndb_linked_databases_test.go │ ├── resource_nutanix_ndb_log_catchups.go │ ├── resource_nutanix_ndb_log_catchups_test.go │ ├── resource_nutanix_ndb_maintenance_task.go │ ├── resource_nutanix_ndb_maintenance_task_test.go │ ├── resource_nutanix_ndb_maintenance_window.go │ ├── resource_nutanix_ndb_maintenance_window_test.go │ ├── resource_nutanix_ndb_network.go │ ├── resource_nutanix_ndb_profiles.go │ ├── resource_nutanix_ndb_profiles_test.go │ ├── resource_nutanix_ndb_register_database.go │ ├── resource_nutanix_ndb_sla.go │ ├── resource_nutanix_ndb_sla_test.go │ ├── resource_nutanix_ndb_software_version_profile.go │ ├── resource_nutanix_ndb_stretched_vlans.go │ ├── resource_nutanix_ndb_tags.go │ ├── resource_nutanix_ndb_tags_test.go │ └── resource_nutanix_ndb_time_machine_cluster.go │ ├── networking │ ├── categories.go │ ├── categories_schema_migrate.go │ ├── categories_schema_migrate_test.go │ ├── data_source_nutanix_address_group.go │ ├── data_source_nutanix_address_group_test.go │ ├── data_source_nutanix_address_groups.go │ ├── data_source_nutanix_address_groups_test.go │ ├── data_source_nutanix_floating_ip.go │ ├── data_source_nutanix_floating_ip_test.go │ ├── data_source_nutanix_floating_ips.go │ ├── data_source_nutanix_floating_ips_test.go │ ├── data_source_nutanix_network_security_rule.go │ ├── data_source_nutanix_network_security_rule_test.go │ ├── data_source_nutanix_pbr.go │ ├── data_source_nutanix_pbr_test.go │ ├── data_source_nutanix_pbrs.go │ ├── data_source_nutanix_pbrs_test.go │ ├── data_source_nutanix_service_group.go │ ├── data_source_nutanix_service_group_test.go │ ├── data_source_nutanix_service_groups.go │ ├── data_source_nutanix_service_groups_test.go │ ├── data_source_nutanix_static_routes.go │ ├── data_source_nutanix_static_routes_test.go │ ├── data_source_nutanix_subnet.go │ ├── data_source_nutanix_subnet_test.go │ ├── data_source_nutanix_subnets.go │ ├── data_source_nutanix_subnets_test.go │ ├── data_source_nutanix_vpc.go │ ├── data_source_nutanix_vpc_test.go │ ├── data_source_nutanix_vpcs.go │ ├── data_source_nutanix_vpcs_test.go │ ├── filters.go │ ├── filters_test.go │ ├── helpers.go │ ├── main_test.go │ ├── resource_nutanix_address_group.go │ ├── resource_nutanix_address_group_test.go │ ├── resource_nutanix_floating_ip.go │ ├── resource_nutanix_floating_ip_test.go │ ├── resource_nutanix_network_security_rule.go │ ├── resource_nutanix_network_security_rule_test.go │ ├── resource_nutanix_pbr.go │ ├── resource_nutanix_pbr_test.go │ ├── resource_nutanix_service_group.go │ ├── resource_nutanix_service_group_test.go │ ├── resource_nutanix_static_routes.go │ ├── resource_nutanix_static_routes_test.go │ ├── resource_nutanix_subnet.go │ ├── resource_nutanix_subnet_test.go │ ├── resource_nutanix_vpc.go │ ├── resource_nutanix_vpc_test.go │ ├── structure.go │ └── structure_test.go │ ├── networkingv2 │ ├── data_source_nutanix_address_group_v2.go │ ├── data_source_nutanix_address_group_v2_test.go │ ├── data_source_nutanix_address_groups_v2.go │ ├── data_source_nutanix_address_groups_v2_test.go │ ├── data_source_nutanix_floating_ip_v2.go │ ├── data_source_nutanix_floating_ip_v2_test.go │ ├── data_source_nutanix_floating_ips_v2.go │ ├── data_source_nutanix_floating_ips_v2_test.go │ ├── data_source_nutanix_network_security_policies_v2.go │ ├── data_source_nutanix_network_security_policies_v2_test.go │ ├── data_source_nutanix_network_security_policy_v2.go │ ├── data_source_nutanix_network_security_policy_v2_test.go │ ├── data_source_nutanix_pbr_v2.go │ ├── data_source_nutanix_pbr_v2_test.go │ ├── data_source_nutanix_pbrs_v2.go │ ├── data_source_nutanix_pbrs_v2_test.go │ ├── data_source_nutanix_route_table_v2.go │ ├── data_source_nutanix_route_table_v2_test.go │ ├── data_source_nutanix_route_tables_v2.go │ ├── data_source_nutanix_route_tables_v2_test.go │ ├── data_source_nutanix_route_v2.go │ ├── data_source_nutanix_route_v2_test.go │ ├── data_source_nutanix_routes_v2.go │ ├── data_source_nutanix_routes_v2_test.go │ ├── data_source_nutanix_service_group_v2.go │ ├── data_source_nutanix_service_group_v2_test.go │ ├── data_source_nutanix_service_groups_v2.go │ ├── data_source_nutanix_service_groups_v2_test.go │ ├── data_source_nutanix_subnet_v2.go │ ├── data_source_nutanix_subnet_v2_test.go │ ├── data_source_nutanix_subnets_v2.go │ ├── data_source_nutanix_subnets_v2_test.go │ ├── data_source_nutanix_vpc_v2.go │ ├── data_source_nutanix_vpc_v2_test.go │ ├── data_source_nutanix_vpcs_v2.go │ ├── data_source_nutanix_vpcs_v2_test.go │ ├── helper_test.go │ ├── main_test.go │ ├── resource_nutanix_address_groups_V2.go │ ├── resource_nutanix_address_groups_v2_test.go │ ├── resource_nutanix_floating_ip_v2.go │ ├── resource_nutanix_floating_ip_v2_test.go │ ├── resource_nutanix_network_security_policies_v2.go │ ├── resource_nutanix_network_security_policies_v2_test.go │ ├── resource_nutanix_pbrs_v2.go │ ├── resource_nutanix_pbrs_v2_test.go │ ├── resource_nutanix_routes_v2.go │ ├── resource_nutanix_routes_v2_test.go │ ├── resource_nutanix_service_groups_v2.go │ ├── resource_nutanix_service_groups_v2_test.go │ ├── resource_nutanix_subnets_v2.go │ ├── resource_nutanix_subnets_v2_test.go │ ├── resource_nutanix_vpcs_v2.go │ └── resource_nutanix_vpcs_v2_test.go │ ├── nke │ ├── data_source_nutanix_karbon_cluster.go │ ├── data_source_nutanix_karbon_cluster_kubeconfig.go │ ├── data_source_nutanix_karbon_cluster_kubeconfig_test.go │ ├── data_source_nutanix_karbon_cluster_ssh.go │ ├── data_source_nutanix_karbon_cluster_ssh_test.go │ ├── data_source_nutanix_karbon_cluster_test.go │ ├── data_source_nutanix_karbon_clusters.go │ ├── data_source_nutanix_karbon_clusters_test.go │ ├── data_source_nutanix_karbon_private_registries.go │ ├── data_source_nutanix_karbon_private_registry.go │ ├── main_test.go │ ├── resource_nutanix_karbon_cluster.go │ ├── resource_nutanix_karbon_cluster_test.go │ ├── resource_nutanix_karbon_cluster_worker_pool.go │ ├── resource_nutanix_karbon_cluster_worker_pool_test.go │ └── resource_nutanix_karbon_private_registry.go │ ├── prism │ ├── categories.go │ ├── categories_schema_migrate.go │ ├── categories_schema_migrate_test.go │ ├── common_schema_validation.go │ ├── data_source_nutanix_assert_helper_test.go │ ├── data_source_nutanix_category_key.go │ ├── data_source_nutanix_category_key_test.go │ ├── data_source_nutanix_project.go │ ├── data_source_nutanix_project_test.go │ ├── data_source_nutanix_projects.go │ ├── data_source_nutanix_projects_test.go │ ├── data_source_protection_rule.go │ ├── data_source_protection_rule_test.go │ ├── data_source_protection_rules.go │ ├── data_source_protection_rules_test.go │ ├── data_source_recovery_plan.go │ ├── data_source_recovery_plan_test.go │ ├── data_source_recovery_plans.go │ ├── data_source_recovery_plans_test.go │ ├── filters.go │ ├── filters_test.go │ ├── helpers.go │ ├── main_test.go │ ├── resource_nutanix_access_control_policy.go │ ├── resource_nutanix_access_control_policy_test.go │ ├── resource_nutanix_category_key.go │ ├── resource_nutanix_category_key_test.go │ ├── resource_nutanix_category_value.go │ ├── resource_nutanix_category_value_test.go │ ├── resource_nutanix_project.go │ ├── resource_nutanix_project_test.go │ ├── resource_nutanix_protection_rule.go │ ├── resource_nutanix_protection_rule_test.go │ ├── resource_nutanix_recovery_plan.go │ ├── resource_nutanix_recovery_plan_test.go │ ├── role_mapping.go │ ├── structure.go │ └── structure_test.go │ ├── prismv2 │ ├── data_source_nutanix_categories_v2.go │ ├── data_source_nutanix_categories_v2_test.go │ ├── data_source_nutanix_category_v2.go │ ├── data_source_nutanix_category_v2_test.go │ ├── data_source_nutanix_pc_backup_target_v2.go │ ├── data_source_nutanix_pc_backup_target_v2_test.go │ ├── data_source_nutanix_pc_backup_targets_v2.go │ ├── data_source_nutanix_pc_backup_targets_v2_test.go │ ├── data_source_nutanix_pc_restore_point_v2.go │ ├── data_source_nutanix_pc_restore_point_v2_test.go │ ├── data_source_nutanix_pc_restore_points_v2.go │ ├── data_source_nutanix_pc_restore_points_v2_test.go │ ├── data_source_nutanix_pc_restore_source_v2.go │ ├── data_source_nutanix_pc_restore_source_v2_test.go │ ├── data_source_nutanix_pc_v2.go │ ├── data_source_nutanix_pc_v2_test.go │ ├── data_source_nutanix_pcs_v2.go │ ├── data_source_nutanix_pcs_v2_test.go │ ├── data_source_nutanix_restorable_pcs_v2.go │ ├── data_source_nutanix_restorable_pcs_v2_test.go │ ├── helper.go │ ├── helper_test.go │ ├── main_test.go │ ├── resource_nutanix_categories_v2.go │ ├── resource_nutanix_categories_v2_test.go │ ├── resource_nutanix_pc_backup_target_v2.go │ ├── resource_nutanix_pc_backup_target_v2_test.go │ ├── resource_nutanix_pc_deploy_v2.go │ ├── resource_nutanix_pc_deploy_v2_test.go │ ├── resource_nutanix_pc_registration_v2.go │ ├── resource_nutanix_pc_registration_v2_test.go │ ├── resource_nutanix_pc_restore_source_v2.go │ ├── resource_nutanix_pc_restore_source_v2_test.go │ ├── resource_nutanix_pc_restore_v2.go │ ├── resource_nutanix_pc_restore_v2_test.go │ ├── resource_nutanix_pc_unregistration_v2.go │ └── resource_nutanix_pc_unregistration_v2_test.go │ ├── selfservice │ ├── data_nutanix_self_service_app.go │ ├── data_nutanix_self_service_app_test.go │ ├── data_nutanix_self_service_runtime_editables.go │ ├── data_nutanix_self_service_snapshot_policy.go │ ├── data_nutanix_self_service_snapshot_policy_test.go │ ├── data_nutanix_self_service_snapshots.go │ ├── data_nutanix_self_service_snapshots_test.go │ ├── main_test.go │ ├── resource_nutanix_calm_self_service_provision_test.go │ ├── resource_nutanix_self_service_app_custom_action.go │ ├── resource_nutanix_self_service_app_custom_action_test.go │ ├── resource_nutanix_self_service_app_patch.go │ ├── resource_nutanix_self_service_app_patch_test.go │ ├── resource_nutanix_self_service_app_provision.go │ ├── resource_nutanix_self_service_app_recovery_point.go │ ├── resource_nutanix_self_service_app_recovery_point_test.go │ ├── resource_nutanix_self_service_app_restore.go │ └── resource_nutanix_self_service_app_restore_test.go │ ├── storagecontainersv2 │ ├── data_source_nutanix_storage_container_stats.go │ ├── data_source_nutanix_storage_container_stats_test.go │ ├── data_source_nutanix_storge_container.go │ ├── data_source_nutanix_storge_container_test.go │ ├── data_source_nutanix_storge_containers.go │ ├── data_source_nutanix_storge_containers_test.go │ ├── main_test.go │ ├── resource_nutanix_storge_containers_test.go │ └── resource_nutanix_storge_containers_v2.go │ ├── vmm │ ├── categories.go │ ├── categories_schema_migrate.go │ ├── categories_schema_migrate_test.go │ ├── data_source_nutanix_image.go │ ├── data_source_nutanix_image_test.go │ ├── data_source_nutanix_virtual_machine.go │ ├── data_source_nutanix_virtual_machine_test.go │ ├── helpers.go │ ├── resource_nutanix_image.go │ ├── resource_nutanix_image_test.go │ ├── resource_nutanix_virtual_machine.go │ ├── resource_nutanix_virtual_machine_test.go │ ├── structure.go │ └── structure_test.go │ ├── vmmv2 │ ├── data_source_nutanix_image_placement_v2.go │ ├── data_source_nutanix_image_placement_v2_test.go │ ├── data_source_nutanix_image_placements_v2.go │ ├── data_source_nutanix_image_placements_v2_test.go │ ├── data_source_nutanix_image_v2.go │ ├── data_source_nutanix_image_v2_test.go │ ├── data_source_nutanix_images_v2.go │ ├── data_source_nutanix_images_v2_test.go │ ├── data_source_nutanix_ngt_configration_v2.go │ ├── data_source_nutanix_ngt_configration_v2_test.go │ ├── data_source_nutanix_template_v2.go │ ├── data_source_nutanix_template_v2_test.go │ ├── data_source_nutanix_templates_v2.go │ ├── data_source_nutanix_templates_v2_test.go │ ├── data_source_nutanix_virtual_machine_v2.go │ ├── data_source_nutanix_virtual_machine_v2_test.go │ ├── data_source_nutanix_virtual_machines_v2.go │ ├── data_source_nutanix_virtual_machines_v2_test.go │ ├── helper.go │ ├── main_test.go │ ├── resource_nutanix_image_placement_v2.go │ ├── resource_nutanix_image_placement_v2_test.go │ ├── resource_nutanix_image_v2.go │ ├── resource_nutanix_image_v2_test.go │ ├── resource_nutanix_ngt_insert_iso_v2.go │ ├── resource_nutanix_ngt_insert_iso_v2_test.go │ ├── resource_nutanix_ngt_installation_v2.go │ ├── resource_nutanix_ngt_installation_v2_test.go │ ├── resource_nutanix_ngt_upgrade_v2.go │ ├── resource_nutanix_ngt_upgrade_v2_test.go │ ├── resource_nutanix_template_deploy_v2.go │ ├── resource_nutanix_template_deploy_v2_test.go │ ├── resource_nutanix_template_guest_os_actions_v2.go │ ├── resource_nutanix_template_guest_os_actions_v2_test.go │ ├── resource_nutanix_template_v2.go │ ├── resource_nutanix_template_v2_test.go │ ├── resource_nutanix_virtual_machine_v2.go │ ├── resource_nutanix_virtual_machine_v2_test.go │ ├── resource_nutanix_vm_cdrom_insert_eject_v2.go │ ├── resource_nutanix_vm_cdrom_insert_eject_v2_test.go │ ├── resource_nutanix_vm_revert_from_recovery_points_replicate_v2.go │ ├── resource_nutanix_vm_revert_from_recovery_points_replicate_v2_test.go │ ├── resource_nutanix_vms_clone_v2.go │ ├── resource_nutanix_vms_clone_v2_test.go │ ├── resource_nutanix_vms_gc_update_v2.go │ ├── resource_nutanix_vms_gc_update_v2_test.go │ ├── resource_nutanix_vms_network_device_assign_ip_v2.go │ ├── resource_nutanix_vms_network_device_assign_ip_v2_test.go │ ├── resource_nutanix_vms_network_device_migrate_v2.go │ ├── resource_nutanix_vms_network_device_migrate_v2_test.go │ ├── resource_nutanix_vms_shutdown_action_v2.go │ └── resource_nutanix_vms_shutdown_actions_v2_test.go │ └── volumesv2 │ ├── data_source_nutanix_volume_disk_v2.go │ ├── data_source_nutanix_volume_disk_v2_test.go │ ├── data_source_nutanix_volume_disks_v2.go │ ├── data_source_nutanix_volume_disks_v2_test.go │ ├── data_source_nutanix_volume_group_v2.go │ ├── data_source_nutanix_volume_group_v2_test.go │ ├── data_source_nutanix_volume_groups_v2.go │ ├── data_source_nutanix_volume_groups_v2_test.go │ ├── data_source_nutanix_volume_iscsi_client_v2.go │ ├── data_source_nutanix_volume_iscsi_client_v2_test.go │ ├── data_source_nutanix_volume_iscsi_clients_v2.go │ ├── data_source_nutanix_volume_iscsi_clients_v2_test.go │ ├── helpers_test.go │ ├── main_test.go │ ├── resource_nutanix_associate_category_to_volume_group_v2.go │ ├── resource_nutanix_associate_category_to_volume_group_v2_test.go │ ├── resource_nutanix_volume_group_disk_v2.go │ ├── resource_nutanix_volume_group_disk_v2_test.go │ ├── resource_nutanix_volume_group_iscsi_client_v2.go │ ├── resource_nutanix_volume_group_iscsi_client_v2_test.go │ ├── resource_nutanix_volume_group_v2.go │ ├── resource_nutanix_volume_group_v2_test.go │ ├── resource_nutanix_volume_group_vm_v2.go │ └── resource_nutanix_volume_group_vm_v2_test.go ├── out.txt ├── scripts ├── changelog-links.sh ├── errcheck.sh ├── gofmtcheck.sh └── gogetcookie.sh ├── test_config.json ├── test_config_v2.json ├── test_foundation_config.json ├── tools.go ├── utils ├── flatmap.go ├── pointers.go └── utils.go └── website ├── docs ├── d │ ├── access_control_policies.html.markdown │ ├── access_control_policy.html.markdown │ ├── address_group.html.markdown │ ├── address_group_v2.html.markdown │ ├── address_groups.html.markdown │ ├── address_groups_v2.html.markdown │ ├── auth_policies_v2.html.markdown │ ├── auth_policy_v2.html.markdown │ ├── blueprint_runtime_editables.html.markdown │ ├── categories_v2.html.markdown │ ├── category_key.html.markdown │ ├── category_v2.html.markdown │ ├── cluster.html.markdown │ ├── cluster_v2.html.markdown │ ├── clusters.html.markdown │ ├── clusters_v2.html.markdown │ ├── directory_service_v2.html.markdown │ ├── directory_services_v2.html.markdown │ ├── floating_ip.html.markdown │ ├── floating_ip_v2.html.markdown │ ├── floating_ips.html.markdown │ ├── floating_ips_v2.html.markdown │ ├── foundation_central_get_api_key.html.markdown │ ├── foundation_central_imaged_cluster_details.html.markdown │ ├── foundation_central_imaged_node_details.html.markdown │ ├── foundation_central_list_all_api_keys.html.markdown │ ├── foundation_central_list_all_imaged_clusters.html.markdown │ ├── foundation_central_list_all_imaged_nodes.html.markdown │ ├── foundation_discover_nodes.html.markdown │ ├── foundation_hypervisor_isos.html.markdown │ ├── foundation_node_network_details.html.markdown │ ├── foundation_nos_packages.html.markdown │ ├── host.html.markdown │ ├── host_v2.html.markdown │ ├── hosts.html.markdown │ ├── hosts_v2.html.markdown │ ├── image.html.markdown │ ├── image_placement_policies_v2.html.markdown │ ├── image_placement_policy_v2.html.markdown │ ├── image_v2.html.markdown │ ├── images_v2.html.markdown │ ├── karbon_cluster.html.markdown │ ├── karbon_cluster_kubeconfig.html.markdown │ ├── karbon_cluster_ssh.html.markdown │ ├── karbon_clusters.html.markdown │ ├── karbon_private_registries.html.markdown │ ├── karbon_private_registry.html.markdown │ ├── lcm_config_v2.html.markdown │ ├── lcm_entities_v2.html.markdown │ ├── lcm_entity_v2.html.markdown │ ├── lcm_status_v2.html.markdown │ ├── ndb_clone.html.markdown │ ├── ndb_clones.html.markdown │ ├── ndb_cluster.html.markdown │ ├── ndb_clusters.html.markdown │ ├── ndb_database.html.markdown │ ├── ndb_databases.html.markdown │ ├── ndb_dbserver.html.markdown │ ├── ndb_dbservers.html.markdown │ ├── ndb_maintenance_window.html.markdown │ ├── ndb_maintenance_windows.html.markdown │ ├── ndb_network.html.markdown │ ├── ndb_network_available_ips.html.markdown │ ├── ndb_networks.html.markdown │ ├── ndb_profile.html.markdown │ ├── ndb_profiles.html.markdown │ ├── ndb_sla.html.markdown │ ├── ndb_slas.html.markdown │ ├── ndb_snapshot.html.markdown │ ├── ndb_snapshots.html.markdown │ ├── ndb_tag.html.markdown │ ├── ndb_tags.html.markdown │ ├── ndb_time_machine.html.markdown │ ├── ndb_time_machine_capability.html.markdown │ ├── ndb_time_machines.html.markdown │ ├── network_security_policies_v2.html.markdown │ ├── network_security_policy_v2.html.markdown │ ├── network_security_rule.html.markdown │ ├── ngt_configuration_v2.html.markdown │ ├── operation_v2.html.markdown │ ├── operations_v2.html.markdown │ ├── pbr.html.markdown │ ├── pbr_v2.html.markdown │ ├── pbrs.html.markdown │ ├── pbrs_v2.html.markdown │ ├── pc_backup_target_v2.html.markdown │ ├── pc_backup_targets_v2.html.markdown │ ├── pc_restore_point_v2.html.markdown │ ├── pc_restore_points_v2.html.markdown │ ├── pc_restore_source_v2.html.markdown │ ├── pc_v2.html.markdown │ ├── pcs_v2.html.markdown │ ├── permission.html.markdown │ ├── permissions.html.markdown │ ├── project.html.markdown │ ├── projects.html.markdown │ ├── protected_resource_v2.html.markdown │ ├── protection_policies_v2.html.markdown │ ├── protection_policy_v2.html.markdown │ ├── protection_rule.markdown │ ├── protection_rules.markdown │ ├── recovery_plan.markdown │ ├── recovery_plans.markdown │ ├── recovery_point_v2.html.markdown │ ├── recovery_points_v2.html.markdown │ ├── restorable_pcs_v2.html.markdown │ ├── role.html.markdown │ ├── role_v2.html.markdown │ ├── roles.html.markdown │ ├── roles_v2.html.markdown │ ├── route_table_v2.html.markdown │ ├── route_tables_v2.html.markdown │ ├── route_v2.html.markdown │ ├── routes_v2.html.markdown │ ├── saml_idp_v2.html.markdown │ ├── saml_idps_v2.html.markdown │ ├── self_service_app.html.markdown │ ├── self_service_app_snapshots.html.markdown │ ├── self_service_snapshot_policy_list.html.markdown │ ├── service_group_v2.html.markdown │ ├── service_groups_v2.html.markdown │ ├── static_route_v2.html.markdown │ ├── static_routes.html.markdown │ ├── static_routes_v2.html.markdown │ ├── storage_container_v2.html.markdown │ ├── storage_containers_v2.html.markdown │ ├── storage_stats_info_v2.html.markdown │ ├── subnet.html.markdown │ ├── subnet_v2.html.markdown │ ├── subnets.html.markdown │ ├── subnets_v2.html.markdown │ ├── template_v2.html.markdown │ ├── templates_v2.html.markdown │ ├── user.html.markdown │ ├── user_group.html.markdown │ ├── user_group_v2.html.markdown │ ├── user_groups.html.markdown │ ├── user_groups_v2.html.markdown │ ├── user_v2.html.markdown │ ├── users.html.markdown │ ├── users_v2.html.markdown │ ├── virtual_machine.html.markdown │ ├── virtual_machine_v2.html.markdown │ ├── virtual_machines_v2.html.markdown │ ├── vm_recovery_point_info_v2.html.markdown │ ├── volume_group_disk_v2.html.markdown │ ├── volume_group_disks_v2.html.markdown │ ├── volume_group_v2.html.markdown │ ├── volume_groups_v2.html.markdown │ ├── volume_iscsi_client_v2.html.markdown │ ├── volume_iscsi_clients_v2.html.markdown │ ├── vpc.html.markdown │ ├── vpc_v2.html.markdown │ ├── vpcs.html.markdown │ └── vpcs_v2.html.markdown ├── index.html.markdown └── r │ ├── access_control_policy.html.markdown │ ├── address_group.html.markdown │ ├── address_group_v2.html.markdown │ ├── associate_category_to_volume_group_v2.html.markdown │ ├── authorization_policy_v2.html.markdown │ ├── category_key.markdown │ ├── category_v2.html.markdown │ ├── category_value.markdown │ ├── cluster_add_node_v2.html.markdown │ ├── cluster_v2.html.markdown │ ├── clusters_discover_unconfigured_nodes_v2.html.markdown │ ├── clusters_unconfigured_node_networks_v2.html.markdown │ ├── deploy_template_v2.html.markdown │ ├── directory_services_v2.html.markdown │ ├── floating_ip.html.markdown │ ├── floating_ip_v2.html.markdown │ ├── foundation_central_api_key.html.markdown │ ├── foundation_central_image_cluster.html.markdown │ ├── foundation_image.html.markdown │ ├── foundation_image_nodes.html.markdown │ ├── foundation_ipmi_config.html.markdown │ ├── image.html.markdown │ ├── image_placement_policy_v2.html.markdown │ ├── image_v2.html.markdown │ ├── karbon_cluster.html.markdown │ ├── karbon_cluster_worker_nodepool.html.markdown │ ├── karbon_private_registry.html.markdown │ ├── lcm_config_v2.html.markdown │ ├── lcm_perform_inventory_v2.html.markdown │ ├── lcm_prechecks_v2.html.markdown │ ├── lcm_upgrade_v2.html.markdown │ ├── ndb_authorize_dbserver.html.markdown │ ├── ndb_clone.html.markdown │ ├── ndb_clone_refresh.html.markdown │ ├── ndb_cluster.html.markdown │ ├── ndb_database.html.markdown │ ├── ndb_database_restore.html.markdown │ ├── ndb_database_scale.html.markdown │ ├── ndb_database_snapshot.html.markdown │ ├── ndb_dbservervm.html.markdown │ ├── ndb_dbservervm_register.html.markdown │ ├── ndb_log_catchups.html.markdown │ ├── ndb_maintenance_task.html.markdown │ ├── ndb_maintenance_window.html.markdown │ ├── ndb_network.html.markdown │ ├── ndb_profiles.html.markdown │ ├── ndb_register_database.html.markdown │ ├── ndb_sla.html.markdown │ ├── ndb_software_profile_version.html.markdown │ ├── ndb_stretched_vlans.html.markdown │ ├── ndb_tag.html.markdown │ ├── ndb_time_machine_cluster.html.markdown │ ├── network_security_policy_v2.html.markdown │ ├── network_security_rule.html.markdown │ ├── ngt_insert_iso_v2.html.markdown │ ├── ngt_installation_v2.html.markdown │ ├── ngt_upgrade_v2.html.markdown │ ├── pbr.html.markdown │ ├── pbrs_v2.html.markdown │ ├── pc_backup_target_v2.html.markdown │ ├── pc_deploy_v2.html.markdown │ ├── pc_registration_v2.html.markdown │ ├── pc_restore_source_v2.html.markdown │ ├── pc_restore_v2.html.markdown │ ├── pc_unregistration_v2.html.markdown │ ├── project.markdown │ ├── promote_protected_resource_v2.html.markdown │ ├── protection_policy_v2.html.markdown │ ├── protection_rule.markdown │ ├── recovery_plan.markdown │ ├── recovery_point_replicate_v2.html.markdown │ ├── recovery_point_restore_v2.html.markdown │ ├── recovery_points_v2.html.markdown │ ├── restore_protected_resource_v2.html.markdown │ ├── role.html.markdown │ ├── roles_v2.html.markdown │ ├── routes_v2.html.markdown │ ├── saml_idps_v2.html.markdown │ ├── self_service_app_custom_action.html.markdown │ ├── self_service_app_patch.html.markdown │ ├── self_service_app_provision.html.markdown │ ├── self_service_app_recovery_point.html.markdown │ ├── self_service_app_restore.html.markdown │ ├── service_group.html.markdown │ ├── service_groups_v2.html.markdown │ ├── static_routes.html.markdown │ ├── storage_containers_v2.html.markdown │ ├── subnet.html.markdown │ ├── subnets_v2.html.markdown │ ├── template_guest_os_actions_v2.html.markdown │ ├── templates_v2.html.markdown │ ├── user.html.markdown │ ├── user_groups.html.markdown │ ├── user_groups_v2.html.markdown │ ├── users_v2.html.markdown │ ├── virtual_machine.html.markdown │ ├── virtual_machine_clone_v2.html.markdown │ ├── virtual_machine_gc_update_v2.html.markdown │ ├── virtual_machine_network_device_assign_ip_v2.html.markdown │ ├── virtual_machine_network_device_migrate_v2.html.markdown │ ├── virtual_machine_v2.html.markdown │ ├── vm_cdroms_insert_eject_v2.html.markdown │ ├── vm_revert_v2.html.markdown │ ├── vm_shutdown_action_v2.html.markdown │ ├── volume_group_disk_v2.html.markdown │ ├── volume_group_iscsi_client_v2.html.markdown │ ├── volume_group_v2.html.markdown │ ├── volume_group_vm_v2.markdown │ ├── vpc.html.markdown │ └── vpc_v2.html.markdown └── nutanix.erb /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/automated-test.yml: -------------------------------------------------------------------------------- 1 | name: 'PreChecks' 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | lint-and-test: 7 | name: Lint & Test 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: 📥 Code Checkout 11 | uses: actions/checkout@v4 12 | 13 | - name: ⚙️ Set up Go 🐹 14 | uses: actions/setup-go@v5 15 | with: 16 | go-version: 1.17 17 | 18 | - name: 🧹 Code Lint 19 | run: make tools && make lint 20 | 21 | - name: 🌐 Website Lint 22 | run: make tools && make website-lint 23 | 24 | - name: ✅ Run Tests 25 | run: make test 26 | -------------------------------------------------------------------------------- /.github/workflows/ok-to-test.yml: -------------------------------------------------------------------------------- 1 | name: 'Ok-To-Test' 2 | 3 | on: [issue_comment] 4 | 5 | jobs: 6 | Trigger-Dispatch-Event: 7 | runs-on: ubuntu-latest 8 | if: ${{ github.event.issue.pull_request }} 9 | steps: 10 | - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." 11 | - name: Slash Command Dispatch 12 | uses: peter-evans/slash-command-dispatch@v1 13 | with: 14 | token: ${{ secrets.PAT }} # PAT or OAuth token will also work 15 | issue-type: pull-request 16 | commands: ok-to-test 17 | permission: write 18 | - run: echo "🍏 This job's status is ${{ job.status }}." -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | tags: 5 | - 'v*' 6 | jobs: 7 | goreleaser: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - 11 | name: Checkout 12 | uses: actions/checkout@v4 13 | - 14 | name: Unshallow 15 | run: git fetch --prune --unshallow 16 | - 17 | name: Set up Go 18 | uses: actions/setup-go@v5 19 | with: 20 | go-version: 1.21 21 | - 22 | name: Import GPG key 23 | id: import_gpg 24 | uses: paultyng/ghaction-import-gpg@v2.1.0 25 | env: 26 | GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} 27 | PASSPHRASE: ${{ secrets.PASSPHRASE }} 28 | - name: Set the user terminal 29 | run: export GPG_TTY=$(tty) 30 | - 31 | name: Run GoReleaser 32 | uses: goreleaser/goreleaser-action@v6 33 | with: 34 | version: latest 35 | args: release --clean 36 | env: 37 | GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.dll 3 | *.so 4 | *.dylib 5 | **/*.tfstate 6 | **/*.tfstate.backup 7 | **/.terraform* 8 | *.log 9 | setenv.sh 10 | request_log 11 | .DS_Store 12 | dist/ 13 | pkg/ 14 | terraform-provider-nutanix 15 | 16 | # Test binary, build with `go test -c` 17 | *.test 18 | 19 | # Output of the go coverage tool, specifically when used with LiteIDE 20 | *.out 21 | log.* 22 | 23 | #exclude vendor 24 | vendor 25 | bin/* 26 | build.sh 27 | 28 | # autogenerated fies 29 | *.autogenerated.* 30 | 31 | .idea/ 32 | -------------------------------------------------------------------------------- /examples/address_group_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/address_group_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/associate_category_to_volume_group_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/associate_category_to_volume_group_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/authorization_policies_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | permission_ext_id = "" 9 | -------------------------------------------------------------------------------- /examples/authorization_policies_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "permission_ext_id" { 16 | type = string 17 | } 18 | -------------------------------------------------------------------------------- /examples/categories/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.9.5" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | 20 | # Create a category key 21 | resource "nutanix_category_key" "example-category-key" { 22 | name = "app-support" # this value can be updated 23 | description = "App Support Category Key" # this value can be updated 24 | } 25 | 26 | # Create a category value 27 | resource "nutanix_category_value" "example-category-value" { 28 | name = nutanix_category_key.example-category-key.id 29 | description = "Example Category Value" # this value can be updated 30 | value = "example-value" # this value can be updated 31 | } 32 | 33 | # Get the category key by name 34 | data "nutanix_category_key" "get_key" { 35 | name = nutanix_category_key.example-category-key.name 36 | } 37 | -------------------------------------------------------------------------------- /examples/categories/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | -------------------------------------------------------------------------------- /examples/categories/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } -------------------------------------------------------------------------------- /examples/categories_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.0.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | 20 | 21 | #creating category 22 | resource "nutanix_category_v2" "example" { 23 | key = "category_example_key" 24 | value = "category_example_value" 25 | description = "category example description" 26 | } 27 | 28 | 29 | #pull all categories data 30 | data "nutanix_categories_v2" "categories-list" {} 31 | 32 | # pull all categories with limit and filter 33 | data "nutanix_categories_v2" "filtered-categories" { 34 | limit = 2 35 | filter = "key eq '${nutanix_category_v2.example.key}'" 36 | } 37 | 38 | # get category by ext id 39 | data "nutanix_category_v2" "get-category" { 40 | ext_id = nutanix_category_v2.example.id 41 | } 42 | -------------------------------------------------------------------------------- /examples/categories_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | -------------------------------------------------------------------------------- /examples/categories_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } -------------------------------------------------------------------------------- /examples/cluster_add_node_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/cluster_add_node_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "node_ip" { 15 | type = string 16 | } 17 | -------------------------------------------------------------------------------- /examples/clusters_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | pe_username = "ntnx" 8 | pe_password = "password" 9 | 10 | node_ip = "10.xx.xx.xx" 11 | # node credentials 12 | username = "admin" 13 | password = "password" 14 | -------------------------------------------------------------------------------- /examples/clusters_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "pe_username" { 15 | type = string 16 | } 17 | variable "pe_password" { 18 | type = string 19 | } 20 | 21 | variable "node_ip" { 22 | type = string 23 | } 24 | 25 | variable "username" { 26 | type = string 27 | } 28 | 29 | variable "password" { 30 | type = string 31 | } 32 | -------------------------------------------------------------------------------- /examples/deploy_templates_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/deploy_templates_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "subnet_name" { 15 | type = string 16 | } 17 | -------------------------------------------------------------------------------- /examples/directory_services_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/directory_services_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/discover_unconfigured_nodes_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.0.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | 20 | 21 | data "nutanix_clusters_v2" "clusters" {} 22 | locals { 23 | cluster_ext_id = [ 24 | for cluster in data.nutanix_clusters_v2.clusters.cluster_entities : 25 | cluster.ext_id if cluster.config[0].cluster_function[0] == "PRISM_CENTRAL" 26 | ][0] 27 | 28 | } 29 | 30 | # Discover unconfigured nodes in a cluster 31 | resource "nutanix_clusters_discover_unconfigured_nodes_v2" "test" { 32 | ext_id = local.cluster_ext_id 33 | address_type = "IPV4" 34 | ip_filter_list { 35 | ipv4 { 36 | value = var.cvm_ip 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/discover_unconfigured_nodes_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | cvm_ip = "10.xx.xx.xx" 7 | -------------------------------------------------------------------------------- /examples/discover_unconfigured_nodes_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "cvm_ip" { 15 | type = string 16 | } 17 | -------------------------------------------------------------------------------- /examples/external_subnets/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | -------------------------------------------------------------------------------- /examples/external_subnets/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } -------------------------------------------------------------------------------- /examples/floating_ip/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/floating_ip/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/floating_ip_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/floating_ip_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/foundationCentral/api_keys/main.tf: -------------------------------------------------------------------------------- 1 | // resources/datasources used in this file were introduced in nutanix/nutanix version 1.5.0-beta.2 2 | terraform { 3 | required_providers { 4 | nutanix = { 5 | source = "nutanix/nutanix" 6 | version = ">=1.5.0-beta.2" 7 | } 8 | } 9 | } 10 | 11 | provider "nutanix" { 12 | username = "user" 13 | password = "pass" 14 | endpoint = "10.x.xx.xx" 15 | insecure = true 16 | port = 9440 17 | } 18 | 19 | 20 | // resource to Create a new api key 21 | 22 | resource "nutanix_foundation_central_api_keys" "apk"{ 23 | alias = "test-fc" 24 | } 25 | 26 | // datasource to get an api key given its UUID 27 | data "nutanix_foundation_central_api_keys" "k1"{ 28 | key_uuid = resource.nutanix_foundation_central_api_keys.apk.key_uuid 29 | } 30 | 31 | output "k2"{ 32 | value = data.nutanix_foundation_central_api_keys.k1 33 | } 34 | 35 | //datasource to List all the api keys created in Foundation Central. 36 | 37 | data "nutanix_foundation_central_list_api_keys" "l1"{} 38 | 39 | output "l2"{ 40 | value = data.nutanix_foundation_central_list_api_keys.l1 41 | } -------------------------------------------------------------------------------- /examples/foundationCentral/imaged_nodes/main.tf: -------------------------------------------------------------------------------- 1 | // resources/datasources used in this file were introduced in nutanix/nutanix version 1.5.0-beta.2 2 | terraform { 3 | required_providers { 4 | nutanix = { 5 | source = "nutanix/nutanix" 6 | version = ">=1.5.0-beta.2" 7 | } 8 | } 9 | } 10 | 11 | provider "nutanix" { 12 | username = "user" 13 | password = "pass" 14 | endpoint = "10.x.xx.xx" 15 | insecure = true 16 | port = 9440 17 | } 18 | 19 | // datasource to List all the nodes registered with Foundation Central. 20 | data "nutanix_foundation_central_imaged_nodes_list" "img"{} 21 | 22 | output "img1"{ 23 | value = data.nutanix_foundation_central_imaged_nodes_list.img 24 | } 25 | 26 | // datasource to Get the details of a single node given its UUID. 27 | data "nutanix_foundation_central_imaged_node_details" "imgdet"{ 28 | imaged_node_uuid = "" 29 | } 30 | 31 | output "imgdetails"{ 32 | value = data.nutanix_foundation_central_imaged_node_details.imgdet 33 | } 34 | -------------------------------------------------------------------------------- /examples/hosts_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.0.0" 6 | } 7 | } 8 | } 9 | 10 | data "nutanix_clusters_v2" "clusters" {} 11 | 12 | locals { 13 | clusterExtId = [ 14 | for cluster in data.nutanix_clusters_v2.clusters.cluster_entities : 15 | cluster.ext_id if cluster.config[0].cluster_function[0] != "PRISM_CENTRAL" 16 | ][0] 17 | } 18 | 19 | #defining nutanix configuration 20 | provider "nutanix" { 21 | username = var.nutanix_username 22 | password = var.nutanix_password 23 | endpoint = var.nutanix_endpoint 24 | port = 9440 25 | insecure = true 26 | } 27 | 28 | 29 | # List all the hosts 30 | data "nutanix_hosts_v2" "hosts" { 31 | cluster_ext_id = local.clusterExtId 32 | } 33 | 34 | # List all the hosts with filter 35 | data "nutanix_hosts_v2" "hosts" { 36 | cluster_ext_id = local.clusterExtId 37 | filter = "name eq 'host-1'" 38 | } 39 | 40 | # Get the host details 41 | data "nutanix_host_v2" "host" { 42 | cluster_ext_id = local.clusterExtId 43 | ext_id = data.nutanix_hosts_v2.hosts.host_entities[0].ext_id 44 | } 45 | -------------------------------------------------------------------------------- /examples/hosts_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/hosts_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/image_placement_policy_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/image_placement_policy_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/images_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/images_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/lcm_config_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.1.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | # List Prism Central 20 | data "nutanix_clusters_v2" "pc" { 21 | filter = "config/clusterFunction/any(t:t eq Clustermgmt.Config.ClusterFunctionRef'PRISM_CENTRAL')" 22 | } 23 | 24 | locals { 25 | pcExtID = data.nutanix_clusters_v2.pc.cluster_entities[0].ext_id 26 | } 27 | 28 | # Example here, we are enabling Auto Inventory, adding Auto Inventory Schedule and enabling auto upgrade 29 | resource "nutanix_lcm_config_v2" "lcm-configuration-update" { 30 | x_cluster_id = local.pcExtID 31 | is_auto_inventory_enabled = true 32 | auto_inventory_schedule = "16:30" 33 | has_module_auto_upgrade_enabled = true 34 | } 35 | 36 | # Read LCM config. 37 | data "nutanix_lcm_config_v2" "get-lcm-configuration" { 38 | x_cluster_id = local.pcExtID 39 | depends_on = [nutanix_lcm_config_v2.lcm-configuration-update] 40 | } 41 | 42 | -------------------------------------------------------------------------------- /examples/lcm_config_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/lcm_config_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/lcm_entities_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.1.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | # get all entities 20 | data "nutanix_lcm_entities_v2" "lcm-entities" {} 21 | 22 | # get filtered entities 23 | data "nutanix_lcm_entities_v2" "lcm-entities-filtered" { 24 | filter = "entityModel eq 'Calm Policy Engine'" 25 | } 26 | 27 | # get limited entities 28 | data "nutanix_lcm_entities_v2" "lcm-entities-limited" { 29 | limit = 5 30 | } 31 | 32 | # get filtered and limited entities 33 | data "nutanix_lcm_entities_v2" "lcm-entities-filter-and-limit" { 34 | filter = "startswith(entityModel,'Calm')" 35 | limit = 5 36 | } 37 | 38 | # get specific entity 39 | data "nutanix_lcm_entity_v2" "entity" { 40 | ext_id = data.nutanix_lcm_entities_v2.lcm-entities.entities[0].ext_id 41 | } 42 | -------------------------------------------------------------------------------- /examples/lcm_entities_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/lcm_entities_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/lcm_upgrade_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/lcm_upgrade_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/ndb/clone/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/clone/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/clone_refresh/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to refresh clone with snapshot id 19 | 20 | resource "nutanix_ndb_clone_refresh" "acctest-managed"{ 21 | clone_id = "{{ clone_id }}" 22 | snapshot_id = "{{ snapshot_id }}" 23 | timezone = "Asia/Calcutta" 24 | } 25 | 26 | ## resource to refresh clone with userpitr timestamp 27 | 28 | resource "nutanix_ndb_clone_refresh" "acctest-managed"{ 29 | clone_id = "{{ clone_id }}" 30 | user_pitr_timestamp = "{{ timestamp }}" 31 | timezone = "Asia/Calcutta" 32 | } 33 | -------------------------------------------------------------------------------- /examples/ndb/clone_refresh/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/clone_refresh/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/cluster/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to register cluster in ndb 19 | 20 | resource "nutanix_ndb_cluster" "clsname" { 21 | name= "cls-name" 22 | description = "cluster description" 23 | cluster_ip = "{{ clusterIP }}" 24 | username= "{{ cluster username }}" 25 | password = "{{ cluster password }}" 26 | storage_container = "{{ storage container}}" 27 | agent_network_info{ 28 | dns = "{{ dns }}" 29 | ntp = "{{ ntp }}" 30 | } 31 | networks_info{ 32 | type = "DHCP" 33 | network_info{ 34 | vlan_name = "vlan_static" 35 | static_ip = "{{ staticIP }}" 36 | gateway = "{{ Gateway }}" 37 | subnet_mask="{{ subnetMask }}" 38 | } 39 | access_type = [ 40 | "PRISM", 41 | "DSIP", 42 | "DBSERVER" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /examples/ndb/cluster/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/cluster/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/database_instance/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/database_instance/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/database_register/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/database_register/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/database_restore/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## database_restore with Point in Time 19 | 20 | resource "nutanix_ndb_database_restore" "name" { 21 | database_id= "{{ database_id }}" 22 | user_pitr_timestamp = "2022-12-28 00:54:30" 23 | time_zone_pitr = "Asia/Calcutta" 24 | } 25 | 26 | ## database_restore with snapshot uuid 27 | 28 | resource "nutanix_ndb_database_restore" "name" { 29 | database_id= "{{ database_id }}" 30 | snapshot_id= "{{ snapshot id }}" 31 | } -------------------------------------------------------------------------------- /examples/ndb/database_restore/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/database_restore/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/database_scale/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0-beta.2" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to scale database 19 | 20 | resource "nutanix_ndb_database_scale" "scale" { 21 | application_type = "{{ Application Type }}" 22 | database_uuid = "{{ database_id }}" 23 | data_storage_size = 1 24 | } -------------------------------------------------------------------------------- /examples/ndb/database_scale/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/database_scale/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/database_snapshot/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | // resource to create snapshot with time machine id 19 | 20 | resource "nutanix_ndb_database_snapshot" "name" { 21 | time_machine_id = "{{ tms_ID }}" 22 | name = "test-snap" 23 | remove_schedule_in_days = 1 24 | } 25 | 26 | // resource to craete snapshot with time machine name 27 | 28 | resource "nutanix_ndb_database_snapshot" "name" { 29 | time_machine_name = "{{ tms_name }}" 30 | name = "test-snap" 31 | remove_schedule_in_days = 1 32 | } -------------------------------------------------------------------------------- /examples/ndb/database_snapshot/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/database_snapshot/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/dbservervm_register/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | 19 | ## resource to register dbserver vm 20 | resource "nutanix_ndb_register_dbserver" "name" { 21 | vm_ip= "{{ vmip }}" 22 | nxcluster_id = "{{ cluster_id }}" 23 | username= "{{ era_driver_user}}" 24 | password="{{ password }}" 25 | database_type = "postgres_database" 26 | postgres_database{ 27 | listener_port = 5432 28 | // directory where the PostgreSQL database software is installed 29 | postgres_software_home= "{{ directory }}" 30 | } 31 | } -------------------------------------------------------------------------------- /examples/ndb/dbservervm_register/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/dbservervm_register/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/linked_databases/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to add linked databases with an instance 19 | 20 | resource "nutanix_ndb_linked_databases" "name" { 21 | database_id= "{{ database_id }}" 22 | database_name = "check" 23 | } -------------------------------------------------------------------------------- /examples/ndb/linked_databases/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/linked_databases/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/log_catchups/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0-beta.2" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | 19 | ## resource to perform log catchup 20 | 21 | resource "nutanix_ndb_log_catchups" "name" { 22 | time_machine_id = "{{ timeMachineID }}" 23 | } -------------------------------------------------------------------------------- /examples/ndb/log_catchups/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/log_catchups/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/maintenance_window/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | 19 | ## resource to create maintenance window with Weekly as recurrence 20 | 21 | resource nutanix_ndb_maintenance_window minWin{ 22 | name = "test" 23 | description = "this is desc" 24 | recurrence = "WEEKLY" 25 | duration = 2 26 | day_of_week = "TUESDAY" 27 | start_time = "17:04:47" 28 | } 29 | 30 | 31 | ## resource to create maintenance window with Monthly as recurrence 32 | 33 | resource nutanix_ndb_maintenance_window acctest-managed{ 34 | name = "test" 35 | description = "this is desc" 36 | recurrence = "MONTHLY" 37 | duration = 2 38 | day_of_week = "TUESDAY" 39 | start_time = "17:04:47" 40 | week_of_month= 4 41 | } -------------------------------------------------------------------------------- /examples/ndb/maintenance_window/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/maintenance_window/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/network/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | 19 | #resource to create network 20 | resource "nutanix_ndb_network" "name" { 21 | name= "test-sub" 22 | type="Static" 23 | cluster_id = "{{ cluster_id }}" 24 | gateway= "{{ gatway for the vlan }}" 25 | subnet_mask = "{{ subnet mask for the vlan}}" 26 | primary_dns = " {{ primary dns for the vlan }}" 27 | secondary_dns= "{{secondary dns for the vlan }}" 28 | ip_pools{ 29 | start_ip = "{{ starting address range}}" 30 | end_ip = "{{ ending address range }}" 31 | } 32 | } 33 | 34 | #data source to get network 35 | data "nutanix_ndb_network" "net"{ 36 | name = "{{ name of network }}" 37 | } 38 | 39 | data "nutanix_ndb_network" "net"{ 40 | id = "{{ id of network }}" 41 | } 42 | 43 | #data source to get List of networks 44 | data "nutanix_ndb_networks" "nets"{ } -------------------------------------------------------------------------------- /examples/ndb/network/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/network/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/profiles/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file_username = "admin" 2 | ndb_password = "password" 3 | ndb_endpoint = "10.xx.xx.xx" 4 | ndb_username = "username" 5 | -------------------------------------------------------------------------------- /examples/ndb/profiles/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "ndb_username" { 3 | type = string 4 | } 5 | variable "ndb_password" { 6 | type = string 7 | } 8 | variable "ndb_endpoint" { 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /examples/ndb/sla/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ndb_password = "password" 2 | ndb_endpoint = "10.xx.xx.xx" 3 | ndb_username = "username" 4 | -------------------------------------------------------------------------------- /examples/ndb/sla/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ndb_username" { 2 | type = string 3 | } 4 | variable "ndb_password" { 5 | type = string 6 | } 7 | variable "ndb_endpoint" { 8 | type = string 9 | } -------------------------------------------------------------------------------- /examples/ndb/tags/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to create tag in ndb 19 | 20 | resource "nutanix_ndb_tag" "name" { 21 | name= "testst-up" 22 | description = "this is desc ok" 23 | entity_type = "DATABASE" 24 | required=true 25 | } 26 | 27 | ## resource to deprecate the tag 28 | resource "nutanix_ndb_tag" "name" { 29 | name= "testst-up" 30 | description = "this is desc ok" 31 | entity_type = "DATABASE" 32 | required=true 33 | status = "DEPRECATED" 34 | } -------------------------------------------------------------------------------- /examples/ndb/tags/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ndb_password = "password" 2 | ndb_endpoint = "10.xx.xx.xx" 3 | ndb_username = "username" 4 | -------------------------------------------------------------------------------- /examples/ndb/tags/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ndb_username" { 2 | type = string 3 | } 4 | variable "ndb_password" { 5 | type = string 6 | } 7 | variable "ndb_endpoint" { 8 | type = string 9 | } -------------------------------------------------------------------------------- /examples/ndb/time_machine_clusters/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.8.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | ndb_username = var.ndb_username 13 | ndb_password = var.ndb_password 14 | ndb_endpoint = var.ndb_endpoint 15 | insecure = true 16 | } 17 | 18 | ## resource to add cluster in time machines for snapshot destination with SLAs 19 | 20 | resource "nutanix_ndb_tms_cluster" "cls" { 21 | time_machine_id = "{{ tms_id }}" 22 | nx_cluster_id = "{{ cluster_id }}" 23 | sla_id = "{{ sla_id }}" 24 | } -------------------------------------------------------------------------------- /examples/ndb/time_machine_clusters/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ndb_password = "password" 2 | ndb_endpoint = "10.xx.xx.xx" 3 | ndb_username = "username" 4 | -------------------------------------------------------------------------------- /examples/ndb/time_machine_clusters/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ndb_username" { 2 | type = string 3 | } 4 | variable "ndb_password" { 5 | type = string 6 | } 7 | variable "ndb_endpoint" { 8 | type = string 9 | } -------------------------------------------------------------------------------- /examples/network_security_policies_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/network_security_policies_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/ngt_configuration_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/ngt_configuration_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "username" { 15 | type = string 16 | } 17 | variable "password" { 18 | type = string 19 | } 20 | variable "image_name" { 21 | type = string 22 | } 23 | variable "subnet_name" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/ngt_insert_iso_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/ngt_insert_iso_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "image_name" { 15 | type = string 16 | } 17 | variable "subnet_name" { 18 | type = string 19 | } 20 | variable "username" { 21 | type = string 22 | } 23 | variable "password" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/ngt_installations_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/ngt_installations_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "username" { 15 | type = string 16 | } 17 | variable "password" { 18 | type = string 19 | } 20 | variable "image_name" { 21 | type = string 22 | } 23 | variable "subnet_name" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/ngt_upgrade_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.0.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | # pull the specified virtual machine data 20 | data "nutanix_virtual_machines_v2" "ngt-vm" { 21 | filter = "name eq '${var.vm_name}'" 22 | } 23 | 24 | resource "nutanix_ngt_upgrade_v2" "upgrade-ngt" { 25 | ext_id = data.nutanix_virtual_machines_v2.ngt-vm.vms.0.ext_id 26 | 27 | reboot_preference { 28 | schedule_type = "IMMEDIATE" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/ngt_upgrade_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/ngt_upgrade_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "vm_name" { 15 | type = string 16 | } 17 | -------------------------------------------------------------------------------- /examples/operations_v2/main.tf: -------------------------------------------------------------------------------- 1 | #Here we will get and list permissions 2 | #the variable "" present in terraform.tfvars file. 3 | #Note - Replace appropriate values of variables in terraform.tfvars file as per setup 4 | 5 | terraform { 6 | required_providers { 7 | nutanix = { 8 | source = "nutanix/nutanix" 9 | version = "2.0.0" 10 | } 11 | } 12 | } 13 | 14 | #defining nutanix configuration 15 | provider "nutanix" { 16 | username = var.nutanix_username 17 | password = var.nutanix_password 18 | endpoint = var.nutanix_endpoint 19 | port = var.nutanix_port 20 | insecure = true 21 | } 22 | 23 | 24 | 25 | #list operations 26 | data "nutanix_operations_v2" "operation-list" {} 27 | 28 | # filtered list operation 29 | data "nutanix_operations_v2" "operation-list-filtered" { 30 | filter = "displayName eq 'Create_Role'" 31 | } 32 | 33 | # list operations withe page and limit 34 | data "nutanix_operations_v2" "operation-list-paginated" { 35 | page = 1 36 | limit = 10 37 | } 38 | 39 | #get permission by ext-id 40 | data "nutanix_operation_v2" "get-operation" { 41 | ext_id = data.nutanix_operations_v2.operation-list.operations.0.ext_id 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/operations_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | operationUUID = "00000000-0000-0000-0000-000000000000" 9 | -------------------------------------------------------------------------------- /examples/operations_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "operationUUID" { 16 | type = string 17 | } 18 | -------------------------------------------------------------------------------- /examples/overlay_subnets/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | vpc_reference_uuid = "" 6 | -------------------------------------------------------------------------------- /examples/overlay_subnets/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "vpc_reference_uuid" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/pbr/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | vpc_reference_uuid = "" 7 | -------------------------------------------------------------------------------- /examples/pbr/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "vpc_reference_uuid" { 16 | type = string 17 | } 18 | -------------------------------------------------------------------------------- /examples/pbr_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | vpc_reference_uuid = "" 7 | -------------------------------------------------------------------------------- /examples/pbr_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "vpc_reference_uuid" { 16 | type = string 17 | } 18 | -------------------------------------------------------------------------------- /examples/pc_backup_target_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/pc_backup_target_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "pc_ext_id" { 16 | type = string 17 | } 18 | variable "cluster_ext_id" { 19 | type = string 20 | } 21 | variable "bucket_name" { 22 | type = string 23 | } 24 | variable "region" { 25 | type = string 26 | } 27 | variable "access_key_id" { 28 | type = string 29 | } 30 | variable "secret_access_key" { 31 | type = string 32 | } -------------------------------------------------------------------------------- /examples/pc_deploy_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | pe_username = "ntnx" 8 | pe_password = "password" 9 | 10 | cvm_ip = "10.xx.xx.xx" 11 | 12 | new_username = "new_admin" 13 | new_password = "new_password" -------------------------------------------------------------------------------- /examples/pc_deploy_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "pe_username" { 15 | type = string 16 | } 17 | variable "pe_password" { 18 | type = string 19 | } 20 | 21 | variable "cvm_ip" { 22 | type = string 23 | } 24 | 25 | variable "new_username" { 26 | type = string 27 | } 28 | 29 | variable "new_password" { 30 | type = string 31 | } -------------------------------------------------------------------------------- /examples/pc_registration_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | cvm_ip = "10.xx.xx.xx" 7 | username = "admin" 8 | password = "password" 9 | cluster_ext_id = "value" 10 | -------------------------------------------------------------------------------- /examples/pc_registration_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "cvm_ip" { 15 | type = string 16 | } 17 | variable "username" { 18 | type = string 19 | } 20 | 21 | variable "password" { 22 | type = string 23 | } 24 | 25 | variable "cluster_ext_id" { 26 | type = string 27 | } 28 | -------------------------------------------------------------------------------- /examples/pc_restore_point_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_pc_endpoint = "10.xx.xx.xx" 5 | nutanix_pe_endpoint = "10.xx.xx.xx" 6 | nutanix_port = 9440 7 | -------------------------------------------------------------------------------- /examples/pc_restore_point_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_pc_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_pe_endpoint" { 12 | type = string 13 | } 14 | variable "nutanix_port" { 15 | type = string 16 | } 17 | 18 | variable "cluster_ext_id" { 19 | type = string 20 | } 21 | variable "bucket_name" { 22 | type = string 23 | } 24 | variable "region" { 25 | type = string 26 | } 27 | variable "access_key_id" { 28 | type = string 29 | } 30 | variable "secret_access_key" { 31 | type = string 32 | } -------------------------------------------------------------------------------- /examples/pc_restore_source_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_pe_username = "admin" 4 | nutanix_password = "password" 5 | nutanix_pe_password = "password" 6 | nutanix_pc_endpoint = "10.xx.xx.xx" 7 | nutanix_pe_endpoint = "10.xx.xx.xx" 8 | nutanix_port = 9440 9 | -------------------------------------------------------------------------------- /examples/pc_restore_source_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_pe_username" { 9 | type = string 10 | } 11 | variable "nutanix_pe_password" { 12 | type = string 13 | } 14 | variable "nutanix_pc_endpoint" { 15 | type = string 16 | } 17 | variable "nutanix_pe_endpoint" { 18 | type = string 19 | } 20 | variable "nutanix_port" { 21 | type = string 22 | } 23 | variable "pe_username" { 24 | type = string 25 | } 26 | variable "pe_password" { 27 | type = string 28 | } 29 | 30 | variable "cluster_ext_id" { 31 | type = string 32 | } 33 | variable "bucket_name" { 34 | type = string 35 | } 36 | variable "region" { 37 | type = string 38 | } 39 | variable "access_key_id" { 40 | type = string 41 | } 42 | variable "secret_access_key" { 43 | type = string 44 | } 45 | -------------------------------------------------------------------------------- /examples/pc_restore_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_pe_username = "admin" 4 | nutanix_password = "password" 5 | nutanix_pe_password = "password" 6 | nutanix_endpoint = "10.xx.xx.xx" 7 | nutanix_pe_endpoint = "10.xx.xx.xx" 8 | nutanix_port = 9440 9 | 10 | pe_username = "ntnx" 11 | pe_password = "password" 12 | 13 | cvm_ip = "10.xx.xx.xx" 14 | -------------------------------------------------------------------------------- /examples/pc_restore_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_pe_username" { 9 | type = string 10 | } 11 | variable "nutanix_pe_password" { 12 | type = string 13 | } 14 | variable "nutanix_endpoint" { 15 | type = string 16 | } 17 | variable "nutanix_pe_endpoint" { 18 | type = string 19 | } 20 | variable "nutanix_port" { 21 | type = string 22 | } 23 | variable "pe_username" { 24 | type = string 25 | } 26 | variable "pe_password" { 27 | type = string 28 | } 29 | variable "ssh_pc_password" { 30 | type = string 31 | } 32 | variable "cvm_ip" { 33 | type = string 34 | } 35 | 36 | variable "pc_username" { 37 | type = string 38 | } 39 | 40 | variable "pc_password" { 41 | type = string 42 | } 43 | -------------------------------------------------------------------------------- /examples/pc_unregistration_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.1.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | 20 | resource "nutanix_pc_unregistration_v2 " "unregister_pc" { 21 | pc_ext_id = var.local_pc_ext_id 22 | ext_id = var.remote_pc_ext_id 23 | } 24 | -------------------------------------------------------------------------------- /examples/pc_unregistration_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | local_pc_ext_id = "00000000-0000-0000-0000-000000000000" 7 | remote_pc_ext_id = "11111111-1111-1111-1111-111111111111" -------------------------------------------------------------------------------- /examples/pc_unregistration_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "local_pc_ext_id" { 16 | type = string 17 | } 18 | variable "remote_pc_ext_id" { 19 | type = string 20 | } -------------------------------------------------------------------------------- /examples/pc_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.1.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | # list all PC (Domain Managers) 20 | data "nutanix_pcs_v2" "list-pcs" {} 21 | 22 | # list all PC (Domain Managers) with select query 23 | data "nutanix_pcs_v2" "list-pcs-select" { 24 | select = "config" 25 | } 26 | 27 | # Fetch a single PC (Domain Manager) by its external ID 28 | data "nutanix_pc_v2" "get-pc" { 29 | ext_id = "75dde184-3a0e-4f59-a185-03ca1efead17" 30 | } 31 | -------------------------------------------------------------------------------- /examples/pc_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | pe_username = "ntnx" 8 | pe_password = "password" 9 | 10 | cvm_ip = "10.xx.xx.xx" 11 | 12 | new_username = "new_admin" 13 | new_password = "new_password" -------------------------------------------------------------------------------- /examples/pc_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "pe_username" { 15 | type = string 16 | } 17 | variable "pe_password" { 18 | type = string 19 | } 20 | 21 | variable "cvm_ip" { 22 | type = string 23 | } 24 | 25 | variable "new_username" { 26 | type = string 27 | } 28 | 29 | variable "new_password" { 30 | type = string 31 | } -------------------------------------------------------------------------------- /examples/projects/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/projects/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/promote_protected_resource_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | nutanix_remote_username = "admin" 8 | nutanix_remote_password = "password" 9 | nutanix_remote_endpoint = "10.xx.xx.xx" 10 | nutanix_remote_port = 9440 11 | -------------------------------------------------------------------------------- /examples/promote_protected_resource_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "nutanix_remote_username" { 16 | type = string 17 | } 18 | variable "nutanix_remote_password" { 19 | type = string 20 | } 21 | variable "nutanix_remote_endpoint" { 22 | type = string 23 | } 24 | variable "nutanix_remote_port" { 25 | type = string 26 | } 27 | -------------------------------------------------------------------------------- /examples/protected_resource_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/protected_resource_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "nutanix_remote_username" { 16 | type = string 17 | } 18 | variable "nutanix_remote_password" { 19 | type = string 20 | } 21 | variable "nutanix_remote_endpoint" { 22 | type = string 23 | } 24 | variable "nutanix_remote_port" { 25 | type = string 26 | } 27 | -------------------------------------------------------------------------------- /examples/protection_policy_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/protection_policy_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/protection_rule/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/protection_rule/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "source_cluster_uuid" { 15 | type = string 16 | } 17 | variable "target_cluster_uuid" { 18 | type = string 19 | } 20 | variable "source_az_url" { 21 | type = string 22 | } 23 | variable "target_az_url" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/recovery_plan/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/recovery_plan/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "source_cluster_uuid" { 15 | type = string 16 | } 17 | variable "target_cluster_uuid" { 18 | type = string 19 | } 20 | variable "source_az_url" { 21 | type = string 22 | } 23 | variable "target_az_url" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/recovery_point_replicat_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | remote_cluster_uuid = "value" 8 | remote_pc_uuid = "value" 9 | -------------------------------------------------------------------------------- /examples/recovery_point_replicat_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "remote_cluster_uuid" { 16 | type = string 17 | } 18 | variable "remote_pc_uuid" { 19 | type = string 20 | } 21 | -------------------------------------------------------------------------------- /examples/recovery_point_restore_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/recovery_point_restore_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/recovery_point_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/recovery_point_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/restorable_pcs_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_pc_endpoint = "10.xx.xx.xx" 5 | nutanix_pe_endpoint = "10.xx.xx.xx" 6 | nutanix_port = 9440 7 | -------------------------------------------------------------------------------- /examples/restorable_pcs_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_pc_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_pe_endpoint" { 12 | type = string 13 | } 14 | variable "nutanix_port" { 15 | type = string 16 | } 17 | 18 | variable "cluster_ext_id" { 19 | type = string 20 | } 21 | variable "bucket_name" { 22 | type = string 23 | } 24 | variable "region" { 25 | type = string 26 | } 27 | variable "access_key_id" { 28 | type = string 29 | } 30 | variable "secret_access_key" { 31 | type = string 32 | } -------------------------------------------------------------------------------- /examples/restore_protected_resource_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/restore_protected_resource_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "nutanix_remote_username" { 16 | type = string 17 | } 18 | variable "nutanix_remote_password" { 19 | type = string 20 | } 21 | variable "nutanix_remote_endpoint" { 22 | type = string 23 | } 24 | variable "nutanix_remote_port" { 25 | type = string 26 | } 27 | -------------------------------------------------------------------------------- /examples/role/outputs.tf: -------------------------------------------------------------------------------- 1 | output "k8s_infra_provision_role_id" { 2 | value = data.nutanix_role.kubernetes_infrastructure_provision.id 3 | } 4 | 5 | output "k8s_data_services_system_role_id" { 6 | value = data.nutanix_role.k8s_data_services_system.id 7 | } 8 | 9 | output "csi_system_role_id" { 10 | value = data.nutanix_role.csi_system.id 11 | } -------------------------------------------------------------------------------- /examples/role/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.9.2" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/roles_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/roles_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "user" { 16 | type = string 17 | } 18 | variable "password" { 19 | type = string 20 | } 21 | variable "endpoint" { 22 | type = string 23 | } 24 | variable "insecure" { 25 | type = bool 26 | } 27 | variable "port" { 28 | type = number 29 | } 30 | 31 | variable "operations" { 32 | type = list(string) 33 | default = [ 34 | "operation_1_ext_id", 35 | "operation_2_ext_id", 36 | "operation_3_ext_id", 37 | ] 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/route_tables_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/route_tables_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/routes_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/routes_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/saml_idp_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | permission_ext_id = "" 9 | -------------------------------------------------------------------------------- /examples/saml_idp_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "permission_ext_id" { 16 | type = string 17 | } 18 | -------------------------------------------------------------------------------- /examples/security_rules/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | subnet_name = "" 8 | cluster_name = "" -------------------------------------------------------------------------------- /examples/security_rules/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "cluster_name" { 15 | type = string 16 | } 17 | variable "subnet_name" { 18 | type = string 19 | } 20 | -------------------------------------------------------------------------------- /examples/selfservice/app_provision/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | blueprint_name = "name_of_blueprint" 8 | app_name = "name_of_app" 9 | app_description = "description_of_app" 10 | file_name = "runtime_value.json" // any valid json filename to dump runtime editables fetched 11 | substrate_name = "name_of_substrate" // name of substrate whose value you want to change at runtime 12 | system_action_name = "stop" // valid actions are ["start", "stop", "restart"] 13 | -------------------------------------------------------------------------------- /examples/selfservice/app_provision/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "app_name" { 15 | type = string 16 | } 17 | variable "blueprint_name" { 18 | type = string 19 | } 20 | variable "app_description" { 21 | type = string 22 | } 23 | variable "file_name" { 24 | type = string 25 | } 26 | variable "substrate_value" { 27 | type = string 28 | default = < 30 | EOT 31 | } 32 | variable "substrate_name" { 33 | type = string 34 | } 35 | variable "system_action_name" { 36 | type = string 37 | } -------------------------------------------------------------------------------- /examples/selfservice/custom_action/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.2.0" 6 | } 7 | } 8 | } 9 | 10 | provider "nutanix" { 11 | username = var.nutanix_username 12 | password = var.nutanix_password 13 | endpoint = var.nutanix_endpoint 14 | insecure = true 15 | port = var.nutanix_port 16 | } 17 | 18 | // Provision an application 19 | resource "nutanix_self_service_app_provision" "test" { 20 | bp_name = var.blueprint_name 21 | app_name = var.app_name 22 | app_description = var.app_description 23 | } 24 | 25 | // Execute custom action with a name 26 | resource "nutanix_self_service_app_custom_action" "test" { 27 | app_name = var.app_name 28 | action_name = var.action_name 29 | } -------------------------------------------------------------------------------- /examples/selfservice/custom_action/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | blueprint_name = "name_of_blueprint" 8 | app_name = "name_of_application" 9 | action_name = "name_of_custom_action" 10 | app_description = "description_of_application" 11 | -------------------------------------------------------------------------------- /examples/selfservice/custom_action/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "app_name" { 15 | type = string 16 | } 17 | variable "action_name" { 18 | type = string 19 | } 20 | variable "blueprint_name" { 21 | type = string 22 | } 23 | variable "app_description" { 24 | type = string 25 | } 26 | -------------------------------------------------------------------------------- /examples/selfservice/patch_action/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | blueprint_name = "name_of_blueprint" 8 | app_name = "name_of_app" 9 | app_description = "description_of_app" 10 | patch_name = "name_of_patch_action" 11 | config_name = "name_of_config" // same as patch_name 12 | memory_size_mib = 1024 // integer value (size in Mib) 13 | num_sockets = 2 14 | num_vcpus_per_socket = 2 15 | category_value = "Key:Value" // (e.g "AppType:Default") 16 | add_operation = "add" 17 | delete_operation = "delete" 18 | disk_size_mib = 3072 // integer value (size in Mib) 19 | index = "0" // dummy value of index 20 | subnet_uuid = "1234-5678-9012" // valid subnet uuid present in project assigned to application -------------------------------------------------------------------------------- /examples/selfservice/patch_action/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "app_name" { 15 | type = string 16 | } 17 | variable "blueprint_name" { 18 | type = string 19 | } 20 | variable "app_description" { 21 | type = string 22 | } 23 | variable "patch_name" { 24 | type = string 25 | } 26 | variable "config_name" { 27 | type = string 28 | } 29 | variable "memory_size_mib" { 30 | type = number 31 | } 32 | variable "num_sockets" { 33 | type = number 34 | } 35 | variable "num_vcpus_per_socket" { 36 | type = number 37 | } 38 | variable "category_value" { 39 | type = string 40 | } 41 | variable "add_operation" { 42 | type = string 43 | } 44 | variable "delete_operation" { 45 | type = string 46 | } 47 | variable "disk_size_mib" { 48 | type = number 49 | } 50 | variable "index" { 51 | type = string 52 | } 53 | variable "subnet_uuid" { 54 | type = string 55 | } -------------------------------------------------------------------------------- /examples/selfservice/recovery_point/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.2.0" 6 | } 7 | } 8 | } 9 | 10 | provider "nutanix" { 11 | username = var.nutanix_username 12 | password = var.nutanix_password 13 | endpoint = var.nutanix_endpoint 14 | insecure = true 15 | port = var.nutanix_port 16 | } 17 | 18 | // Read snapshot policies present in a blueprint. 19 | data "nutanix_self_service_snapshot_policy_list" "test_snapshot" { 20 | bp_name = "sample_blueprint" 21 | length = 250 22 | offset = 0 23 | } 24 | 25 | // Create a snapshot (recovery point) in application 26 | resource "nutanix_self_service_app_recovery_point" "test_1" { 27 | app_uuid = var.app_uuid 28 | action_name = var.snapshot_action_name 29 | recovery_point_name = var.recovery_point_name 30 | } -------------------------------------------------------------------------------- /examples/selfservice/recovery_point/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | app_uuid = "" 8 | action_name = "action_name" 9 | recovery_point_name = "snap0" 10 | -------------------------------------------------------------------------------- /examples/selfservice/recovery_point/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "app_uuid" { 15 | type = string 16 | } 17 | variable "action_name" { 18 | type = string 19 | } 20 | variable "recovery_point_name" { 21 | type = string 22 | } -------------------------------------------------------------------------------- /examples/selfservice/restore/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.2.0" 6 | } 7 | } 8 | } 9 | 10 | provider "nutanix" { 11 | username = var.nutanix_username 12 | password = var.nutanix_password 13 | endpoint = var.nutanix_endpoint 14 | port = var.nutanix_port 15 | insecure = true 16 | } 17 | 18 | # Read available recovery points in application 19 | data "nutanix_self_service_app_snapshots" "snapshots" { 20 | app_uuid = var.app_uuid 21 | length = 250 22 | offset = 0 23 | } 24 | 25 | # Create local variable pointing to desired recovery point 26 | locals { 27 | snapshot_uuid = [ 28 | for snapshot in data.nutanix_self_service_app_snapshots.snapshots.entities : 29 | snapshot.uuid if snapshot.name == var.snapshot_name 30 | ][0] 31 | } 32 | 33 | // Restore from a recovery point 34 | resource "nutanix_self_service_app_restore" "RestoreAction" { 35 | restore_action_name = var.restore_action_name 36 | app_uuid = var.app_uuid 37 | snapshot_uuid = local.snapshot_uuid 38 | } -------------------------------------------------------------------------------- /examples/selfservice/restore/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | app_uuid = "" 8 | restore_action_name = "" 9 | snapshot_name = "" -------------------------------------------------------------------------------- /examples/selfservice/restore/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "app_uuid" { 15 | type = string 16 | } 17 | 18 | variable "restore_action_name" { 19 | type = string 20 | } 21 | 22 | variable "snapshot_name" { 23 | type = string 24 | } -------------------------------------------------------------------------------- /examples/service_group_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/service_group_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/static_routes/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/static_routes/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/storage_containers_stats_info_v2/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "2.0.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix" { 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | #pull the storage container stats data 20 | data "nutanix_storage_container_stats_info_v2" "test" { 21 | ext_id = "" 22 | start_time = "" 23 | end_time = "" 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/storage_containers_stats_info_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/storage_containers_stats_info_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/storage_containers_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/storage_containers_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/subnets/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/subnets/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/subnets_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/subnets_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/subnets_with_client_side_filters/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.3.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = var.nutanix_port 16 | insecure = true 17 | } 18 | 19 | #pull cluster data 20 | data "nutanix_clusters" "clusters" {} 21 | 22 | #creating subnet 23 | data "nutanix_subnet" "test" { 24 | subnet_name = "nutanix-subnet" 25 | additional_filter { 26 | name = "name" 27 | values = ["vlan.15421", "nutanix-subnet"] 28 | } 29 | 30 | additional_filter { 31 | name = "vlan_id" 32 | values = ["15421", "123"] 33 | } 34 | 35 | additional_filter { 36 | name = "cluster_reference.uuid" 37 | values = ["0005d504-660e-43c3-3507-ac1f6b60292f"] 38 | } 39 | } 40 | 41 | #output the subnet created above 42 | output "subnet" { 43 | value = data.nutanix_subnet.test 44 | } -------------------------------------------------------------------------------- /examples/subnets_with_client_side_filters/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 -------------------------------------------------------------------------------- /examples/subnets_with_client_side_filters/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | -------------------------------------------------------------------------------- /examples/template_guest_os_actions_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/template_guest_os_actions_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/template_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/template_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/unconfigured_node_networks_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | cvm_ip = "10.xx.xx.xx" 7 | -------------------------------------------------------------------------------- /examples/unconfigured_node_networks_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "cvm_ip" { 15 | type = string 16 | } 17 | -------------------------------------------------------------------------------- /examples/user_groups/main.tf: -------------------------------------------------------------------------------- 1 | terraform{ 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = "1.7.0" 6 | } 7 | } 8 | } 9 | 10 | #defining nutanix configuration 11 | provider "nutanix"{ 12 | username = var.nutanix_username 13 | password = var.nutanix_password 14 | endpoint = var.nutanix_endpoint 15 | port = 9440 16 | insecure = true 17 | } 18 | 19 | # Add a User group to the system. 20 | 21 | # Add Directory Service user group. 22 | resource "nutanix_user_groups" "t1" { 23 | directory_service_user_group{ 24 | distinguished_name = "" 25 | } 26 | } 27 | 28 | # Add Directory Service organizational unit. 29 | resource "nutanix_user_groups" "t1" { 30 | directory_service_ou{ 31 | distinguished_name = "" 32 | } 33 | } 34 | 35 | # Add SAML Service user group. 36 | resource "nutanix_user_groups" "t1" { 37 | saml_user_group{ 38 | name = "" 39 | idp_uuid = "" 40 | } 41 | } -------------------------------------------------------------------------------- /examples/user_groups/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/user_groups/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/user_groups_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/user_groups_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/users_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/users_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/virtual_machine_clone_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/virtual_machine_clone_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | -------------------------------------------------------------------------------- /examples/virtual_machine_gc_update_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | user_data = "" 10 | -------------------------------------------------------------------------------- /examples/virtual_machine_gc_update_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "user_data" { 19 | type = string 20 | } 21 | variable "subnet_name" { 22 | type = string 23 | } 24 | -------------------------------------------------------------------------------- /examples/virtual_machine_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/virtual_machine_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | variable "image_name" { 26 | type = string 27 | } 28 | variable "unattend_xml_path" { 29 | type = string 30 | } 31 | -------------------------------------------------------------------------------- /examples/virtual_machine_with_dynamic_disk_list/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | subnet_name = "" 9 | cluster_name = "" 10 | 11 | #this variable will be used in adding disks to vm in main.tf 12 | disk_sizes = [1024,1024,2048] -------------------------------------------------------------------------------- /examples/virtual_machine_with_dynamic_disk_list/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "cluster_name" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | -------------------------------------------------------------------------------- /examples/virtual_machine_with_ngt_install/resources/cloud-init/ubuntu.tpl: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | user: nutanix 3 | password: 4 | chpasswd: {expire: False} 5 | sudo: ALL=(ALL) NOPASSWD:ALL 6 | ssh_pwauth: True 7 | fqdn: ${hostname}.test.local 8 | hostname: ${hostname} 9 | 10 | apt_upgrade: true 11 | packages: 12 | - python-is-python3 13 | # - python3-pip 14 | 15 | 16 | runcmd: 17 | - [mkdir, /mnt/nutanix] 18 | - [mount, /dev/sr1, /mnt/nutanix] 19 | - [python, /mnt/nutanix/installer/linux/install_ngt.py] -------------------------------------------------------------------------------- /examples/virtual_machine_with_ngt_install/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace values as per setup 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | vm_name = "test-vm-999" 8 | 9 | ngt_credentials_username_linux = "admin" 10 | ngt_credentials_password_linux = "Nutanix/123456" -------------------------------------------------------------------------------- /examples/virtual_machine_with_ngt_install/variables.tf: -------------------------------------------------------------------------------- 1 | #variable definitions 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | variable "vm_name" { 15 | type = string 16 | } 17 | variable "ngt_credentials_username_linux" { 18 | type = string 19 | } 20 | variable "ngt_credentials_password_linux" { 21 | type = string 22 | } 23 | -------------------------------------------------------------------------------- /examples/vm_cdrom_insert_eject_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/vm_cdrom_insert_eject_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | variable "image_name" { 26 | type = string 27 | } 28 | -------------------------------------------------------------------------------- /examples/vm_network_device_assign_ip_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/vm_network_device_assign_ip_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | -------------------------------------------------------------------------------- /examples/vm_network_device_migrate_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/vm_network_device_migrate_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | -------------------------------------------------------------------------------- /examples/vm_recovery_point_info_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/vm_recovery_point_info_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/vm_revert_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/vm_revert_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/vm_shutdown_action_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #replace the values as per setup configuration 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | 7 | #replace this values as per the setup 8 | vm_uuid = "" 9 | 10 | #this variable will be used in adding disks to vm in main.tf 11 | disk_sizes = [1024, 1024, 2048] 12 | -------------------------------------------------------------------------------- /examples/vm_shutdown_action_v2/variables.tf: -------------------------------------------------------------------------------- 1 | 2 | #variable definitions 3 | variable "nutanix_username" { 4 | type = string 5 | } 6 | variable "nutanix_password" { 7 | type = string 8 | } 9 | variable "nutanix_endpoint" { 10 | type = string 11 | } 12 | variable "nutanix_port" { 13 | type = string 14 | } 15 | variable "vm_uuid" { 16 | type = string 17 | } 18 | variable "subnet_name" { 19 | type = string 20 | } 21 | variable "disk_sizes" { 22 | type = list(string) 23 | default = [1024, 2048] 24 | } 25 | variable "username" { 26 | type = string 27 | } 28 | variable "password" { 29 | type = string 30 | } 31 | variable "image_name" { 32 | type = string 33 | } 34 | -------------------------------------------------------------------------------- /examples/volume_group_attach_vm_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/volume_group_attach_vm_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "volume_group_name" { 16 | type = string 17 | } 18 | 19 | variable "volume_group_ext_id" { 20 | type = string 21 | } 22 | 23 | variable "volume_group_disk_ext_id" { 24 | type = string 25 | } 26 | 27 | variable "volume_group_sharing_status" { 28 | type = string 29 | } 30 | 31 | variable "volume_group_target_secret" { 32 | type = string 33 | } 34 | 35 | variable "disk_data_source_reference_ext_id" { 36 | type = string 37 | } 38 | 39 | variable "vg_iscsi_ext_id" { 40 | type = string 41 | } 42 | 43 | variable "vg_iscsi_initiator_name" { 44 | type = string 45 | } 46 | 47 | variable "vg_vm_ext_id" { 48 | type = string 49 | } 50 | 51 | variable "volume_iscsi_client_ext_id" { 52 | type = string 53 | } -------------------------------------------------------------------------------- /examples/volume_group_disk_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/volume_group_disk_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/volume_group_iscsi_client_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/volume_group_iscsi_client_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "volume_group_name" { 16 | type = string 17 | } 18 | 19 | variable "volume_group_ext_id" { 20 | type = string 21 | } 22 | 23 | variable "volume_group_disk_ext_id" { 24 | type = string 25 | } 26 | 27 | variable "volume_group_sharing_status" { 28 | type = string 29 | } 30 | 31 | variable "volume_group_target_secret" { 32 | type = string 33 | } 34 | 35 | variable "disk_data_source_reference_ext_id" { 36 | type = string 37 | } 38 | 39 | variable "vg_iscsi_ext_id" { 40 | type = string 41 | } 42 | 43 | variable "vg_iscsi_initiator_name" { 44 | type = string 45 | } 46 | 47 | variable "vg_vm_ext_id" { 48 | type = string 49 | } 50 | 51 | variable "volume_iscsi_client_ext_id" { 52 | type = string 53 | } -------------------------------------------------------------------------------- /examples/volume_group_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/volume_group_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /examples/volume_iscsi_clients_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "password" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/volume_iscsi_clients_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | 15 | variable "volume_group_name" { 16 | type = string 17 | } 18 | 19 | variable "volume_group_ext_id" { 20 | type = string 21 | } 22 | 23 | variable "volume_group_disk_ext_id" { 24 | type = string 25 | } 26 | 27 | variable "volume_group_sharing_status" { 28 | type = string 29 | } 30 | 31 | variable "volume_group_target_secret" { 32 | type = string 33 | } 34 | 35 | variable "disk_data_source_reference_ext_id" { 36 | type = string 37 | } 38 | 39 | variable "vg_iscsi_ext_id" { 40 | type = string 41 | } 42 | 43 | variable "vg_iscsi_initiator_name" { 44 | type = string 45 | } 46 | 47 | variable "vg_vm_ext_id" { 48 | type = string 49 | } 50 | 51 | variable "volume_iscsi_client_ext_id" { 52 | type = string 53 | } -------------------------------------------------------------------------------- /examples/vpc_v2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | #define values to the variables to be used in terraform file 2 | nutanix_username = "admin" 3 | nutanix_password = "Nutanix/123456" 4 | nutanix_endpoint = "10.xx.xx.xx" 5 | nutanix_port = 9440 6 | -------------------------------------------------------------------------------- /examples/vpc_v2/variables.tf: -------------------------------------------------------------------------------- 1 | #define the type of variables to be used in terraform file 2 | variable "nutanix_username" { 3 | type = string 4 | } 5 | variable "nutanix_password" { 6 | type = string 7 | } 8 | variable "nutanix_endpoint" { 9 | type = string 10 | } 11 | variable "nutanix_port" { 12 | type = string 13 | } 14 | -------------------------------------------------------------------------------- /future/pe_pc_registration_v2/datasource_nutanix_pe_pc_registration_entities_v2.go.test.go.future: -------------------------------------------------------------------------------- 1 | package pe_pc_registration_v2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | 8 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 9 | ) 10 | 11 | const datasourceNamePcEntities = "data.nutanix_cluster_pc_registration_entities_v2.test" 12 | 13 | func TestAccNutanixPcEntitiesV4Datasource_Basic(t *testing.T) { 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testPCEntitiesDatasourceV4Config(), 20 | Check: resource.ComposeTestCheckFunc( 21 | resource.TestCheckResourceAttrSet(datasourceNamePcEntities, "pc_entities.#"), 22 | ), 23 | }, 24 | }, 25 | }) 26 | } 27 | 28 | func testPCEntitiesDatasourceV4Config() string { 29 | return ` 30 | data "nutanix_cluster_pc_registration_entities_v2" "test"{} 31 | ` 32 | } 33 | -------------------------------------------------------------------------------- /future/pe_pc_registration_v2/datasource_nutanix_pe_pc_registration_entity_v2.go.test.go.future: -------------------------------------------------------------------------------- 1 | package pe_pc_registration_v2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | 8 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 9 | ) 10 | 11 | const datasourceNamePcEntity = "data.nutanix_cluster_pc_registration_entity_v2.test" 12 | 13 | func TestAccNutanixPcEntityV4Datasource_Basic(t *testing.T) { 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testPCEntityDatasourceV4Config(), 20 | Check: resource.ComposeTestCheckFunc( 21 | resource.TestCheckResourceAttrSet(datasourceNamePcEntity, "ext_id"), 22 | ), 23 | }, 24 | }, 25 | }) 26 | } 27 | 28 | func testPCEntityDatasourceV4Config() string { 29 | return ` 30 | data "nutanix_cluster_pc_registration_entities_v2" "pcs" {} 31 | 32 | data "nutanix_cluster_pc_registration_entity_v2" "test" { 33 | ext_id = data.nutanix_cluster_pc_registration_entities_v2.pcs.pc_entities[0].ext_id 34 | depends_on = [data.nutanix_cluster_pc_registration_entities_v2.pcs] 35 | } 36 | ` 37 | } 38 | -------------------------------------------------------------------------------- /future/volume_group/data_source_nutanix_volume_group_test.go.future: -------------------------------------------------------------------------------- 1 | package nutanix 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" 8 | "github.com/hashicorp/terraform-plugin-sdk/helper/resource" 9 | ) 10 | 11 | func TestAccNutanixVolumeGroupDataSource_basic(t *testing.T) { 12 | t.Skip() 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { testAccPreCheck(t) }, 15 | Providers: testAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testAccVolumeGroupDataSourceConfig(acctest.RandIntRange(0, 500)), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttr( 21 | "data.nutanix_volume_group.test", "name", "Ubuntu"), 22 | resource.TestCheckResourceAttr( 23 | "data.nutanix_volume_group.test", "description", "VG Test Description"), 24 | ), 25 | }, 26 | }, 27 | }) 28 | } 29 | 30 | func testAccVolumeGroupDataSourceConfig(r int) string { 31 | return fmt.Sprintf(` 32 | resource "nutanix_volume_group" "test" { 33 | name = "VG Test %d" 34 | description = "VG Test Description" 35 | 36 | } 37 | 38 | data "nutanix_volume_group" "test" { 39 | volume_group_id = "${nutanix_volume_group.test.id}" 40 | } 41 | `, r) 42 | } 43 | -------------------------------------------------------------------------------- /future/volume_group/data_source_nutanix_volume_groups_test.go.future: -------------------------------------------------------------------------------- 1 | package nutanix 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/helper/resource" 7 | ) 8 | 9 | func TestAccNutanixVolumeGroupsDataSource_basic(t *testing.T) { 10 | t.Skip() 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { testAccPreCheck(t) }, 13 | Providers: testAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccVolumeGroupsDataSourceConfig, 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttr( 19 | "data.nutanix_volume_groups.test", "entities.#", "2"), 20 | ), 21 | }, 22 | }, 23 | }) 24 | } 25 | 26 | // Lookup based on InstanceID 27 | const testAccVolumeGroupsDataSourceConfig = ` 28 | resource "nutanix_volume_group" "test" { 29 | name = "VG Test" 30 | description = "VG Test Description" 31 | 32 | } 33 | 34 | resource "nutanix_volume_group" "test-1" { 35 | name = "VG Test-1" 36 | description = "VG Test-1 Description" 37 | 38 | } 39 | 40 | data "nutanix_volume_groups" "test" { 41 | metadata = { 42 | length = 2 43 | } 44 | } 45 | ` 46 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" 5 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/provider" 6 | ) 7 | 8 | func main() { 9 | plugin.Serve(&plugin.ServeOpts{ 10 | ProviderFunc: provider.Provider, 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /modules/foundation/aos-based-node-imaging/node-serials-filter/output.tf: -------------------------------------------------------------------------------- 1 | // this output will output image_nodes resource data 2 | output "imaged_nodes" { 3 | value = resource.nutanix_foundation_image_nodes.this 4 | } -------------------------------------------------------------------------------- /modules/foundation/aos-based-node-imaging/node-serials-filter/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">1.4.1" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /modules/foundation/discover-nodes-network-details/README.md: -------------------------------------------------------------------------------- 1 | # discover-nodes-network-details 2 | 3 | This module is used to discover nodes and get node network details of nodes which are not a part of any cluster. 4 | 5 | Note : This module was created for internal use in aos and dos based modules. 6 | 7 | ## Resources & DataSources used 8 | 9 | 1. nutanix_foundation_discover_nodes 10 | 2. nutanix_foundation_node_network_details 11 | 12 | ## Usage 13 | 14 | Basic example of usage. 15 | 16 | ```hcl 17 | module "discovered_nodes_network_details" { 18 | // 19 | source = "/terraform-provider-nutanix/modules/foundation/discover-nodes-network-details/" 20 | } 21 | 22 | ``` 23 | 24 | Check output.tf for exported fields from this module -------------------------------------------------------------------------------- /modules/foundation/discover-nodes-network-details/main.tf: -------------------------------------------------------------------------------- 1 | //discovery of nodes 2 | data "nutanix_foundation_discover_nodes" "nodes"{} 3 | 4 | //Get all unconfigured node's ipv6 addresses 5 | locals { 6 | ipv6_addresses = flatten([ 7 | for block in data.nutanix_foundation_discover_nodes.nodes.entities: 8 | [ 9 | for node in block.nodes: 10 | node.ipv6_address if node.configured==false 11 | ] 12 | ]) 13 | } 14 | 15 | //Get node network details as per the ipv6 addresses 16 | data "nutanix_foundation_node_network_details" "ntw_details" { 17 | ipv6_addresses = local.ipv6_addresses 18 | } 19 | 20 | //create map of ipv6_address => node_networ_details of each node 21 | locals { 22 | ipv6_node_network_details_map = tomap({ 23 | for node in data.nutanix_foundation_node_network_details.ntw_details.nodes: 24 | "${node.ipv6_address}" => node 25 | if node.ipv6_address != "" 26 | }) 27 | } 28 | -------------------------------------------------------------------------------- /modules/foundation/discover-nodes-network-details/output.tf: -------------------------------------------------------------------------------- 1 | output "discovered_node_details" { 2 | value = data.nutanix_foundation_discover_nodes.nodes.entities 3 | } 4 | 5 | output "node_network_details_unconfigured_nodes" { 6 | value = data.nutanix_foundation_node_network_details.ntw_details 7 | } 8 | 9 | output "ipv6_to_node_network_details_map" { 10 | value = local.ipv6_node_network_details_map 11 | } -------------------------------------------------------------------------------- /modules/foundation/discover-nodes-network-details/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">1.4.1" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /modules/foundation/dos-based-node-imaging/node-serials-filter/output.tf: -------------------------------------------------------------------------------- 1 | // this output will output image_nodes resource data 2 | output "imaged_nodes" { 3 | value = resource.nutanix_foundation_image_nodes.this 4 | } -------------------------------------------------------------------------------- /modules/foundation/dos-based-node-imaging/node-serials-filter/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">1.4.1" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /modules/foundation/manual-node-imaging/output.tf: -------------------------------------------------------------------------------- 1 | // this output will output image_nodes resource data 2 | output "imaged_nodes" { 3 | value = resource.nutanix_foundation_image_nodes.this 4 | } -------------------------------------------------------------------------------- /modules/foundation/manual-node-imaging/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">1.4.1" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /modules/foundationCentral/aos-based-node-imaging/node-serial-filter/output.tf: -------------------------------------------------------------------------------- 1 | // output the imaged cluster or nodes data created by resource 2 | output "cls" { 3 | value = resource.nutanix_foundation_central_image_cluster.this 4 | } -------------------------------------------------------------------------------- /modules/foundationCentral/aos-based-node-imaging/node-serial-filter/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">=1.5.0-beta.2" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /modules/foundationCentral/manual-node-imaging/node-serial-filter/output.tf: -------------------------------------------------------------------------------- 1 | // output the imaged cluster or nodes data created by resource 2 | output "cls" { 3 | value = resource.nutanix_foundation_central_image_cluster.this 4 | } -------------------------------------------------------------------------------- /modules/foundationCentral/manual-node-imaging/node-serial-filter/version.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | nutanix = { 4 | source = "nutanix/nutanix" 5 | version = ">=1.5.0-beta.2" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /nutanix/sdks/v3/karbon/karbon_api_test.go: -------------------------------------------------------------------------------- 1 | package karbon 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | func TestNewKarbonAPIClient(t *testing.T) { 10 | // verifies positive client creation 11 | cred := client.Credentials{ 12 | URL: "foo.com", 13 | Username: "username", 14 | Password: "password", 15 | Port: "", 16 | Endpoint: "0.0.0.0", 17 | Insecure: true, 18 | FoundationEndpoint: "10.0.0.0", 19 | FoundationPort: "8000", 20 | RequiredFields: nil, 21 | } 22 | _, err := NewKarbonAPIClient(cred) 23 | if err != nil { 24 | t.Errorf(err.Error()) 25 | } 26 | 27 | // verify missing client scenario 28 | cred2 := client.Credentials{ 29 | URL: "foo.com", 30 | Insecure: true, 31 | RequiredFields: map[string][]string{ 32 | "karbon": {"username", "password", "endpoint"}, 33 | }, 34 | } 35 | v3Client2, err2 := NewKarbonAPIClient(cred2) 36 | if err2 != nil { 37 | t.Errorf(err2.Error()) 38 | } 39 | 40 | if v3Client2.client.ErrorMsg == "" { 41 | t.Errorf("NewKarbonAPIClient(%v) expected the base client in karbon client to have some error message", cred2) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nutanix/sdks/v3/karbon/karbon_meta_structs.go: -------------------------------------------------------------------------------- 1 | package karbon 2 | 3 | type MetaVersionResponse struct { 4 | BuildDate *string `json:"build_date" mapstructure:"build_date, omitempty"` 5 | GitCommit *string `json:"git_commit" mapstructure:"git_commit, omitempty"` 6 | Version *string `json:"version" mapstructure:"version, omitempty"` 7 | } 8 | 9 | type MetaSemanticVersionResponse struct { 10 | MajorVersion int64 `json:"major_version" mapstructure:"major_version, omitempty"` 11 | MinorVersion int64 `json:"minor_version" mapstructure:"minor_version, omitempty"` 12 | RevisionVersion int64 `json:"revision_version" mapstructure:"revision_version, omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /nutanix/sdks/v3/karbon/karbon_private_registry_structs.go: -------------------------------------------------------------------------------- 1 | package karbon 2 | 3 | type PrivateRegistryListResponse []PrivateRegistryResponse 4 | 5 | type PrivateRegistryResponse struct { 6 | Name *string `json:"name" mapstructure:"name,omitempty"` 7 | Endpoint *string `json:"endpoint" mapstructure:"endpoint,omitempty"` 8 | UUID *string `json:"uuid" mapstructure:"uuid,omitempty"` 9 | } 10 | 11 | type PrivateRegistryIntentInput struct { 12 | Name *string `json:"name" mapstructure:"name,omitempty"` 13 | Cert *string `json:"cert" mapstructure:"cert,omitempty"` 14 | URL *string `json:"url" mapstructure:"url,omitempty"` 15 | Port *int64 `json:"port,omitempty" mapstructure:"port,omitempty"` 16 | Username *string `json:"username,omitempty" mapstructure:"username,omitempty"` 17 | Password *string `json:"password,omitempty" mapstructure:"password,omitempty"` 18 | } 19 | 20 | type PrivateRegistryOperationResponse struct { 21 | RegistryName *string `json:"registry_name" mapstructure:"registry_name,omitempty"` 22 | } 23 | 24 | type PrivateRegistryOperationIntentInput struct { 25 | RegistryName *string `json:"registry_name" mapstructure:"registry_name,omitempty"` 26 | } 27 | -------------------------------------------------------------------------------- /nutanix/sdks/v3/prism/prism_test.go: -------------------------------------------------------------------------------- 1 | package prism 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | func TestNewV3Client(t *testing.T) { 10 | // verifies positive client creation 11 | cred := client.Credentials{ 12 | URL: "foo.com", 13 | Username: "username", 14 | Password: "password", 15 | Port: "", 16 | Endpoint: "0.0.0.0", 17 | Insecure: true, 18 | FoundationEndpoint: "10.0.0.0", 19 | FoundationPort: "8000", 20 | RequiredFields: nil, 21 | } 22 | _, err := NewV3Client(cred) 23 | if err != nil { 24 | t.Errorf(err.Error()) 25 | } 26 | 27 | // verify missing client scenario 28 | cred2 := client.Credentials{ 29 | URL: "foo.com", 30 | Insecure: true, 31 | RequiredFields: map[string][]string{ 32 | "prism_central": {"username", "password", "endpoint"}, 33 | }, 34 | } 35 | v3Client2, err2 := NewV3Client(cred2) 36 | if err2 != nil { 37 | t.Errorf(err2.Error()) 38 | } 39 | 40 | if v3Client2.client.ErrorMsg == "" { 41 | t.Errorf("NewV3Client(%v) expected the base client in v3 client to have some error message", cred2) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nutanix/sdks/v4/clusters/clusters.go: -------------------------------------------------------------------------------- 1 | package clusters 2 | 3 | import ( 4 | "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/api" 5 | cluster "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/client" 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | type Client struct { 10 | ClusterEntityAPI *api.ClustersApi 11 | StorageContainersAPI *api.StorageContainersApi 12 | } 13 | 14 | func NewClustersClient(credentials client.Credentials) (*Client, error) { 15 | var baseClient *cluster.ApiClient 16 | 17 | // check if all required fields are present. Else create an empty client 18 | if credentials.Username != "" && credentials.Password != "" && credentials.Endpoint != "" { 19 | pcClient := cluster.NewApiClient() 20 | 21 | pcClient.Host = credentials.Endpoint 22 | pcClient.Password = credentials.Password 23 | pcClient.Username = credentials.Username 24 | pcClient.Port = 9440 25 | pcClient.VerifySSL = false 26 | 27 | baseClient = pcClient 28 | } 29 | 30 | f := &Client{ 31 | ClusterEntityAPI: api.NewClustersApi(baseClient), 32 | StorageContainersAPI: api.NewStorageContainersApi(baseClient), 33 | } 34 | 35 | return f, nil 36 | } 37 | -------------------------------------------------------------------------------- /nutanix/sdks/v4/datapolicies/datapolicies.go: -------------------------------------------------------------------------------- 1 | package datapolicies 2 | 3 | import ( 4 | "github.com/nutanix/ntnx-api-golang-clients/datapolicies-go-client/v4/api" 5 | datapolicies "github.com/nutanix/ntnx-api-golang-clients/datapolicies-go-client/v4/client" 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | type Client struct { 10 | ProtectionPolicies *api.ProtectionPoliciesApi 11 | } 12 | 13 | func NewDataPoliciesClient(credentials client.Credentials) (*Client, error) { 14 | var baseClient *datapolicies.ApiClient 15 | 16 | // check if all required fields are present. Else create an empty client 17 | if credentials.Username != "" && credentials.Password != "" && credentials.Endpoint != "" { 18 | pcClient := datapolicies.NewApiClient() 19 | 20 | pcClient.Host = credentials.Endpoint 21 | pcClient.Password = credentials.Password 22 | pcClient.Username = credentials.Username 23 | pcClient.Port = 9440 24 | pcClient.VerifySSL = false 25 | 26 | baseClient = pcClient 27 | } 28 | 29 | f := &Client{ 30 | ProtectionPolicies: api.NewProtectionPoliciesApi(baseClient), 31 | } 32 | 33 | return f, nil 34 | } 35 | -------------------------------------------------------------------------------- /nutanix/sdks/v4/dataprotection/dataprotection.go: -------------------------------------------------------------------------------- 1 | package dataprotection 2 | 3 | import ( 4 | "github.com/nutanix/ntnx-api-golang-clients/dataprotection-go-client/v4/api" 5 | dataprotection "github.com/nutanix/ntnx-api-golang-clients/dataprotection-go-client/v4/client" 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | type Client struct { 10 | RecoveryPoint *api.RecoveryPointsApi 11 | ProtectedResource *api.ProtectedResourcesApi 12 | } 13 | 14 | func NewDataProtectionClient(credentials client.Credentials) (*Client, error) { 15 | var baseClient *dataprotection.ApiClient 16 | 17 | // check if all required fields are present. Else create an empty client 18 | if credentials.Username != "" && credentials.Password != "" && credentials.Endpoint != "" { 19 | pcClient := dataprotection.NewApiClient() 20 | 21 | pcClient.Host = credentials.Endpoint 22 | pcClient.Password = credentials.Password 23 | pcClient.Username = credentials.Username 24 | pcClient.Port = 9440 25 | pcClient.VerifySSL = false 26 | 27 | baseClient = pcClient 28 | } 29 | 30 | f := &Client{ 31 | RecoveryPoint: api.NewRecoveryPointsApi(baseClient), 32 | ProtectedResource: api.NewProtectedResourcesApi(baseClient), 33 | } 34 | 35 | return f, nil 36 | } 37 | -------------------------------------------------------------------------------- /nutanix/sdks/v4/volumes/volumes.go: -------------------------------------------------------------------------------- 1 | package volumes 2 | 3 | import ( 4 | "github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4/api" 5 | prism "github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4/client" 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | type Client struct { 10 | VolumeAPIInstance *api.VolumeGroupsApi 11 | IscsiClientAPIInstance *api.IscsiClientsApi 12 | } 13 | 14 | func NewVolumeClient(credentials client.Credentials) (*Client, error) { 15 | var baseClient *prism.ApiClient 16 | 17 | // check if all required fields are present. Else create an empty client 18 | if credentials.Username != "" && credentials.Password != "" && credentials.Endpoint != "" { 19 | pcClient := prism.NewApiClient() 20 | 21 | pcClient.Host = credentials.Endpoint 22 | pcClient.Password = credentials.Password 23 | pcClient.Username = credentials.Username 24 | pcClient.Port = 9440 25 | pcClient.VerifySSL = false 26 | 27 | baseClient = pcClient 28 | } 29 | 30 | f := &Client{ 31 | VolumeAPIInstance: api.NewVolumeGroupsApi(baseClient), 32 | IscsiClientAPIInstance: api.NewIscsiClientsApi(baseClient), 33 | } 34 | 35 | return f, nil 36 | } 37 | -------------------------------------------------------------------------------- /nutanix/services/clusters/categories.go: -------------------------------------------------------------------------------- 1 | package clusters 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 5 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 6 | ) 7 | 8 | func categoriesSchema() *schema.Schema { 9 | return &schema.Schema{ 10 | Type: schema.TypeSet, 11 | Optional: true, 12 | Computed: true, 13 | Set: func(v interface{}) int { 14 | category := v.(map[string]interface{}) 15 | return utils.HashcodeString(category["name"].(string) + category["value"].(string)) 16 | }, 17 | Elem: &schema.Resource{ 18 | Schema: map[string]*schema.Schema{ 19 | "name": { 20 | Type: schema.TypeString, 21 | Optional: true, 22 | Computed: true, 23 | }, 24 | "value": { 25 | Type: schema.TypeString, 26 | Optional: true, 27 | Computed: true, 28 | }, 29 | }, 30 | }, 31 | } 32 | } 33 | 34 | func flattenCategories(categories map[string]string) []interface{} { 35 | c := make([]interface{}, 0) 36 | 37 | for name, value := range categories { 38 | c = append(c, map[string]interface{}{ 39 | "name": name, 40 | "value": value, 41 | }) 42 | } 43 | 44 | return c 45 | } 46 | -------------------------------------------------------------------------------- /nutanix/services/clusters/categories_schema_migrate.go: -------------------------------------------------------------------------------- 1 | package clusters 2 | 3 | import ( 4 | "log" 5 | "sort" 6 | ) 7 | 8 | func resourceNutanixCategoriesMigrateState(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { 9 | if len(rawState) == 0 || rawState == nil { 10 | log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") 11 | return rawState, nil 12 | } 13 | 14 | keys := make([]string, 0, len(rawState)) 15 | for k := range rawState { 16 | keys = append(keys, k) 17 | } 18 | 19 | sort.Strings(keys) 20 | 21 | log.Printf("[DEBUG] meta: %#v", meta) 22 | log.Printf("[DEBUG] Attributes before migration: %#v", rawState) 23 | 24 | if l, ok := rawState["categories"]; ok { 25 | if assertedL, ok := l.(map[string]interface{}); ok { 26 | c := make([]interface{}, 0) 27 | keys := make([]string, 0, len(assertedL)) 28 | for k := range assertedL { 29 | keys = append(keys, k) 30 | } 31 | sort.Strings(keys) 32 | for _, name := range keys { 33 | value := assertedL[name] 34 | c = append(c, map[string]interface{}{ 35 | "name": name, 36 | "value": value.(string), 37 | }) 38 | } 39 | rawState["categories"] = c 40 | } 41 | } 42 | log.Printf("[DEBUG] Attributes after migration: %#v", rawState) 43 | return rawState, nil 44 | } 45 | -------------------------------------------------------------------------------- /nutanix/services/clusters/data_source_nutanix_clusters_test.go: -------------------------------------------------------------------------------- 1 | package clusters_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixClustersDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccClustersDataSourceConfig, 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttr( 19 | "data.nutanix_clusters.basic_web", "entities.#", "2"), 20 | ), 21 | }, 22 | }, 23 | }) 24 | } 25 | 26 | // Lookup based on InstanceID 27 | const testAccClustersDataSourceConfig = ` 28 | data "nutanix_clusters" "basic_web" {}` 29 | -------------------------------------------------------------------------------- /nutanix/services/clusters/data_source_nutanix_hosts_test.go: -------------------------------------------------------------------------------- 1 | package clusters_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixHostsDataSource_basic(t *testing.T) { 11 | resource.ParallelTest(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccHostsDataSourceConfig(), 17 | }, 18 | }, 19 | }) 20 | } 21 | 22 | func testAccHostsDataSourceConfig() string { 23 | return ` 24 | data "nutanix_hosts" "test" {} 25 | ` 26 | } 27 | -------------------------------------------------------------------------------- /nutanix/services/clusters/helpers.go: -------------------------------------------------------------------------------- 1 | package clusters 2 | 3 | import ( 4 | "strconv" 5 | 6 | v3 "github.com/terraform-providers/terraform-provider-nutanix/nutanix/sdks/v3/prism" 7 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 8 | ) 9 | 10 | const ( 11 | // ERROR .. 12 | ERROR = "ERROR" 13 | ) 14 | 15 | func setRSEntityMetadata(v *v3.Metadata) (map[string]interface{}, []interface{}) { 16 | metadata := make(map[string]interface{}) 17 | metadata["last_update_time"] = utils.TimeValue(v.LastUpdateTime).String() 18 | metadata["uuid"] = utils.StringValue(v.UUID) 19 | metadata["creation_time"] = utils.TimeValue(v.CreationTime).String() 20 | metadata["spec_version"] = strconv.Itoa(int(utils.Int64Value(v.SpecVersion))) 21 | metadata["spec_hash"] = utils.StringValue(v.SpecHash) 22 | metadata["name"] = utils.StringValue(v.Name) 23 | 24 | return metadata, flattenCategories(v.Categories) 25 | } 26 | 27 | func flattenReferenceValues(r *v3.Reference) map[string]interface{} { 28 | reference := make(map[string]interface{}) 29 | if r != nil { 30 | reference["kind"] = utils.StringValue(r.Kind) 31 | reference["uuid"] = utils.StringValue(r.UUID) 32 | if r.Name != nil { 33 | reference["name"] = utils.StringValue(r.Name) 34 | } 35 | } 36 | return reference 37 | } 38 | -------------------------------------------------------------------------------- /nutanix/services/clustersv2/data_source_nutanix_cluster_entity_v2_test.go: -------------------------------------------------------------------------------- 1 | package clustersv2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | const dataSourceNameCluster = "data.nutanix_cluster_v2.test" 11 | 12 | func TestAccV2NutanixClusterDataSource_basic(t *testing.T) { 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { acc.TestAccPreCheck(t) }, 15 | Providers: acc.TestAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testAccClusterDataSourceConfig(), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttr(dataSourceNameCluster, "config.0.cluster_function.0", "PRISM_CENTRAL"), 21 | ), 22 | }, 23 | }, 24 | }) 25 | } 26 | 27 | func testAccClusterDataSourceConfig() string { 28 | return ` 29 | data "nutanix_clusters_v2" "test" {} 30 | 31 | locals { 32 | clusterId = [for cluster in data.nutanix_clusters_v2.test.cluster_entities: 33 | cluster.ext_id if cluster.config[0].cluster_function[0] == "PRISM_CENTRAL"][0] 34 | } 35 | 36 | data "nutanix_cluster_v2" "test" { 37 | ext_id = local.clusterId 38 | }` 39 | } 40 | -------------------------------------------------------------------------------- /nutanix/services/clustersv2/helper.go: -------------------------------------------------------------------------------- 1 | package clustersv2 2 | 3 | import ( 4 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/sdks/v4/clusters" 5 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 6 | ) 7 | 8 | func getEtagHeader(resp interface{}, conn *clusters.Client) map[string]interface{} { 9 | // Extract E-Tag Header 10 | etagValue := conn.ClusterEntityAPI.ApiClient.GetEtag(resp) 11 | 12 | // Extract E-Tag Header 13 | args := make(map[string]interface{}) 14 | args["If-Match"] = utils.StringPtr(etagValue) 15 | 16 | return args 17 | } 18 | -------------------------------------------------------------------------------- /nutanix/services/clustersv2/resource_nutanix_cluster_fetch_networks_v2_test.go: -------------------------------------------------------------------------------- 1 | package clustersv2_test 2 | 3 | // Test cases covered in resource_nutanix_cluster_entity_add_node_v2_test.go 4 | -------------------------------------------------------------------------------- /nutanix/services/datapoliciesv2/main_test.go: -------------------------------------------------------------------------------- 1 | package datapoliciesv2_test 2 | 3 | import ( 4 | "encoding/json" 5 | "log" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | type TestConfig struct { 11 | AvailabilityZone struct { 12 | PcExtID string `json:"pc_ext_id"` 13 | ClusterExtID string `json:"cluster_ext_id"` 14 | RemotePcIP string `json:"remote_pc_ip"` 15 | } `json:"availability_zone"` 16 | } 17 | 18 | var testVars TestConfig 19 | 20 | var ( 21 | path, _ = os.Getwd() 22 | filepath = path + "/../../../test_config_v2.json" 23 | ) 24 | 25 | func loadVars(filepath string, varStuct interface{}) { 26 | // Read config.json from home current path 27 | configData, err := os.ReadFile(filepath) 28 | if err != nil { 29 | log.Printf("Got this error while reading config.json: %s", err.Error()) 30 | os.Exit(1) 31 | } 32 | 33 | err = json.Unmarshal(configData, varStuct) 34 | if err != nil { 35 | log.Printf("Got this error while unmarshalling config.json: %s", err.Error()) 36 | os.Exit(1) 37 | } 38 | } 39 | 40 | func TestMain(m *testing.M) { 41 | log.Println("Do some crazy stuff before tests!") 42 | loadVars("../../../test_config_v2.json", &testVars) 43 | os.Exit(m.Run()) 44 | } 45 | -------------------------------------------------------------------------------- /nutanix/services/foundation/data_source_nutanix_foundation_discover_nodes_test.go: -------------------------------------------------------------------------------- 1 | package foundation_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 8 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 9 | ) 10 | 11 | func TestAccFoundationDiscoverNodesDataSource(t *testing.T) { 12 | name := "nodes" 13 | resourcePath := "data.nutanix_foundation_discover_nodes." + name 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccFoundationPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testDiscoverNodesConfig(name), 20 | Check: resource.ComposeTestCheckFunc( 21 | resource.TestCheckResourceAttrSet(resourcePath, "entities.0.nodes.0.ipv6_address"), 22 | resource.TestCheckResourceAttrSet(resourcePath, "entities.0.nodes.0.hypervisor"), 23 | resource.TestCheckResourceAttrSet(resourcePath, "entities.0.block_id"), 24 | ), 25 | }, 26 | }, 27 | }) 28 | } 29 | 30 | func testDiscoverNodesConfig(name string) string { 31 | return fmt.Sprintf(`data "nutanix_foundation_discover_nodes" "%s" {}`, name) 32 | } 33 | -------------------------------------------------------------------------------- /nutanix/services/foundation/data_source_nutanix_foundation_hypervisor_isos_test.go: -------------------------------------------------------------------------------- 1 | package foundation_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 8 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 9 | ) 10 | 11 | func TestAccFoundationHypervisorISOSDataSource(t *testing.T) { 12 | name := "hypervisor_isos" 13 | resourcePath := "data.nutanix_foundation_hypervisor_isos." + name 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccFoundationPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testHypervisorISOSDSConfig(name), 20 | Check: resource.ComposeTestCheckFunc( 21 | resource.TestCheckResourceAttrSet(resourcePath, "kvm.0.filename"), 22 | resource.TestCheckResourceAttrSet(resourcePath, "esx.0.filename"), 23 | ), 24 | }, 25 | }, 26 | }) 27 | } 28 | 29 | func testHypervisorISOSDSConfig(name string) string { 30 | return fmt.Sprintf(`data "nutanix_foundation_hypervisor_isos" "%s" {}`, name) 31 | } 32 | -------------------------------------------------------------------------------- /nutanix/services/foundation/data_source_nutanix_foundation_nos_packages_test.go: -------------------------------------------------------------------------------- 1 | package foundation_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 8 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 9 | ) 10 | 11 | func TestAccFoundationNosPackagesDataSource(t *testing.T) { 12 | name := "nos_packages" 13 | resourcePath := "data.nutanix_foundation_nos_packages." + name 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccFoundationPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testNosPackagesDSConfig(name), 20 | Check: resource.ComposeTestCheckFunc( 21 | resource.TestCheckResourceAttrSet(resourcePath, "entities.0"), 22 | ), 23 | }, 24 | }, 25 | }) 26 | } 27 | 28 | func testNosPackagesDSConfig(name string) string { 29 | return fmt.Sprintf(`data "nutanix_foundation_nos_packages" "%s" {}`, name) 30 | } 31 | -------------------------------------------------------------------------------- /nutanix/services/foundationCentral/data_source_nutanix_foundation_central_imaged_clusters_list_test.go: -------------------------------------------------------------------------------- 1 | package fc_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccFCClusterListDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccFCClusterListDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_foundation_central_imaged_clusters_list.cls", "imaged_clusters.#"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccFCClusterListDataSourceConfig() string { 26 | return ` 27 | data "nutanix_foundation_central_imaged_clusters_list" "cls" {} 28 | ` 29 | } 30 | -------------------------------------------------------------------------------- /nutanix/services/foundationCentral/data_source_nutanix_foundation_central_imaged_nodes_list_test.go: -------------------------------------------------------------------------------- 1 | package fc_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccFCNodesListDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccFCNodeListDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_foundation_central_imaged_nodes_list.cls", "imaged_nodes.#"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccFCNodeListDataSourceConfig() string { 26 | return ` 27 | data "nutanix_foundation_central_imaged_nodes_list" "cls" {} 28 | ` 29 | } 30 | -------------------------------------------------------------------------------- /nutanix/services/foundationCentral/data_source_nutanix_foundation_central_list_api_keys_test.go: -------------------------------------------------------------------------------- 1 | package fc_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccFCAPIKeysListDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccAPIKeysListDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_foundation_central_list_api_keys.test", "api_keys.#"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccAPIKeysListDataSourceConfig() string { 26 | return ` 27 | data "nutanix_foundation_central_list_api_keys" "test"{} 28 | ` 29 | } 30 | -------------------------------------------------------------------------------- /nutanix/services/foundationCentral/resource_nutanix_foundation_central_api_keys_test.go: -------------------------------------------------------------------------------- 1 | package fc_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 9 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 10 | ) 11 | 12 | func TestAccFCAPIKey_basic(t *testing.T) { 13 | name := acctest.RandomWithPrefix("test-key") 14 | resource.Test(t, resource.TestCase{ 15 | PreCheck: func() { acc.TestAccPreCheck(t) }, 16 | Providers: acc.TestAccProviders, 17 | // CheckDestroy: testAccCheckNutanixAddressGroupDestroy, 18 | Steps: []resource.TestStep{ 19 | { 20 | Config: testAccFCAPIKeyConfig(name), 21 | Check: resource.ComposeTestCheckFunc( 22 | resource.TestCheckResourceAttr("nutanix_foundation_central_api_keys.test", "alias", name), 23 | ), 24 | }, 25 | }, 26 | }) 27 | } 28 | 29 | func testAccFCAPIKeyConfig(name string) string { 30 | return fmt.Sprintf(` 31 | resource "nutanix_foundation_central_api_keys" "test"{ 32 | alias = "%s" 33 | } 34 | `, name) 35 | } 36 | -------------------------------------------------------------------------------- /nutanix/services/iam/data_source_nutanix_access_control_policies_test.go: -------------------------------------------------------------------------------- 1 | package iam_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixAccessControlPoliciesDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccAccessControlPoliciesDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_access_control_policies.test", "entities.0.name"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccAccessControlPoliciesDataSourceConfig() string { 26 | return `data "nutanix_access_control_policies" "test" {}` 27 | } 28 | -------------------------------------------------------------------------------- /nutanix/services/iam/data_source_nutanix_permissions_test.go: -------------------------------------------------------------------------------- 1 | package iam_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixPermissionsDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccPermissionsDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_permissions.test", "entities.#"), 19 | resource.TestCheckResourceAttrSet( 20 | "data.nutanix_permissions.test", "entities.#"), 21 | ), 22 | }, 23 | }, 24 | }) 25 | } 26 | 27 | func testAccPermissionsDataSourceConfig() string { 28 | return ` 29 | data "nutanix_permissions" "test" {} 30 | ` 31 | } 32 | -------------------------------------------------------------------------------- /nutanix/services/iam/data_source_nutanix_roles_test.go: -------------------------------------------------------------------------------- 1 | package iam_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixRolesDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccRolesDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_roles.test", "entities.0.name"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccRolesDataSourceConfig() string { 26 | return `data "nutanix_roles" "test" {}` 27 | } 28 | -------------------------------------------------------------------------------- /nutanix/services/iam/data_source_nutanix_user_groups_test.go: -------------------------------------------------------------------------------- 1 | package iam_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixUserGroupsDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccUserGroupsDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_user_groups.test", "entities.#"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccUserGroupsDataSourceConfig() string { 26 | return ` 27 | data "nutanix_user_groups" "test" {} 28 | ` 29 | } 30 | -------------------------------------------------------------------------------- /nutanix/services/iam/data_source_nutanix_users_test.go: -------------------------------------------------------------------------------- 1 | package iam_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixUsersDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccUsersDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_users.test", "entities.#"), 19 | ), 20 | }, 21 | }, 22 | }) 23 | } 24 | 25 | func testAccUsersDataSourceConfig() string { 26 | return ` 27 | data "nutanix_users" "test" {} 28 | ` 29 | } 30 | -------------------------------------------------------------------------------- /nutanix/services/iamv2/data_source_nutanix_operation_v2_test.go: -------------------------------------------------------------------------------- 1 | package iamv2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | const datasourceNameOperation = "data.nutanix_operation_v2.test" 11 | 12 | func TestAccV2NutanixOperationDatasource_Basic(t *testing.T) { 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { acc.TestAccPreCheck(t) }, 15 | Providers: acc.TestAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testOperationV2DatasourceConfig(), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttrSet(datasourceNameOperation, "ext_id"), 21 | resource.TestCheckResourceAttrSet(datasourceNameOperation, "display_name"), 22 | resource.TestCheckResourceAttrSet(datasourceNameOperation, "entity_type"), 23 | ), 24 | }, 25 | }, 26 | }) 27 | } 28 | 29 | func testOperationV2DatasourceConfig() string { 30 | return ` 31 | data "nutanix_operations_v2" "test" {} 32 | 33 | data "nutanix_operation_v2" "test" { 34 | ext_id = data.nutanix_operations_v2.test.operations.0.ext_id 35 | } 36 | ` 37 | } 38 | -------------------------------------------------------------------------------- /nutanix/services/lcmv2/main_test.go: -------------------------------------------------------------------------------- 1 | package lcmv2_test 2 | 3 | import ( 4 | "encoding/json" 5 | "log" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | type TestConfig struct { 11 | Lcm struct { 12 | EntityModel string `json:"entity_model"` 13 | EntityModelVersion string `json:"entity_model_version"` 14 | } `json:"lcm"` 15 | } 16 | 17 | var testVars TestConfig 18 | 19 | var ( 20 | path, _ = os.Getwd() 21 | filepath = path + "/../../../test_config_v2.json" 22 | ) 23 | 24 | func loadVars(filepath string, varStuct interface{}) { 25 | // Read config.json from home current path 26 | configData, err := os.ReadFile(filepath) 27 | if err != nil { 28 | log.Printf("Got this error while reading config.json: %s", err.Error()) 29 | os.Exit(1) 30 | } 31 | 32 | err = json.Unmarshal(configData, varStuct) 33 | if err != nil { 34 | log.Printf("Got this error while unmarshalling config.json: %s", err.Error()) 35 | os.Exit(1) 36 | } 37 | } 38 | 39 | func TestMain(m *testing.M) { 40 | log.Println("Do some crazy stuff before tests!") 41 | loadVars("../../../test_config_v2.json", &testVars) 42 | os.Exit(m.Run()) 43 | } 44 | -------------------------------------------------------------------------------- /nutanix/services/ndb/data_source_nutanix_ndb_clusters_test.go: -------------------------------------------------------------------------------- 1 | package ndb_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNDBClustersDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccEraPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccNDBClustersDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_clusters.test", "clusters.#"), 19 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_clusters.test", "clusters.0.id"), 20 | ), 21 | }, 22 | }, 23 | }) 24 | } 25 | 26 | func testAccNDBClustersDataSourceConfig() string { 27 | return ` 28 | data "nutanix_ndb_clusters" "test" { } 29 | ` 30 | } 31 | -------------------------------------------------------------------------------- /nutanix/services/ndb/data_source_nutanix_ndb_database_test.go: -------------------------------------------------------------------------------- 1 | package ndb_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccEraDatabaseDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccEraPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccEraDatabaseDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttr("data.nutanix_ndb_database.test", "time_zone", "UTC"), 19 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_database.test", "name"), 20 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_database.test", "linked_databases.#"), 21 | ), 22 | }, 23 | }, 24 | }) 25 | } 26 | 27 | func testAccEraDatabaseDataSourceConfig() string { 28 | return ` 29 | data "nutanix_ndb_databases" "test1" {} 30 | 31 | data "nutanix_ndb_database" "test" { 32 | database_id = data.nutanix_ndb_databases.test1.database_instances.0.id 33 | } 34 | ` 35 | } 36 | -------------------------------------------------------------------------------- /nutanix/services/ndb/data_source_nutanix_ndb_networks_test.go: -------------------------------------------------------------------------------- 1 | package ndb_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccEraNetworksDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccEraPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccEraNetworksDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_networks.test", "networks.0.name"), 19 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_networks.test", "networks.0.cluster_id"), 20 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_networks.test", "networks.0.managed"), 21 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_networks.test", "networks.0.properties.#"), 22 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_networks.test", "networks.0.type"), 23 | ), 24 | }, 25 | }, 26 | }) 27 | } 28 | 29 | func testAccEraNetworksDataSourceConfig() string { 30 | return ` 31 | data "nutanix_ndb_networks" "test" { } 32 | ` 33 | } 34 | -------------------------------------------------------------------------------- /nutanix/services/ndb/data_source_nutanix_ndb_slas_test.go: -------------------------------------------------------------------------------- 1 | package ndb_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccEraSLAsDataSource_basic(t *testing.T) { 11 | resource.Test(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccEraPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccEraSLAsDataSourceConfig(), 17 | Check: resource.ComposeTestCheckFunc( 18 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_slas.test", "slas.#"), 19 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_slas.test", "slas.0.id"), 20 | resource.TestCheckResourceAttrSet("data.nutanix_ndb_slas.test", "slas.0.name"), 21 | ), 22 | }, 23 | }, 24 | }) 25 | } 26 | 27 | func testAccEraSLAsDataSourceConfig() string { 28 | return ` 29 | data "nutanix_ndb_slas" "test" { } 30 | ` 31 | } 32 | -------------------------------------------------------------------------------- /nutanix/services/ndb/resource_nutanix_ndb_log_catchups_test.go: -------------------------------------------------------------------------------- 1 | package ndb_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | const resourceNameLogCatchDB = "nutanix_ndb_log_catchups.acctest-managed" 11 | 12 | func TestAccEra_LogCatchUpbasic(t *testing.T) { 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { acc.TestAccEraPreCheck(t) }, 15 | Providers: acc.TestAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testAccEraDatabaseLogCatchUpConfig(), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttrSet(resourceNameLogCatchDB, "time_machine_id"), 21 | ), 22 | }, 23 | }, 24 | }) 25 | } 26 | 27 | func testAccEraDatabaseLogCatchUpConfig() string { 28 | return (` 29 | data "nutanix_ndb_time_machines" "test1" {} 30 | 31 | resource "nutanix_ndb_log_catchups" "acctest-managed" { 32 | time_machine_id = data.nutanix_ndb_time_machines.test1.time_machines.0.id 33 | } 34 | `) 35 | } 36 | -------------------------------------------------------------------------------- /nutanix/services/networking/filters_test.go: -------------------------------------------------------------------------------- 1 | package networking 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | func TestFilters_replaceFilterPrefixes(t *testing.T) { 10 | mappings := map[string]string{ 11 | "source": "target", 12 | "replace": "replaced", 13 | } 14 | originalFilters := []*client.AdditionalFilter{ 15 | { 16 | Name: "source", 17 | Values: []string{"value1"}, 18 | }, 19 | { 20 | Name: "dnd", 21 | Values: []string{"value"}, 22 | }, 23 | { 24 | Name: "replace.me.too", 25 | Values: []string{"value2", "value3"}, 26 | }, 27 | } 28 | expected := []*client.AdditionalFilter{ 29 | { 30 | Name: "target", 31 | Values: []string{"value1"}, 32 | }, 33 | { 34 | Name: "dnd", 35 | Values: []string{"value"}, 36 | }, 37 | { 38 | Name: "replaced.me.too", 39 | Values: []string{"value2", "value3"}, 40 | }, 41 | } 42 | 43 | actual := ReplaceFilterPrefixes(originalFilters, mappings) 44 | 45 | for i := 0; i < len(expected); i++ { 46 | if actual[i].Name != expected[i].Name { 47 | t.Fatalf("Failed to replace filter mapping from %s to %s, actual: %s", originalFilters[i].Name, expected[i].Name, actual[i].Name) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /nutanix/services/networking/structure.go: -------------------------------------------------------------------------------- 1 | package networking 2 | 3 | import ( 4 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 5 | ) 6 | 7 | const ( 8 | // CDROM ... 9 | CDROM = "CDROM" 10 | ) 11 | 12 | func expandStringList(configured []interface{}) []*string { 13 | vs := make([]*string, 0, len(configured)) 14 | for _, v := range configured { 15 | val, ok := v.(string) 16 | if ok && val != "" { 17 | vs = append(vs, utils.StringPtr(v.(string))) 18 | } 19 | } 20 | return vs 21 | } 22 | -------------------------------------------------------------------------------- /nutanix/services/prism/categories_schema_migrate.go: -------------------------------------------------------------------------------- 1 | package prism 2 | 3 | import ( 4 | "log" 5 | "sort" 6 | ) 7 | 8 | func resourceNutanixCategoriesMigrateState(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { 9 | if len(rawState) == 0 || rawState == nil { 10 | log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") 11 | return rawState, nil 12 | } 13 | 14 | keys := make([]string, 0, len(rawState)) 15 | for k := range rawState { 16 | keys = append(keys, k) 17 | } 18 | 19 | sort.Strings(keys) 20 | 21 | log.Printf("[DEBUG] meta: %#v", meta) 22 | log.Printf("[DEBUG] Attributes before migration: %#v", rawState) 23 | 24 | if l, ok := rawState["categories"]; ok { 25 | if assertedL, ok := l.(map[string]interface{}); ok { 26 | c := make([]interface{}, 0) 27 | keys := make([]string, 0, len(assertedL)) 28 | for k := range assertedL { 29 | keys = append(keys, k) 30 | } 31 | sort.Strings(keys) 32 | for _, name := range keys { 33 | value := assertedL[name] 34 | c = append(c, map[string]interface{}{ 35 | "name": name, 36 | "value": value.(string), 37 | }) 38 | } 39 | rawState["categories"] = c 40 | } 41 | } 42 | log.Printf("[DEBUG] Attributes after migration: %#v", rawState) 43 | return rawState, nil 44 | } 45 | -------------------------------------------------------------------------------- /nutanix/services/prism/data_source_nutanix_assert_helper_test.go: -------------------------------------------------------------------------------- 1 | package prism_test 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "testing" 7 | 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 9 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 10 | ) 11 | 12 | func TestAccNutanixAssertHelperDS(t *testing.T) { 13 | name := "checks" 14 | errorMsg := "Error message for nutanix assert helper" 15 | resource.Test(t, resource.TestCase{ 16 | Providers: acc.TestAccProviders, 17 | Steps: []resource.TestStep{ 18 | { 19 | Config: testAccNutanixAssertHelperDS(name, "false", errorMsg), 20 | ExpectError: regexp.MustCompile(errorMsg), 21 | }, 22 | { 23 | Config: testAccNutanixAssertHelperDS(name, "true", errorMsg), 24 | }, 25 | }, 26 | }) 27 | } 28 | 29 | func testAccNutanixAssertHelperDS(name, condition, errMsg string) string { 30 | return fmt.Sprintf(` 31 | data "nutanix_assert_helper" "%s" { 32 | checks { 33 | condition = %s 34 | error_message = "%s" 35 | } 36 | } 37 | `, name, condition, errMsg) 38 | } 39 | -------------------------------------------------------------------------------- /nutanix/services/prism/data_source_nutanix_projects_test.go: -------------------------------------------------------------------------------- 1 | package prism_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixProjectsDataSource_basic(t *testing.T) { 11 | resource.ParallelTest(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccProjectsDataSourceConfig(), 17 | }, 18 | }, 19 | }) 20 | } 21 | 22 | func testAccProjectsDataSourceConfig() string { 23 | return ` 24 | data "nutanix_projects" "test" {} 25 | ` 26 | } 27 | -------------------------------------------------------------------------------- /nutanix/services/prism/data_source_recovery_plans_test.go: -------------------------------------------------------------------------------- 1 | package prism_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | func TestAccNutanixRecoveryPlansDataSource_basic(t *testing.T) { 11 | resource.ParallelTest(t, resource.TestCase{ 12 | PreCheck: func() { acc.TestAccPreCheck(t) }, 13 | Providers: acc.TestAccProviders, 14 | Steps: []resource.TestStep{ 15 | { 16 | Config: testAccRecoveryPlansDataSourceConfig(), 17 | }, 18 | }, 19 | }) 20 | } 21 | 22 | func testAccRecoveryPlansDataSourceConfig() string { 23 | return ` 24 | data "nutanix_recovery_plans" "test" {} 25 | ` 26 | } 27 | -------------------------------------------------------------------------------- /nutanix/services/prism/filters_test.go: -------------------------------------------------------------------------------- 1 | package prism 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" 7 | ) 8 | 9 | func TestFilters_replaceFilterPrefixes(t *testing.T) { 10 | mappings := map[string]string{ 11 | "source": "target", 12 | "replace": "replaced", 13 | } 14 | originalFilters := []*client.AdditionalFilter{ 15 | { 16 | Name: "source", 17 | Values: []string{"value1"}, 18 | }, 19 | { 20 | Name: "dnd", 21 | Values: []string{"value"}, 22 | }, 23 | { 24 | Name: "replace.me.too", 25 | Values: []string{"value2", "value3"}, 26 | }, 27 | } 28 | expected := []*client.AdditionalFilter{ 29 | { 30 | Name: "target", 31 | Values: []string{"value1"}, 32 | }, 33 | { 34 | Name: "dnd", 35 | Values: []string{"value"}, 36 | }, 37 | { 38 | Name: "replaced.me.too", 39 | Values: []string{"value2", "value3"}, 40 | }, 41 | } 42 | 43 | actual := ReplaceFilterPrefixes(originalFilters, mappings) 44 | 45 | for i := 0; i < len(expected); i++ { 46 | if actual[i].Name != expected[i].Name { 47 | t.Fatalf("Failed to replace filter mapping from %s to %s, actual: %s", originalFilters[i].Name, expected[i].Name, actual[i].Name) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /nutanix/services/prism/structure.go: -------------------------------------------------------------------------------- 1 | package prism 2 | 3 | import ( 4 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 5 | ) 6 | 7 | const ( 8 | // CDROM ... 9 | CDROM = "CDROM" 10 | ) 11 | 12 | func expandStringList(configured []interface{}) []*string { 13 | vs := make([]*string, 0, len(configured)) 14 | for _, v := range configured { 15 | val, ok := v.(string) 16 | if ok && val != "" { 17 | vs = append(vs, utils.StringPtr(v.(string))) 18 | } 19 | } 20 | return vs 21 | } 22 | -------------------------------------------------------------------------------- /nutanix/services/selfservice/main_test.go: -------------------------------------------------------------------------------- 1 | package selfservice_test 2 | 3 | import ( 4 | "encoding/json" 5 | "log" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | type TestConfig struct { 11 | SelfService struct { 12 | BlueprintName string `json:"bp_name"` 13 | BlueprintWithSnapshotName string `json:"bp_name_with_snapshot_config"` 14 | AppWithSnapshotName string `json:"app_name_with_snapshot_config"` 15 | } `json:"self_service"` 16 | } 17 | 18 | var testVars TestConfig 19 | 20 | func loadVars(filepath string, varStuct interface{}) { 21 | // Read config.json from home current path 22 | configData, err := os.ReadFile(filepath) 23 | if err != nil { 24 | log.Printf("Got this error while reading config.json: %s", err.Error()) 25 | os.Exit(1) 26 | } 27 | 28 | err = json.Unmarshal(configData, varStuct) 29 | if err != nil { 30 | log.Printf("Got this error while unmarshalling config.json: %s", err.Error()) 31 | os.Exit(1) 32 | } 33 | } 34 | 35 | func TestMain(m *testing.M) { 36 | log.Println("Do some crazy stuff before tests!") 37 | loadVars("../../../test_config.json", &testVars) 38 | 39 | os.Exit(m.Run()) 40 | } 41 | -------------------------------------------------------------------------------- /nutanix/services/vmm/categories_schema_migrate.go: -------------------------------------------------------------------------------- 1 | package vmm 2 | 3 | import ( 4 | "log" 5 | "sort" 6 | ) 7 | 8 | func resourceNutanixCategoriesMigrateState(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { 9 | if len(rawState) == 0 || rawState == nil { 10 | log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") 11 | return rawState, nil 12 | } 13 | 14 | keys := make([]string, 0, len(rawState)) 15 | for k := range rawState { 16 | keys = append(keys, k) 17 | } 18 | 19 | sort.Strings(keys) 20 | 21 | log.Printf("[DEBUG] meta: %#v", meta) 22 | log.Printf("[DEBUG] Attributes before migration: %#v", rawState) 23 | 24 | if l, ok := rawState["categories"]; ok { 25 | if assertedL, ok := l.(map[string]interface{}); ok { 26 | c := make([]interface{}, 0) 27 | keys := make([]string, 0, len(assertedL)) 28 | for k := range assertedL { 29 | keys = append(keys, k) 30 | } 31 | sort.Strings(keys) 32 | for _, name := range keys { 33 | value := assertedL[name] 34 | c = append(c, map[string]interface{}{ 35 | "name": name, 36 | "value": value.(string), 37 | }) 38 | } 39 | rawState["categories"] = c 40 | } 41 | } 42 | log.Printf("[DEBUG] Attributes after migration: %#v", rawState) 43 | return rawState, nil 44 | } 45 | -------------------------------------------------------------------------------- /nutanix/services/vmmv2/helper.go: -------------------------------------------------------------------------------- 1 | package vmmv2 2 | 3 | import ( 4 | "github.com/terraform-providers/terraform-provider-nutanix/nutanix/sdks/v4/vmm" 5 | "github.com/terraform-providers/terraform-provider-nutanix/utils" 6 | ) 7 | 8 | func getEtagHeader(resp interface{}, conn *vmm.Client) *string { 9 | // Extract E-Tag Header 10 | etagValue := conn.VMAPIInstance.ApiClient.GetEtag(resp) 11 | return utils.StringPtr(etagValue) 12 | } 13 | -------------------------------------------------------------------------------- /nutanix/services/volumesv2/data_source_nutanix_volume_iscsi_client_v2_test.go: -------------------------------------------------------------------------------- 1 | package volumesv2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | const dataSourceVolumeIscsiClient = "data.nutanix_volume_iscsi_client_v2.v_iscsi" 11 | 12 | func TestAccV2NutanixVolumeIscsiClientDataSource_Basic(t *testing.T) { 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { acc.TestAccPreCheck(t) }, 15 | Providers: acc.TestAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testAccVolumeIscsiClientV2Config(), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttrSet(dataSourceVolumeIscsiClient, "iscsi_initiator_name"), 21 | resource.TestCheckResourceAttrSet(dataSourceVolumeIscsiClient, "ext_id"), 22 | ), 23 | }, 24 | }, 25 | }) 26 | } 27 | 28 | func testAccVolumeIscsiClientV2Config() string { 29 | return ` 30 | 31 | data "nutanix_volume_iscsi_clients_v2" "test" {} 32 | 33 | data "nutanix_volume_iscsi_client_v2" "v_iscsi" { 34 | ext_id = data.nutanix_volume_iscsi_clients_v2.test.iscsi_clients.0.ext_id 35 | }` 36 | } 37 | -------------------------------------------------------------------------------- /nutanix/services/volumesv2/data_source_nutanix_volume_iscsi_clients_v2_test.go: -------------------------------------------------------------------------------- 1 | package volumesv2_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 7 | acc "github.com/terraform-providers/terraform-provider-nutanix/nutanix/acctest" 8 | ) 9 | 10 | const dataSourceVolumeIscsiClients = "data.nutanix_volume_iscsi_clients_v2.v_iscsi" 11 | 12 | func TestAccV2NutanixVolumeIscsiClientsDataSource_Basic(t *testing.T) { 13 | resource.Test(t, resource.TestCase{ 14 | PreCheck: func() { acc.TestAccPreCheck(t) }, 15 | Providers: acc.TestAccProviders, 16 | Steps: []resource.TestStep{ 17 | { 18 | Config: testAccVolumeIscsiClientsV2Config(), 19 | Check: resource.ComposeTestCheckFunc( 20 | resource.TestCheckResourceAttrSet(dataSourceVolumeIscsiClients, "iscsi_clients.#"), 21 | testAccCheckResourceAttrListNotEmpty(dataSourceVolumeIscsiClients, "iscsi_clients", "iscsi_initiator_name"), 22 | ), 23 | }, 24 | }, 25 | }) 26 | } 27 | 28 | func testAccVolumeIscsiClientsV2Config() string { 29 | return ` 30 | data "nutanix_volume_iscsi_clients_v2" "v_iscsi" {}` 31 | } 32 | -------------------------------------------------------------------------------- /nutanix/services/volumesv2/main_test.go: -------------------------------------------------------------------------------- 1 | package volumesv2_test 2 | 3 | import ( 4 | "encoding/json" 5 | "log" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | type TestConfig struct { 11 | // Volumes config 12 | Volumes struct { 13 | VolumeGroupExtIDWithCategory string `json:"vg_ext_id_with_category"` 14 | } `json:"volumes"` 15 | } 16 | 17 | var ( 18 | testVars TestConfig 19 | path, _ = os.Getwd() 20 | filepath = path + "/../../../test_config_v2.json" 21 | ) 22 | 23 | func loadVars(filepath string, varStuct interface{}) { 24 | // Read test_config_v2.json from the home current path 25 | configData, err := os.ReadFile(filepath) 26 | if err != nil { 27 | log.Printf("Got this error while reading config.json: %s", err.Error()) 28 | os.Exit(1) 29 | } 30 | 31 | err = json.Unmarshal(configData, varStuct) 32 | if err != nil { 33 | log.Printf("Got this error while unmarshalling config.json: %s", err.Error()) 34 | os.Exit(1) 35 | } 36 | } 37 | 38 | func TestMain(m *testing.M) { 39 | log.Println("Do some crazy stuff before tests!") 40 | loadVars("../../../test_config_v2.json", &testVars) 41 | os.Exit(m.Run()) 42 | } 43 | -------------------------------------------------------------------------------- /scripts/changelog-links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/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 terraform provider 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 | PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-nutanix\/issues" 28 | 29 | $SED "s/GH-([0-9]+)/\[#\1\]\($PROVIDER_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md 30 | 31 | rm CHANGELOG.md.bak 32 | -------------------------------------------------------------------------------- /scripts/errcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Check gofmt 4 | echo "==> Checking for unchecked errors..." 5 | 6 | if ! which errcheck > /dev/null; then 7 | echo "==> Installing errcheck..." 8 | go get -u github.com/kisielk/errcheck 9 | fi 10 | 11 | err_files=$(errcheck -ignoretests \ 12 | -ignore 'github.com/hashicorp/terraform-plugin-sdk/helper/schema:Set' \ 13 | -ignore 'bytes:.*' \ 14 | -ignore 'io:Close|Write' \ 15 | $(go list ./...| grep -v /vendor/)) 16 | 17 | if [[ -n ${err_files} ]]; then 18 | echo 'Unchecked errors found in the following places:' 19 | echo "${err_files}" 20 | echo "Please handle returned errors. You can check directly with \`make errcheck\`" 21 | exit 1 22 | fi 23 | 24 | exit 0 25 | -------------------------------------------------------------------------------- /scripts/gofmtcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Check gofmt 4 | echo "==> Checking that code complies with gofmt requirements..." 5 | gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) 6 | if [[ -n ${gofmt_files} ]]; then 7 | echo 'gofmt needs running on the following files:' 8 | echo "${gofmt_files}" 9 | echo "You can use the command: \`make fmt\` to reformat code." 10 | exit 1 11 | fi 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /scripts/gogetcookie.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null 4 | touch ~/.gitcookies 5 | chmod 0600 ~/.gitcookies 6 | 7 | git config --global http.cookiefile ~/.gitcookies 8 | 9 | tr , \\t <<\__END__ >>~/.gitcookies 10 | go.googlesource.com,FALSE,/,TRUE,2147483647,o,git-marinssalinas.gmail.com=1/fzxxUwt0Hs8AFhJUiZ-IzI2fe_w6azG7h_D7X3J3kH4 11 | go-review.googlesource.com,FALSE,/,TRUE,2147483647,o,git-marinssalinas.gmail.com=1/fzxxUwt0Hs8AFhJUiZ-IzI2fe_w6azG7h_D7X3J3kH4 12 | __END__ 13 | eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null 14 | -------------------------------------------------------------------------------- /tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | package main 5 | 6 | import ( 7 | _ "github.com/client9/misspell/cmd/misspell" 8 | _ "github.com/golangci/golangci-lint/cmd/golangci-lint" 9 | _ "github.com/mitchellh/gox" 10 | ) 11 | -------------------------------------------------------------------------------- /website/docs/d/foundation_central_get_api_key.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_foundation_central_api_keys" 4 | sidebar_current: "docs-nutanix-datasource-foundation-central-api-keys" 5 | description: |- 6 | Details of the api key. 7 | --- 8 | 9 | # nutanix_foundation_central_api_keys 10 | 11 | Get an api key given its UUID. 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_foundation_central_api_keys" "api_keys_list" { 17 | key_uuid = "" 18 | } 19 | ``` 20 | 21 | ## Argument Reference 22 | 23 | *`key_uuid`: UUID of the key which needs to be fetched. 24 | 25 | ## Attribute Reference 26 | 27 | The following attributes are exported: 28 | 29 | * `created_timestamp`: Time when the api key was created. 30 | * `alias`: Alias of the api key. 31 | * `key_uuid`: UUID of the api key. 32 | * `api_key`: Api key in string format. 33 | * `current_time`: Current time of Foundation Central. 34 | 35 | 36 | See detailed information in [Nutanix Foundation Central Get an API key](https://www.nutanix.dev/api_references/foundation-central/#/92553fa628770-get-an-api-key). -------------------------------------------------------------------------------- /website/docs/d/foundation_nos_packages.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_foundation_nos_packages" 4 | sidebar_current: "docs-nutanix-datasource-foundation-nos-packages" 5 | description: |- 6 | Describes a list of nos packages present in foundation vm 7 | --- 8 | 9 | # nutanix_clusters 10 | 11 | Describes a list of nos (aos) packages present in foundation vm 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_foundation_nos_packages" "nos_packages" {} 17 | ``` 18 | 19 | ## Argument Reference 20 | 21 | No arguments are supported 22 | 23 | ## Attribute Reference 24 | 25 | The following attributes are exported: 26 | 27 | * `entities`: List of nos packages file names present in foundation vm 28 | 29 | ## Note 30 | * This data source only lists .tar file names. 31 | 32 | See detailed information in [Nutanix Foundation Nos Packages](https://www.nutanix.dev/api_references/foundation/#/b3A6MjIyMjMzODg-get-list-of-aos-packages-available-in-foundation). 33 | -------------------------------------------------------------------------------- /website/docs/d/karbon_private_registries.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_karbon_private_registries" 4 | sidebar_current: "docs-nutanix-datasource-karbon-private-registry" 5 | description: |- 6 | Describes a List of Karbon private registry entry 7 | --- 8 | 9 | # nutanix_karbon_private_registries 10 | 11 | Describes a List of Karbon private registry entry 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_karbon_private_registries" "registry" { 17 | cluster_id = "" 18 | } 19 | ``` 20 | 21 | ## Argument Reference 22 | 23 | The following arguments are supported: 24 | 25 | * `private_registry_id`: Represents karbon private registry uuid 26 | * `private_registry_name`: Represents the name of karbon private registry 27 | 28 | ## Attributes Reference 29 | 30 | The following attributes are supported: 31 | 32 | * `name`: - Name of the private registry. 33 | * `uuid`: - UUID of the private registry. 34 | * `endpoint`: - Endpoint of the private in format `url:port`. 35 | 36 | 37 | See detailed information in [Nutanix Karbon Registries](https://www.nutanix.dev/api_references/nke/#/6542bb676c318-list-the-private-registry-configurations-api-format-https-server-nutanix-com-9440-karbon-v1-alpha-1-registries). -------------------------------------------------------------------------------- /website/docs/d/karbon_private_registry.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_karbon_private_registry" 4 | sidebar_current: "docs-nutanix-datasource-karbon-private-registry" 5 | description: |- 6 | Describes a Karbon private registry entry 7 | --- 8 | 9 | # nutanix_karbon_private_registry 10 | 11 | Describes Karbon private registry entry 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_karbon_private_registry" "registry" { 17 | cluster_id = "" 18 | } 19 | ``` 20 | 21 | ## Argument Reference 22 | 23 | The following arguments are supported: 24 | 25 | * `private_registry_id`: Represents karbon private registry uuid 26 | * `private_registry_name`: Represents the name of karbon private registry 27 | 28 | ## Attributes Reference 29 | 30 | The following attributes are supported: 31 | 32 | * `name`: - Name of the private registry. 33 | * `uuid`: - UUID of the private registry. 34 | * `endpoint`: - Endpoint of the private in format `url:port`. 35 | 36 | 37 | See detailed information in [Nutanix Karbon Registry](https://www.nutanix.dev/api_references/nke/#/fed89354bc228-get-the-private-registry-configuration-of-the-specified-name-api-format-https-server-nutanix-com-9440-karbon-v1-alpha-1-registries-test-reg). 38 | -------------------------------------------------------------------------------- /website/docs/d/ndb_network_available_ips.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_ndb_network_available_ips" 4 | sidebar_current: "docs-nutanix-datasource-ndb-network-available-ips" 5 | description: |- 6 | List of available IPs in Network 7 | --- 8 | 9 | # nutanix_ndb_network_available_ips 10 | 11 | List of available IPs in Network 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_ndb_network_available_ips" "network"{ 17 | profile_id = "{{ network_profile_id }}" 18 | } 19 | ``` 20 | 21 | 22 | ## Attribute Reference 23 | 24 | The following attributes are exported: 25 | 26 | * `profile_id`: (Required) Network Profile id. 27 | * `available_ips`: List of network available ips 28 | 29 | ### available_ips 30 | 31 | * `id`: network profile id 32 | * `name`: Network Name 33 | * `property_name`: property name of vlan 34 | * `type`: type of network 35 | * `managed`: managed by ndb or not 36 | * `ip_addresses`: list of available ips in network 37 | * `cluster_id`: cluster id 38 | * `cluster_name`: cluster name -------------------------------------------------------------------------------- /website/docs/d/ndb_tag.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_ndb_tag" 4 | sidebar_current: "docs-nutanix-datasource-ndb-tag" 5 | description: |- 6 | Describes a tag in Nutanix Database Service 7 | --- 8 | 9 | # nutanix_ndb_tag 10 | 11 | Describes a tag in Nutanix Database Service 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_ndb_tag" "tag"{ 17 | id = "{{ tag id }}" 18 | } 19 | ``` 20 | 21 | 22 | ## Argument Reference 23 | 24 | The following arguments are supported: 25 | * `id` : (Optional) tag id. Conflicts with name. 26 | * `name`: (Optional) tag name. Conflicts with id. 27 | 28 | ## Attribute Reference 29 | 30 | The following attributes are exported: 31 | 32 | * `name`: name for the tag 33 | * `description`: description for the tag 34 | * `entity_type`: entity for the tag to be associated with. 35 | * `required`: tag value for entities. 36 | * `status`: Status of the tag 37 | * `owner`: owner id of the tag 38 | * `values`: value for the tag 39 | * `date_created`: date created of the tag 40 | * `date_modified`: modified date of tha tag 41 | 42 | 43 | See detailed information in [NDB Tag](https://www.nutanix.dev/api_references/ndb/#/0a7bf3bdeed86-get-list-of-all-tags). -------------------------------------------------------------------------------- /website/docs/d/ndb_tags.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_ndb_tags" 4 | sidebar_current: "docs-nutanix-datasource-ndb-tag" 5 | description: |- 6 | List of tags in Nutanix Database Service 7 | --- 8 | 9 | # nutanix_ndb_tags 10 | 11 | List of tags in Nutanix Database Service 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | data "nutanix_ndb_tags" "tags"{ } 17 | ``` 18 | 19 | ## Attribute Reference 20 | 21 | The following attributes are exported: 22 | 23 | * `tags`: List of tags present in NDB. 24 | * `entity_type`: (Optional) entity type of specific tag. Valid values are DATABASE, TIME_MACHINE, CLONE,DATABASE_SERVER. 25 | 26 | ### tags 27 | * `name`: name for the tag 28 | * `description`: description for the tag 29 | * `entity_type`: entity for the tag to be associated with. 30 | * `required`: tag value for entities. 31 | * `status`: Status of the tag 32 | * `owner`: owner id of the tag 33 | * `values`: value for the tag 34 | * `date_created`: date created of the tag 35 | * `date_modified`: modified date of tha tag 36 | 37 | 38 | See detailed information in [NDB Tags](https://www.nutanix.dev/api_references/ndb/#/0a7bf3bdeed86-get-list-of-all-tags). -------------------------------------------------------------------------------- /website/docs/r/category_key.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_category_key" 4 | sidebar_current: "docs-nutanix-resource-category-key" 5 | description: |- 6 | Provides a Nutanix Category key resource to Create a category key name. 7 | --- 8 | 9 | # nutanix_category_key 10 | 11 | Provides a Nutanix Category key resource to Create a category key name. 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | resource "nutanix_category_key" "test"{ 17 | name = "app-support-example" 18 | description = "App Support Category Key" 19 | } 20 | ``` 21 | 22 | ## Argument Reference 23 | 24 | The following arguments are supported: 25 | 26 | * `name`: - (Required) The name for the category key. 27 | * `description`: - (Optional) A description for category key. 28 | 29 | ## Attributes Reference 30 | 31 | The following attributes are exported: 32 | 33 | * `system_defined`: - Specifying whether its a system defined category. 34 | * `api_version` - (Optional) The version of the API. 35 | 36 | See detailed information in [Nutanix Category Key](https://www.nutanix.dev/api_references/prism-central-v3/#/c67191febf803-create-or-update-a-category-key). 37 | -------------------------------------------------------------------------------- /website/docs/r/lcm_perform_inventory_v2.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_lcm_perform_inventory_v2" 4 | sidebar_current: "docs-nutanix_lcm_perform_inventory_v2" 5 | description: |- 6 | Perform an inventory operation to identify/scan entities on the cluster that can be updated through LCM. 7 | --- 8 | 9 | # nutanix_lcm_perform_inventory_v2 10 | 11 | Perform an inventory operation to identify/scan entities on the cluster that can be updated through LCM. 12 | 13 | ## Example 14 | 15 | ```hcl 16 | 17 | # perform inventory 18 | resource "nutanix_lcm_perform_inventory_v2" "inventory" { 19 | x_cluster_id = "0005a104-0b0b-4b0b-8005-0b0b0b0b0b0b" 20 | } 21 | ``` 22 | 23 | ## Argument Reference 24 | The following arguments are supported: 25 | 26 | * `x_cluster_id`: (Optional) Cluster uuid on which the resource is present or operation is being performed. 27 | 28 | See detailed information in [Nutanix LCM Perform Inventory v4](https://developers.nutanix.com/api-reference?namespace=lifecycle&version=v4.0#tag/Inventory/operation/performInventory) 29 | -------------------------------------------------------------------------------- /website/docs/r/ndb_authorize_dbserver.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_ndb_authorize_dbserver" 4 | sidebar_current: "docs-nutanix-resource-ndb-authorize-dbserver" 5 | description: |- 6 | This operation submits a request to authorize db server VMs for cloning of the database instance in Nutanix database service (NDB). 7 | --- 8 | 9 | # nutanix_ndb_authorize_dbserver 10 | 11 | Provides a resource to authorize db server VMs for cloning of database instance based on the input parameters. 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | 17 | resource "nutanix_ndb_authorize_dbserver" "name" { 18 | time_machine_name = "test-pg-inst" 19 | dbservers_id = [ 20 | "{{ dbServer_IDs}}" 21 | ] 22 | } 23 | ``` 24 | 25 | ## Arguments Reference 26 | 27 | * `time_machine_id`: (Optional) 28 | * `time_machine_name`: (Optional) 29 | * `dbservers_id `: (Required) 30 | -------------------------------------------------------------------------------- /website/docs/r/pc_unregistration_v2.html.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_pc_unregistration_v2 " 4 | sidebar_current: "docs-nutanix-resource-pc-unregistration-v2" 5 | description: |- 6 | Unregister a registered remote cluster from the local cluster 7 | --- 8 | 9 | # nutanix_pc_unregistration_v2 10 | 11 | Unregister a registered remote cluster from the local cluster. This process is asynchronous, creating an un-registration task and returning its UUID. 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | 17 | resource "nutanix_pc_unregistration_v2 " "unregister-pc"{ 18 | pc_ext_id = "75dde184-3a0e-4f59-a185-03ca1efead17" 19 | ext_id = "869aa8a5-5aeb-423f-829d-f932d2656b6c" 20 | } 21 | 22 | ``` 23 | 24 | ## Argument Reference 25 | 26 | The following arguments are supported: 27 | 28 | - `pc_ext_id`: -(Required) The external identifier of the domain manager (Prism Central) resource 29 | - `ext_id`: -(Required) Cluster UUID of a remote cluster. 30 | 31 | See detailed information in [Nutanix PC Unregistration V4](https://developers.nutanix.com/api-reference?namespace=prism&version=v4.0#tag/DomainManager/operation/unregister). 32 | -------------------------------------------------------------------------------- /website/docs/r/volume_group_vm_v2.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "nutanix" 3 | page_title: "NUTANIX: nutanix_volume_group_vm_v2" 4 | sidebar_current: "docs-nutanix-resource-volume-group-vm-attachments-v2" 5 | description: |- 6 | This operation submits a request to Attaches VM to a Volume Group identified by {extId}. 7 | --- 8 | 9 | # nutanix_volume_group_vm_v2 10 | 11 | Provides a resource to Create a new Volume Group. 12 | 13 | ## Example Usage 14 | 15 | ```hcl 16 | 17 | resource "nutanix_volume_group_vm_v2" "vg_vm_example"{ 18 | volume_group_ext_id = "1cdb5b48-fb2c-41b6-b751-b504117ee3e2" 19 | vm_ext_id = "8a938cc5-282b-48c4-81be-de22de145d07" 20 | } 21 | ``` 22 | 23 | ## Argument Reference 24 | The following arguments are supported: 25 | 26 | 27 | * `volume_group_ext_id`: -(Required) The external identifier of the volume group. 28 | * `vm_ext_id`: -(Required) A globally unique identifier of an instance that is suitable for external consumption. 29 | * `index`: -(Optional) The index on the SCSI bus to attach the VM to the Volume Group. 30 | 31 | 32 | See detailed information in [Nutanix Attach VM to Volume Group V4](https://developers.nutanix.com/api-reference?namespace=volumes&version=v4.0#tag/VolumeGroups/operation/attachVm). 33 | --------------------------------------------------------------------------------