Skip to content

Commit

Permalink
V4 data protection on v4-temp-design (#31)
Browse files Browse the repository at this point in the history
* Feat/v4 recovery points on v4-recovery-points (#26)

* add sdk, create client for Data Protection and add Recovery Point Api Client

* implement get recovery point data source

* implement list recovery points data source

* implement CRUD recovery points resource, update api is not supported for RP

* implement implement recovery points resource acc tests, in progress

* recovery points datasource acc tests.

* recovery points examples

* recovery points docs

* create Vg within RP test cases

* fix provider version on examples

* add test config on test_config_v2.json file

* fix acc test when create vg, remove unnecessary filepath parameter, remove vm uuid from test_config_v2.json file

* Feat/v4 replicate recovery points on v4 recovery points (#27)

* add sdk, create client for Data Protection and add Recovery Point Api Client

* implement get recovery point data source

* implement list recovery points data source

* implement CRUD recovery points resource, update api is not supported for RP

* implement implement recovery points resource acc tests, in progress

* recovery points datasource acc tests.

* recovery points examples

* recovery points docs

* create Vg within RP test cases

* fix provider version on examples

* implement recovery point replicate in progress

* implementation of recovery point replication

* add test config on test_config_v2.json file

* fix acc test when create vg, remove unnecessary filepath parameter, remove vm uuid from test_config_v2.json file

* implement acc test for recovery point replication

* add examples for recovery point replication

* add docs for recovery point replication

* add replicated_rp_ext_id attribute to store the replicated recovery point uuid

* Feat/v4 recovery points on v4 data protection (#28)

* add sdk, create client for Data Protection and add Recovery Point Api Client

* implement get recovery point data source

* implement list recovery points data source

* implement CRUD recovery points resource, update api is not supported for RP

* implement implement recovery points resource acc tests, in progress

* recovery points datasource acc tests.

* recovery points examples

* recovery points docs

* create Vg within RP test cases

* fix provider version on examples

* add test config on test_config_v2.json file

* fix acc test when create vg, remove unnecessary filepath parameter, remove vm uuid from test_config_v2.json file

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix comments on the added DiffSub function

* Feat/v4 recovery point restore on v4-data-protection (#29)

* add sdk, create client for Data Protection and add Recovery Point Api Client

* implement get recovery point data source

* implement list recovery points data source

* implement CRUD recovery points resource, update api is not supported for RP

* implement implement recovery points resource acc tests, in progress

* recovery points datasource acc tests.

* recovery points examples

* recovery points docs

* create Vg within RP test cases

* fix provider version on examples

* add test config on test_config_v2.json file

* fix acc test when create vg, remove unnecessary filepath parameter, remove vm uuid from test_config_v2.json file

* implement recovery point restore resource

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix comments on the added DiffSub function

* remove commented code

* acc tests for recovery point restore

* examples for recovery point restore

* examples for recovery point restore

* docs for recovery point restore

* Feat/v4 vm recovery point info  (#30)

* add sdk, create client for Data Protection and add Recovery Point Api Client

* implement get recovery point data source

* implement list recovery points data source

* implement CRUD recovery points resource, update api is not supported for RP

* implement implement recovery points resource acc tests, in progress

* recovery points datasource acc tests.

* recovery points examples

* recovery points docs

* create Vg within RP test cases

* fix provider version on examples

* add test config on test_config_v2.json file

* fix acc test when create vg, remove unnecessary filepath parameter, remove vm uuid from test_config_v2.json file

* implement recovery point restore resource

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix terraform plan for recovery point, there is no update in the resource just changing in the order of vm_recovery_points and volume_group_recovery_points array

* fix comments on the added DiffSub function

* remove commented code

* acc tests for recovery point restore

* examples for recovery point restore

* examples for recovery point restore

* docs for recovery point restore

* implement vm recovery point info

* Acc tests for vm recovery point info

* examples for vm recovery point info

* docs for vm recovery point info

* fix links schema
  • Loading branch information
Haroon-Dweikat-Ntx authored Oct 7, 2024
1 parent 581dcf0 commit feff396
Show file tree
Hide file tree
Showing 37 changed files with 3,796 additions and 63 deletions.
37 changes: 37 additions & 0 deletions examples/recovery_point_replicat_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
terraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "2.0"
}
}
}

#definig nutanix configuration
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


# create RP with Vm Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "APPLICATION_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
}

# replicate RP
resource "nutanix_recovery_point_replicate_v2" "test" {
ext_id = nutanix_recovery_points_v2.rp-example.id
cluster_ext_id = "<cluster-uuid>"
pc_ext_id = "<pc-uuid>"
depends_on = [nutanix_recovery_points_v2.test]
}
5 changes: 5 additions & 0 deletions examples/recovery_point_replicat_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440
13 changes: 13 additions & 0 deletions examples/recovery_point_replicat_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
63 changes: 63 additions & 0 deletions examples/recovery_point_restore_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
terraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "2.0"
}
}
}

