diff --git a/docs/data-sources/volumegroup_snapshot.md b/docs/data-sources/volumegroup_snapshot.md index ba8982c9..d84aadc7 100644 --- a/docs/data-sources/volumegroup_snapshot.md +++ b/docs/data-sources/volumegroup_snapshot.md @@ -55,7 +55,7 @@ limitations under the License. # Only one of the attribute can be provided among id and name data "powerstore_volumegroup_snapshot" "test1" { -# name = "test_volumegroup_snap" + # name = "test_volumegroup_snap" } output "volumeGroupSnapshotResult" { diff --git a/docs/resources/filesystem_snapshot.md b/docs/resources/filesystem_snapshot.md new file mode 100644 index 00000000..d2766fea --- /dev/null +++ b/docs/resources/filesystem_snapshot.md @@ -0,0 +1,119 @@ +--- +# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# Licensed under the Mozilla Public License Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://mozilla.org/MPL/2.0/ +# +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +title: "powerstore_filesystem_snapshot resource" +linkTitle: "powerstore_filesystem_snapshot" +page_title: "powerstore_filesystem_snapshot Resource - powerstore" +subcategory: "" +description: |- + This resource is used to manage the filesystem snapshot entity of PowerStore Array. We can Create, Update and Delete the filesystem snapshot using this resource. We can also import an existing filesystem snapshot from PowerStore array. +--- + +# powerstore_filesystem_snapshot (Resource) + +This resource is used to manage the filesystem snapshot entity of PowerStore Array. We can Create, Update and Delete the filesystem snapshot using this resource. We can also import an existing filesystem snapshot from PowerStore array. + +## Example Usage + +```terraform +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +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 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. +# During modify operation, to set infinite retention, expiration_timestamp can be set to blank(""). +# To check which attributes of the file system snapshot resource can be updated, please refer Product Guide in the documentation + +resource "powerstore_filesystem_snapshot" "test1" { + name = "tf_fs_snap" + description = "Test File System Snapshot Resource" + filesystem_id="67608dc7-b69c-b762-0522-42848bc63a0b" + expiration_timestamp="2035-05-06T09:01:47Z" + access_type = "Snapshot" +} +``` + +After the execution of above resource block, filesystem snapshot would have been created on the PowerStore array. For more information, Please check the terraform state file. + + +## Schema + +### Required + +- `filesystem_id` (String) ID of the filesystem to take snapshot. Cannot be updated. + +### Optional + +- `access_type` (String) Access type of the filesystem snapshot. Access type can be 'Snapshot' or 'Protocol'. Cannot be updated. +- `description` (String) Description of the filesystem snapshot. +- `expiration_timestamp` (String) Expiration Timestamp of the filesystem snapshot, if not provided there will no expiration for the snapshot.Only UTC (+Z) format is allowed eg: 2023-05-06T09:01:47Z +- `name` (String) Name of the filesystem snapshot.The default name of the filesystem snapshot is the date and time when the snapshot is taken. + +### Read-Only + +- `id` (String) The unique identifier of the filesystem snapshot. + +## Import + +Import is supported using the following syntax: + +```shell +#Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. +# +#Licensed under the Mozilla Public License Version 2.0 (the "License"); +#you may not use this file except in compliance with the License. +#You may obtain a copy of the License at +# +# http://mozilla.org/MPL/2.0/ +# +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#See the License for the specific language governing permissions and +#limitations under the License. + + +# 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/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" { + # (resource arguments) +# } +# Step 4 - Execute the command: terraform import "powerstore_filesystem_snapshot.resource_block_name" "id_of_the_snapshot" (resource_block_name must be taken from step 3 and id must be taken from step 2) +# Step 5 - After successful execution of the command , check the state file +``` diff --git a/docs/resources/host.md b/docs/resources/host.md index 457047c5..1b576ba7 100644 --- a/docs/resources/host.md +++ b/docs/resources/host.md @@ -66,7 +66,7 @@ resource "powerstore_host" "test" { os_type = "Linux" description = "Creating host" host_connectivity = "Local_Only" - initiators = [{ port_name = "iqn.1994-05.com.redhat:88cb605"}] + initiators = [{ port_name = "iqn.1994-05.com.redhat:88cb605" }] } ``` diff --git a/examples/data-sources/powerstore_hostgroup/provider.tf b/examples/data-sources/powerstore_hostgroup/provider.tf index 2f8bd6bf..decbeb7f 100644 --- a/examples/data-sources/powerstore_hostgroup/provider.tf +++ b/examples/data-sources/powerstore_hostgroup/provider.tf @@ -19,7 +19,7 @@ terraform { required_providers { powerstore = { version = "1.1.0" - source = "registry.terraform.io/dell/powerstore" + source = "registry.terraform.io/dell/powerstore" } } } diff --git a/examples/data-sources/powerstore_hostgroup/variables.tf b/examples/data-sources/powerstore_hostgroup/variables.tf index 9116df95..b079f08a 100644 --- a/examples/data-sources/powerstore_hostgroup/variables.tf +++ b/examples/data-sources/powerstore_hostgroup/variables.tf @@ -16,21 +16,21 @@ limitations under the License. */ variable "username" { - type=string + type = string description = "Stores the username of PowerStore host." } variable "password" { - type=string + type = string description = "Stores the password of PowerStore host." } variable "timeout" { - type=string + type = string description = "Stores the timeout of PowerStore host." } variable "endpoint" { - type=string + type = string description = "Stores the endpoint of PowerStore host. eg: https://10.1.1.1/api/rest" } \ No newline at end of file diff --git a/examples/data-sources/powerstore_volumegroup_snapshot/data-source.tf b/examples/data-sources/powerstore_volumegroup_snapshot/data-source.tf index 4895e7d8..41aebc38 100644 --- a/examples/data-sources/powerstore_volumegroup_snapshot/data-source.tf +++ b/examples/data-sources/powerstore_volumegroup_snapshot/data-source.tf @@ -22,7 +22,7 @@ limitations under the License. # Only one of the attribute can be provided among id and name data "powerstore_volumegroup_snapshot" "test1" { -# name = "test_volumegroup_snap" + # name = "test_volumegroup_snap" } output "volumeGroupSnapshotResult" { diff --git a/examples/resources/powerstore_filesystem_snapshot/import.sh b/examples/resources/powerstore_filesystem_snapshot/import.sh new file mode 100644 index 00000000..be4b7cbf --- /dev/null +++ b/examples/resources/powerstore_filesystem_snapshot/import.sh @@ -0,0 +1,26 @@ +#Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. +# +#Licensed under the Mozilla Public License Version 2.0 (the "License"); +#you may not use this file except in compliance with the License. +#You may obtain a copy of the License at +# +# http://mozilla.org/MPL/2.0/ +# +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#See the License for the specific language governing permissions and +#limitations under the License. + + +# 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/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" { + # (resource arguments) +# } +# Step 4 - Execute the command: terraform import "powerstore_filesystem_snapshot.resource_block_name" "id_of_the_snapshot" (resource_block_name must be taken from step 3 and id must be taken from step 2) +# Step 5 - After successful execution of the command , check the state file diff --git a/examples/resources/powerstore_filesystem_snapshot/provider.tf b/examples/resources/powerstore_filesystem_snapshot/provider.tf new file mode 100644 index 00000000..dde25fa9 --- /dev/null +++ b/examples/resources/powerstore_filesystem_snapshot/provider.tf @@ -0,0 +1,33 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +terraform { + required_providers { + powerstore = { + version = "1.2.0" + source = "registry.terraform.io/dell/powerstore" + } + } +} + +provider "powerstore" { + username = var.username + password = var.password + endpoint = var.endpoint + insecure = true + timeout = var.timeout +} \ No newline at end of file diff --git a/examples/resources/powerstore_filesystem_snapshot/resource.tf b/examples/resources/powerstore_filesystem_snapshot/resource.tf new file mode 100644 index 00000000..8db3e7c1 --- /dev/null +++ b/examples/resources/powerstore_filesystem_snapshot/resource.tf @@ -0,0 +1,34 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +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 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. +# During modify operation, to set infinite retention, expiration_timestamp can be set to blank(""). +# To check which attributes of the file system snapshot resource can be updated, please refer Product Guide in the documentation + +resource "powerstore_filesystem_snapshot" "test1" { + name = "tf_fs_snap" + description = "Test File System Snapshot Resource" + filesystem_id="67608dc7-b69c-b762-0522-42848bc63a0b" + expiration_timestamp="2035-05-06T09:01:47Z" + access_type = "Snapshot" +} \ No newline at end of file diff --git a/examples/resources/powerstore_filesystem_snapshot/variables.tf b/examples/resources/powerstore_filesystem_snapshot/variables.tf new file mode 100644 index 00000000..c57964ec --- /dev/null +++ b/examples/resources/powerstore_filesystem_snapshot/variables.tf @@ -0,0 +1,36 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +variable "username" { + type = string + description = "Stores the username of PowerStore host." +} + +variable "password" { + type = string + description = "Stores the password of PowerStore host." +} + +variable "timeout" { + type = string + description = "Stores the timeout of PowerStore host." +} + +variable "endpoint" { + type = string + description = "Stores the endpoint of PowerStore host. eg: https://10.1.1.1/api/rest/" +} diff --git a/examples/resources/powerstore_host/resource.tf b/examples/resources/powerstore_host/resource.tf index 9574638c..e4acd368 100644 --- a/examples/resources/powerstore_host/resource.tf +++ b/examples/resources/powerstore_host/resource.tf @@ -27,5 +27,5 @@ resource "powerstore_host" "test" { os_type = "Linux" description = "Creating host" host_connectivity = "Local_Only" - initiators = [{ port_name = "iqn.1994-05.com.redhat:88cb605"}] + initiators = [{ port_name = "iqn.1994-05.com.redhat:88cb605" }] } diff --git a/go.mod b/go.mod index b06fe715..e5764f1b 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,12 @@ 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.20241227083619-36c4ea66275f 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 github.com/hashicorp/terraform-plugin-go v0.25.0 + github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 github.com/stretchr/testify v1.10.0 ) @@ -50,7 +51,6 @@ require ( github.com/fatih/color v1.16.0 // indirect github.com/go-openapi/errors v0.22.0 // indirect github.com/go-openapi/strfmt v0.23.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect @@ -69,7 +69,6 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect github.com/hashicorp/terraform-json v0.23.0 // indirect - github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect diff --git a/go.sum b/go.sum index 44cf10db..37ba96ad 100644 --- a/go.sum +++ b/go.sum @@ -21,9 +21,6 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= @@ -40,12 +37,18 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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.15.1 h1:m7pxlXqakt6ILy1W35VzXobOsvPOWIOImdhHBa8R38E= -github.com/dell/gopowerstore v1.15.1/go.mod h1:6oAr11lwtpjmlE+s+pDKx7qfQ1HvLFWtlFoNdI03ByQ= -github.com/dell/gopowerstore v1.16.1-0.20241216050514-e3e9d2ae926b h1:9eu0Anc4u75qP3fGhmKAmtq2CVYCTeKMH/g+1djaQyU= -github.com/dell/gopowerstore v1.16.1-0.20241216050514-e3e9d2ae926b/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= 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/dell/gopowerstore v1.16.1-0.20241227064011-3c3808a39067 h1:FcRAYtZkdr+p2NQjngNlhZNiz2I50X9AgsxGCW0l6/4= +github.com/dell/gopowerstore v1.16.1-0.20241227064011-3c3808a39067/go.mod h1:RYodZ8GgJG5p85AviydL43Mt8ldcTqr5a+Cv+vqWacE= +github.com/dell/gopowerstore v1.16.1-0.20241227083619-36c4ea66275f h1:wr07YuRpeBb5sEgBahBGPWMZKomPC2TfbpBjMWMqwVE= +github.com/dell/gopowerstore v1.16.1-0.20241227083619-36c4ea66275f/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= @@ -59,18 +62,10 @@ github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+ github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE= -github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= -github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -80,9 +75,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -148,15 +141,14 @@ github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc= -github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk= +github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= +github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -183,14 +175,11 @@ github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= @@ -198,7 +187,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= @@ -222,13 +210,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -238,10 +223,6 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= @@ -253,14 +234,9 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6 github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= -go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM= go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= @@ -270,7 +246,6 @@ golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N0 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -280,13 +255,10 @@ golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -300,25 +272,20 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= @@ -338,7 +305,6 @@ google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFyt google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -347,6 +313,5 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/models/filesystem_snapshot.go b/models/filesystem_snapshot.go new file mode 100644 index 00000000..7ccc587e --- /dev/null +++ b/models/filesystem_snapshot.go @@ -0,0 +1,30 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package models + +import "github.com/hashicorp/terraform-plugin-framework/types" + +// FileSystemSnapshot - FileSystem Snapshot properties +type FileSystemSnapshot struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + ExpirationTimestamp types.String `tfsdk:"expiration_timestamp"` + FileSystemID types.String `tfsdk:"filesystem_id"` + AccessType types.String `tfsdk:"access_type"` +} diff --git a/powerstore/provider.go b/powerstore/provider.go index aa395473..d53b6299 100644 --- a/powerstore/provider.go +++ b/powerstore/provider.go @@ -148,6 +148,7 @@ func (p *Pstoreprovider) Resources(ctx context.Context) []func() resource.Resour newHostGroupResource, newVGSnapshotResource, newVolumeSnapshotResource, + newFileSystemSnapshotResource, newReplicationRuleResource, } } diff --git a/powerstore/provider_test.go b/powerstore/provider_test.go index 94c0cda1..fa0b44c6 100644 --- a/powerstore/provider_test.go +++ b/powerstore/provider_test.go @@ -54,6 +54,7 @@ var volumeGroupSnapshotName = setDefault(os.Getenv("VOLUME_GROUP_SNAPSHOT_NAME") var volumeGroupSnapshotID = setDefault(os.Getenv("VOLUME_GROUP_SNAPSHOT_ID"), "tfacc_volume_group_snapshot_id") var volumeSnapshotID = setDefault(os.Getenv("VOLUME_SNAPSHOT_ID"), "tfacc_volume_snapshot_id") var volumeSnapshotName = setDefault(os.Getenv("VOLUME_SNAPSHOT_NAME"), "tfacc_volume_snapshot_name") +var fileSystemID = setDefault(os.Getenv("FILESYSTEM_ID"), "tfacc_filesystem_id") var remoteSystemID = setDefault(os.Getenv("REMOTE_SYSTEM_ID"), "") var ProviderConfigForTesting = `` diff --git a/powerstore/resource_filesystem_snapshot.go b/powerstore/resource_filesystem_snapshot.go new file mode 100644 index 00000000..beee827e --- /dev/null +++ b/powerstore/resource_filesystem_snapshot.go @@ -0,0 +1,346 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package powerstore + +import ( + "context" + "fmt" + "log" + "regexp" + "terraform-provider-powerstore/client" + "terraform-provider-powerstore/models" + + "github.com/dell/gopowerstore" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// newFileSystemSnapshotResource returns snapshot new resource instance +func newFileSystemSnapshotResource() resource.Resource { + return &resourceFileSystemSnapshot{} +} + +type resourceFileSystemSnapshot struct { + client *client.Client +} + +// Metadata defines resource interface Metadata method +func (r *resourceFileSystemSnapshot) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_filesystem_snapshot" +} + +// Schema defines resource interface Schema method +func (r *resourceFileSystemSnapshot) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + + MarkdownDescription: "This resource is used to manage the filesystem snapshot entity of PowerStore Array. We can Create, Update and Delete the filesystem snapshot using this resource. We can also import an existing filesystem snapshot from PowerStore array.", + Description: "This resource is used to manage the filesystem snapshot entity of PowerStore Array. We can Create, Update and Delete the filesystem snapshot using this resource. We can also import an existing filesystem snapshot from PowerStore array.", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "The unique identifier of the filesystem snapshot.", + MarkdownDescription: "The unique identifier of the filesystem snapshot.", + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + Description: "Name of the filesystem snapshot.The default name of the filesystem snapshot is the date and time when the snapshot is taken.", + MarkdownDescription: "Name of the filesystem snapshot.The default name of the filesystem snapshot is the date and time when the snapshot is taken.", + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "filesystem_id": schema.StringAttribute{ + Required: true, + Description: "ID of the filesystem to take snapshot. Cannot be updated.", + MarkdownDescription: "ID of the filesystem to take snapshot. Cannot be updated.", + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + Description: "Description of the filesystem snapshot.", + MarkdownDescription: "Description of the filesystem snapshot.", + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "expiration_timestamp": schema.StringAttribute{ + Optional: true, + Computed: true, + Description: "Expiration Timestamp of the filesystem snapshot, if not provided there will no expiration for the snapshot.Only UTC (+Z) format is allowed eg: 2023-05-06T09:01:47Z", + MarkdownDescription: "Expiration Timestamp of the filesystem snapshot, if not provided there will no expiration for the snapshot.Only UTC (+Z) format is allowed eg: 2023-05-06T09:01:47Z", + Validators: []validator.String{ + stringvalidator.RegexMatches( + regexp.MustCompile(`(^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z)$|^$)`), + "Only UTC (+Z) format is allowed eg: 2023-05-06T09:01:47Z", + ), + }, + }, + "access_type": schema.StringAttribute{ + Optional: true, + Computed: true, + Description: "Access type of the filesystem snapshot. Access type can be 'Snapshot' or 'Protocol'.Cannot be updated.", + MarkdownDescription: "Access type of the filesystem snapshot. Access type can be 'Snapshot' or 'Protocol'. Cannot be updated.", + Validators: []validator.String{ + stringvalidator.OneOf("Snapshot", "Protocol"), + }, + Default: stringdefault.StaticString("Snapshot"), + }, + }, + } +} + +// Configure - defines configuration for filesystem snapshot resource +func (r *resourceFileSystemSnapshot) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*client.Client) + + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *http.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + r.client = client +} + +// Create - method to create filesystem snapshot resource +func (r *resourceFileSystemSnapshot) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + + var plan models.FileSystemSnapshot + + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + fileSystemID := plan.FileSystemID.ValueString() + + // Create new filesystem snapshot + snapCreate := &gopowerstore.SnapshotFSCreate{ + 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) + if err != nil { + resp.Diagnostics.AddError( + "Error creating filesystem snapshot", + "Could not create filesystem snapshot, unexpected error: "+err.Error(), + ) + return + } + // Get snapshot Details using ID retrieved above + snapshotResponse, err1 := r.client.PStoreClient.GetFS(context.Background(), snapCreateResponse.ID) + if err1 != nil { + resp.Diagnostics.AddError( + "Error getting filesystem snapshot after creation", + "Could not get filesystem snapshot, unexpected error: "+err1.Error(), + ) + return + } + + // Update details to state + result := models.FileSystemSnapshot{} + r.updateSnapshotState(&plan, &result, snapshotResponse) + + diags = resp.State.Set(ctx, result) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + log.Printf("Done with Create") +} + +// Read - reads filesystem snapshot resource information +func (r *resourceFileSystemSnapshot) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + + var state models.FileSystemSnapshot + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + snapshotID := state.ID.ValueString() + + // Get snapshot details from API and then update what is in state from what the API returns + snapshotResponse, err := r.client.PStoreClient.GetFS(context.Background(), snapshotID) + if err != nil { + resp.Diagnostics.AddError( + "Error reading snapshot", + "Could not read snapshotID with error "+snapshotID+": "+err.Error(), + ) + return + } + r.updateSnapshotState(nil, &state, snapshotResponse) + + // Set state + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + log.Printf("Done with Read") +} + +// Update - updates filesystem snapshot resource +func (r *resourceFileSystemSnapshot) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + log.Printf("Started Update") + + //Get plan values + var plan models.FileSystemSnapshot + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + //Get current state + var state models.FileSystemSnapshot + diags = req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Check not modifiable attributes + if !plan.Name.Equal(state.Name) || !plan.FileSystemID.Equal(state.FileSystemID) || !plan.AccessType.Equal(state.AccessType) { + resp.Diagnostics.AddError( + "Error updating filesystem snapshot resource", + "filesystem snapshot attributes [name, filesystem_id, access_type] are not modifiable", + ) + return + + } + + snapshotModify := r.planToServer(plan) + + //Get filesystem snapshot ID from state + filesystemSnapshotID := state.ID.ValueString() + + //Update filesystem snapshot by calling API + _, err := r.client.PStoreClient.ModifyFS(context.Background(), snapshotModify, filesystemSnapshotID) + if err != nil { + resp.Diagnostics.AddError( + "Error updating filesystem snapshot resource", + "Could not update filesystem snapshot "+filesystemSnapshotID+": "+err.Error(), + ) + return + } + + //Get filesystem Snapshot details + getRes, err := r.client.PStoreClient.GetFS(context.Background(), filesystemSnapshotID) + if err != nil { + resp.Diagnostics.AddError( + "Error getting snapshot resource after update", + "Could not get filesystem snapshot, unexpected error: "+err.Error(), + ) + return + } + + r.updateSnapshotState(&plan, &state, getRes) + + diags = resp.State.Set(ctx, state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + log.Printf("Successfully done with Update") +} + +// Delete - method to delete filesystem snapshot resource +func (r *resourceFileSystemSnapshot) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + log.Printf("Started with Delete") + + var state models.FileSystemSnapshot + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Get snapshot ID from state + snapshotID := state.ID.ValueString() + + // Delete snapshot by calling API + _, err := r.client.PStoreClient.DeleteFsSnapshot(context.Background(), snapshotID) + + if err != nil { + resp.Diagnostics.AddError( + "Error deleting snapshot", + "Could not delete snapshotID "+snapshotID+": "+err.Error(), + ) + return + } + + log.Printf("Done with Delete") +} + +// ImportState - imports state for existing snapshot +func (r *resourceFileSystemSnapshot) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// updateSnapshotState - method to update terraform state +func (r resourceFileSystemSnapshot) updateSnapshotState(_, state *models.FileSystemSnapshot, response gopowerstore.FileSystem) { + + expTime := response.ExpirationTimestamp + state.ID = types.StringValue(response.ID) + state.Name = types.StringValue(response.Name) + state.Description = types.StringValue(response.Description) + // if expiration timestamp is not present then set to null. + if expTime == "" { + state.ExpirationTimestamp = types.StringValue("") + } else { + state.ExpirationTimestamp = types.StringValue(expTime[:len(expTime)-6] + "Z") + } + state.AccessType = types.StringValue(response.AccessType) + state.FileSystemID = types.StringValue(response.ParentID) +} + +func (r resourceFileSystemSnapshot) planToServer(plan models.FileSystemSnapshot) *gopowerstore.FSModify { + description := plan.Description.ValueString() + expirationTimeStamp := plan.ExpirationTimestamp.ValueString() + volSnapshotUpdate := &gopowerstore.FSModify{ + Description: description, + ExpirationTimestamp: expirationTimeStamp, + } + return volSnapshotUpdate +} diff --git a/powerstore/resource_filesystem_snapshot_test.go b/powerstore/resource_filesystem_snapshot_test.go new file mode 100644 index 00000000..1ccca0d5 --- /dev/null +++ b/powerstore/resource_filesystem_snapshot_test.go @@ -0,0 +1,118 @@ +/* +Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. + +Licensed under the Mozilla Public License Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://mozilla.org/MPL/2.0/ + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package powerstore + +import ( + "os" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/stretchr/testify/assert" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// Test to Create Snapshot Resource +func TestAccFileSystemSnapshot(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + t.Skip("Dont run with units tests because it will try to create the context") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testProviderFactory, + Steps: []resource.TestStep{ + { + Config: ProviderConfigForTesting + FileSystemSnapParamsCreateInvalidFsID, + ExpectError: regexp.MustCompile("Error creating filesystem snapshot"), + }, + { + Config: ProviderConfigForTesting + FileSystemSnapParamsCreate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("powerstore_filesystem_snapshot.test", "name", "tf_fs_snap_acc"), + resource.TestCheckResourceAttr("powerstore_filesystem_snapshot.test", "description", "Test File System Snapshot Resource"), + ), + }, + // Import Testing + { + Config: ProviderConfigForTesting + FileSystemSnapParamsCreate, + ResourceName: "powerstore_filesystem_snapshot.test", + ImportState: true, + ExpectError: nil, + ImportStateCheck: func(s []*terraform.InstanceState) error { + assert.Equal(t, "tf_fs_snap_acc", s[0].Attributes["name"]) + return nil + }, + }, + // Import Negative Testing + { + Config: ProviderConfigForTesting + FileSystemSnapParamsCreate, + ResourceName: "powerstore_filesystem_snapshot.test", + ImportState: true, + ExpectError: regexp.MustCompile(ImportSnapshotDetailErrorMsg), + ImportStateId: "invalid-id", + }, + + { + Config: ProviderConfigForTesting + FileSystemSnapParamsUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("powerstore_filesystem_snapshot.test", "expiration_timestamp", "2035-10-06T09:01:47Z"), + resource.TestCheckResourceAttr("powerstore_filesystem_snapshot.test", "description", "Test File System Snapshot Resource Updated"), + ), + }, + { + Config: ProviderConfigForTesting + FileSystemSnapParamsUpdateError, + ExpectError: regexp.MustCompile("Error updating filesystem snapshot resource"), + }, + }, + }) +} + +var FileSystemSnapParamsCreateInvalidFsID = ` +resource "powerstore_filesystem_snapshot" "test" { + filesystem_id="invalid" +} +` + +var FileSystemSnapParamsCreate = ` +resource "powerstore_filesystem_snapshot" "test" { + name = "tf_fs_snap_acc" + description = "Test File System Snapshot Resource" + filesystem_id="` + fileSystemID + `" + expiration_timestamp="2035-05-06T09:01:47Z" + access_type = "Snapshot" +} +` +var FileSystemSnapParamsUpdate = ` +resource "powerstore_filesystem_snapshot" "test" { + name = "tf_fs_snap_acc" + description = "Test File System Snapshot Resource Updated" + filesystem_id="` + fileSystemID + `" + expiration_timestamp="2035-10-06T09:01:47Z" + access_type = "Snapshot" +} +` +var FileSystemSnapParamsUpdateError = ` +resource "powerstore_filesystem_snapshot" "test" { + name = "invalid" + description = "Test File System Snapshot Resource Updated" + filesystem_id="invalid" + expiration_timestamp="2035-10-06T09:01:47Z" +} +` diff --git a/templates/resources/filesystem_snapshot.md.tmpl b/templates/resources/filesystem_snapshot.md.tmpl new file mode 100644 index 00000000..ce82f347 --- /dev/null +++ b/templates/resources/filesystem_snapshot.md.tmpl @@ -0,0 +1,46 @@ +--- +# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# Licensed under the Mozilla Public License Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://mozilla.org/MPL/2.0/ +# +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +title: "{{.Name }} {{.Type | lower}}" +linkTitle: "{{.Name }}" +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name }} ({{.Type}}) + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} + +After the execution of above resource block, filesystem snapshot would have been created on the PowerStore array. For more information, Please check the terraform state file. +{{- end }} + +{{ .SchemaMarkdown | trimspace }} + +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile }} + +{{- end }}