Skip to content

Commit

Permalink
address the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishnan-Priyanshu committed Dec 26, 2024
1 parent f3af2e8 commit bbb38eb
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/resources/filesystem_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 4 additions & 8 deletions powerstore/resource_filesystem_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbb38eb

Please sign in to comment.