#definig nutanix configuration
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


# create RP with multiple VG and Vms Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "CRASH_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
vm_recovery_points {
vm_ext_id = "<Vm-uuid-2>"
}
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-1>"
}
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-2>"
}
}

# restore RP
resource "nutanix_recovery_point_restore_v2" "rp-restore-example" {
ext_id = nutanix_recovery_points_v2.rp-example.id
cluster_ext_id = "<cluster-uuid>"
vm_recovery_point_restore_overrides {
vm_recovery_point_ext_id = nutanix_recovery_points_v2.rp-example.vm_recovery_points[0].ext_id
}
vm_recovery_point_restore_overrides {
vm_recovery_point_ext_id = nutanix_recovery_points_v2.rp-example.vm_recovery_points[1].ext_id
}
volume_group_recovery_point_restore_overrides {
volume_group_recovery_point_ext_id = nutanix_recovery_points_v2.rp-example.volume_group_recovery_points[0].ext_id
volume_group_override_spec {
name = "vg-1-rp-example-restore"
}
}
volume_group_recovery_point_restore_overrides {
volume_group_recovery_point_ext_id = nutanix_recovery_points_v2.rp-example.volume_group_recovery_points[1].ext_id
volume_group_override_spec {
name = "vg-2-rp-example-restore"
}
}
depends_on = [nutanix_recovery_points_v2.test]
}
5 changes: 5 additions & 0 deletions examples/recovery_point_restore_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440
13 changes: 13 additions & 0 deletions examples/recovery_point_restore_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
107 changes: 107 additions & 0 deletions examples/recovery_point_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
terraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "2.0"
}
}
}

#definig nutanix configuration
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


# create RP with Vm Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "APPLICATION_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
}

# create RP with multiple Vm Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "CRASH_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
vm_recovery_points {
vm_ext_id = "<Vm-uuid-2>"
}
}

# create RP with VG Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "CRASH_CONSISTENT"
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-1>"
}
}

# create RP with multiple VG Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "CRASH_CONSISTENT"
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-1>"
}
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-2>"
}
}


# create RP with multiple VG and Vms Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "CRASH_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
vm_recovery_points {
vm_ext_id = "<Vm-uuid-2>"
}
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-1>"
}
volume_group_recovery_points {
volume_group_ext_id = "<VG-uuid-2>"
}
}

# get RP data
data "nutanix_recovery_point_v2" "rp-example" {
ext_id = nutanix_recovery_points_v2.rp-example.id
}

# list all RP
data "nutanix_recovery_points_v2" "rp-example" {}

# list all RP with filter
data "nutanix_recovery_points_v2" "rp-example" {
filter = "name eq 'terraform-test-recovery-point'"
}

# list all RP with limit
data "nutanix_recovery_points_v2" "rp-example" {
limit = 10
}
5 changes: 5 additions & 0 deletions examples/recovery_point_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440
13 changes: 13 additions & 0 deletions examples/recovery_point_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
37 changes: 37 additions & 0 deletions examples/vm_recovery_point_info_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
terraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "2.0"
}
}
}

#definig nutanix configuration
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


# create RP with Vm Rp
resource "nutanix_recovery_points_v2" "rp-example" {
name = "terraform-test-recovery-point"
expiration_time = "2024-09-17T09:20:42Z"
status = "COMPLETE"
recovery_point_type = "APPLICATION_CONSISTENT"
vm_recovery_points {
vm_ext_id = "<Vm-uuid-1>"
}
}


# get VM recovery point info
data "nutanix_vm_recovery_point_info_v2" "example" {
recovery_point_ext_id = nutanix_recovery_points_v2.rp-example.ext_id
ext_id = nutanix_recovery_points_v2.rp-example.vm_recovery_points[0].ext_id
depends_on = [nutanix_recovery_points_v2.rp-example]
}
5 changes: 5 additions & 0 deletions examples/vm_recovery_point_info_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440
13 changes: 13 additions & 0 deletions examples/vm_recovery_point_info_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ require (
github.com/client9/misspell v0.3.4
github.com/golangci/golangci-lint v1.25.0
github.com/hashicorp/go-uuid v1.0.2
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
github.com/mitchellh/gox v1.0.1
github.com/nutanix-core/ntnx-api-golang-sdk-internal/clustermgmt-go-client/v16 v16.9.0-8538
github.com/nutanix-core/ntnx-api-golang-sdk-internal/dataprotection-go-client/v16 v16.9.0-8882
github.com/nutanix-core/ntnx-api-golang-sdk-internal/iam-go-client/v16 v16.8.0-5280
github.com/nutanix-core/ntnx-api-golang-sdk-internal/microseg-go-client/v16 v16.9.0-8831
github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16 v16.9.0-8856
Expand Down
Loading

0 comments on commit feff396

Please sign in to comment.