diff --git a/docs/resources/filesystem_snapshot.md b/docs/resources/filesystem_snapshot.md index 372b507b..d2766fea 100644 --- a/docs/resources/filesystem_snapshot.md +++ b/docs/resources/filesystem_snapshot.md @@ -49,7 +49,7 @@ limitations under the License. # Commands to run this tf file : terraform init && terraform plan && terraform apply # Create, Update, Delete is supported for this resource # To import , check powerstore_filesystem_snapshot/import.tf for more info -# filesystem_id is the required attribute to create volume snapshot. +# filesystem_id is the required attribute to create file system snapshot. # name, expiration_timestamp, access_type and description are the optional attributes # if name is present in the config it cannot be blank(""). # During create operation, if expiration_timestamp is not specified or set to blank(""), snapshot will be created with infinite retention. @@ -108,7 +108,7 @@ Import is supported using the following syntax: # Below are the steps to import snapshot : # Step 1 - To import a filesystem snapshot , we need the id of that filesystem snapshot -# Step 2 - To check the id of the filesystem snapshot we can make Get request to filesystem snapshot endpoint. eg. https://10.0.0.1/api/rest/filesystem and 'filesystem_type: Snapshot' which will return list of all filesystem snapshots ids. +# Step 2 - To check the id of the filesystem snapshot we can make Get request to filesystem snapshot endpoint. eg. https://10.0.0.1/api/rest/file_system and 'filesystem_type: Snapshot' which will return list of all filesystem snapshots ids. # Step 3 - Add empty resource block in tf file. # eg. # resource "powerstore_filesystem_snapshot" "resource_block_name" { diff --git a/examples/resources/powerstore_filesystem_snapshot/import.sh b/examples/resources/powerstore_filesystem_snapshot/import.sh index 9dc5f1d4..be4b7cbf 100644 --- a/examples/resources/powerstore_filesystem_snapshot/import.sh +++ b/examples/resources/powerstore_filesystem_snapshot/import.sh @@ -16,7 +16,7 @@ # Below are the steps to import snapshot : # Step 1 - To import a filesystem snapshot , we need the id of that filesystem snapshot -# Step 2 - To check the id of the filesystem snapshot we can make Get request to filesystem snapshot endpoint. eg. https://10.0.0.1/api/rest/filesystem and 'filesystem_type: Snapshot' which will return list of all filesystem snapshots ids. +# Step 2 - To check the id of the filesystem snapshot we can make Get request to filesystem snapshot endpoint. eg. https://10.0.0.1/api/rest/file_system and 'filesystem_type: Snapshot' which will return list of all filesystem snapshots ids. # Step 3 - Add empty resource block in tf file. # eg. # resource "powerstore_filesystem_snapshot" "resource_block_name" { diff --git a/examples/resources/powerstore_filesystem_snapshot/provider.tf b/examples/resources/powerstore_filesystem_snapshot/provider.tf index d00ded0a..dde25fa9 100644 --- a/examples/resources/powerstore_filesystem_snapshot/provider.tf +++ b/examples/resources/powerstore_filesystem_snapshot/provider.tf @@ -18,7 +18,7 @@ limitations under the License. terraform { required_providers { powerstore = { - version = "1.1.0" + version = "1.2.0" source = "registry.terraform.io/dell/powerstore" } } diff --git a/examples/resources/powerstore_filesystem_snapshot/resource.tf b/examples/resources/powerstore_filesystem_snapshot/resource.tf index c62e5e2a..8db3e7c1 100644 --- a/examples/resources/powerstore_filesystem_snapshot/resource.tf +++ b/examples/resources/powerstore_filesystem_snapshot/resource.tf @@ -18,7 +18,7 @@ limitations under the License. # Commands to run this tf file : terraform init && terraform plan && terraform apply # Create, Update, Delete is supported for this resource # To import , check powerstore_filesystem_snapshot/import.tf for more info -# filesystem_id is the required attribute to create volume snapshot. +# filesystem_id is the required attribute to create file system snapshot. # name, expiration_timestamp, access_type and description are the optional attributes # if name is present in the config it cannot be blank(""). # During create operation, if expiration_timestamp is not specified or set to blank(""), snapshot will be created with infinite retention. diff --git a/go.mod b/go.mod index ffbee1e0..4a00798c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23 toolchain go1.23.2 require ( - github.com/dell/gopowerstore v1.16.1-0.20241218051810-2f3352b68230 + github.com/dell/gopowerstore v1.16.1-0.20241226120050-f4c219edd2e1 github.com/hashicorp/terraform-plugin-docs v0.20.1 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 diff --git a/go.sum b/go.sum index 7ec9dbe9..6f41dc55 100644 --- a/go.sum +++ b/go.sum @@ -39,6 +39,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dell/gopowerstore v1.16.1-0.20241218051810-2f3352b68230 h1:T/pCaREYwYdmpL9ElM+8IeiT8F1GiZwOLDoRVGqgP3s= github.com/dell/gopowerstore v1.16.1-0.20241218051810-2f3352b68230/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= +github.com/dell/gopowerstore v1.16.1-0.20241224121918-f1dfbb3bd1da h1:xiNLqNC3IeX2QbAlNKKN57PMJzANMx0/FLXI2+h6lhA= +github.com/dell/gopowerstore v1.16.1-0.20241224121918-f1dfbb3bd1da/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= +github.com/dell/gopowerstore v1.16.1-0.20241226114322-4a6a9478d375 h1:7jFPZEjy3UtYXGTYxoFp6TZe01469CqRkfBOZdPkjxc= +github.com/dell/gopowerstore v1.16.1-0.20241226114322-4a6a9478d375/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= +github.com/dell/gopowerstore v1.16.1-0.20241226120050-f4c219edd2e1 h1:2y13ugJIpIRJx9mAn963ZRh1EK8am95VgRKiUNcpMRs= +github.com/dell/gopowerstore v1.16.1-0.20241226120050-f4c219edd2e1/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= diff --git a/powerstore/resource_filesystem_snapshot.go b/powerstore/resource_filesystem_snapshot.go index 1498e588..beee827e 100644 --- a/powerstore/resource_filesystem_snapshot.go +++ b/powerstore/resource_filesystem_snapshot.go @@ -147,17 +147,13 @@ func (r *resourceFileSystemSnapshot) Create(ctx context.Context, req resource.Cr } fileSystemID := plan.FileSystemID.ValueString() - name := plan.Name.ValueString() - description := plan.Description.ValueString() - expirationTimestamp := plan.ExpirationTimestamp.ValueString() - accessType := plan.AccessType.ValueString() // Create new filesystem snapshot snapCreate := &gopowerstore.SnapshotFSCreate{ - Name: name, - Description: description, - ExpirationTimestamp: expirationTimestamp, - AccessType: accessType, + Name: plan.Name.ValueString(), + Description: plan.Description.ValueString(), + ExpirationTimestamp: plan.ExpirationTimestamp.ValueString(), + AccessType: plan.AccessType.ValueString(), } snapCreateResponse, err := r.client.PStoreClient.CreateFsSnapshot(context.Background(), snapCreate, fileSystemID)