-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,188 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
# Copyright (c) 2025 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_replication_rule data source" | ||
linkTitle: "powerstore_replication_rule" | ||
page_title: "powerstore_replication_rule Data Source - powerstore" | ||
subcategory: "" | ||
description: |- | ||
This datasource is used to query the existing replication rule from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block. | ||
--- | ||
|
||
# powerstore_replication_rule (Data Source) | ||
|
||
This datasource is used to query the existing replication rule from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block. | ||
> **Note:** Only one of `name` or `id` can be provided at a time. | ||
## Example Usage | ||
|
||
```terraform | ||
/* | ||
Copyright (c) 2025 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 apply --auto-approve | ||
# This datasource reads replication rules either by id or name where user can provide a value to any one of them | ||
# If it is a empty datsource block , then it will read all the replication rules | ||
# If id or name is provided then it reads a particular replication rule with that id or name | ||
# Only one of the attribute can be provided among id and name | ||
# Get replication rule details using name | ||
data "powerstore_replication_rule" "test" { | ||
depends_on = [powerstore_replication_rule.test] | ||
name = "terraform_replication_rule" | ||
} | ||
# Get replication rule details using ID | ||
data "powerstore_replication_rule" "test" { | ||
id = "2d0780e3-2ce7-4d8b-b2ec-349c5e9e26a9" | ||
} | ||
output "replicationRule" { | ||
value = data.powerstore_replication_rule.test.replication_rules | ||
} | ||
``` | ||
After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerstore_snapshotrule.test1.attribute_name` where attribute_name is the attribute which user wants to fetch. | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `id` (String) Unique identifier of the replication rule. Conflicts with `name`. | ||
- `name` (String) Name of the replication rule. Conflicts with `id`. | ||
|
||
### Read-Only | ||
|
||
- `replication_rules` (Attributes List) List of replication rules. (see [below for nested schema](#nestedatt--replication_rules)) | ||
|
||
<a id="nestedatt--replication_rules"></a> | ||
### Nested Schema for `replication_rules` | ||
|
||
Read-Only: | ||
|
||
- `alert_threshold` (Number) The alert threshold for the replication rule. | ||
- `id` (String) Unique identifier of the replication rule. | ||
- `is_read_only` (Boolean) Indicates whether the replication rule is read-only. | ||
- `is_replica` (Boolean) Indicates whether the replication rule is a replica. | ||
- `managed_by` (String) The entity that manages the replication rule. | ||
- `managed_by_id` (String) The ID of the managing entity. | ||
- `name` (String) Name of the replication rule. | ||
- `policies` (Attributes List) The protection policies associated with the replication rule. (see [below for nested schema](#nestedatt--replication_rules--policies)) | ||
- `remote_system` (Attributes) The remote system associated with the replication rule. (see [below for nested schema](#nestedatt--replication_rules--remote_system)) | ||
- `remote_system_id` (String) The ID of the remote system associated with the replication rule. | ||
- `replication_sessions` (Attributes List) The replication session associated with the replication rule. (see [below for nested schema](#nestedatt--replication_rules--replication_sessions)) | ||
- `rpo` (String) The RPO (Recovery Point Objective) of the replication rule. | ||
|
||
<a id="nestedatt--replication_rules--policies"></a> | ||
### Nested Schema for `replication_rules.policies` | ||
|
||
Read-Only: | ||
|
||
- `id` (String) The ID of the protection policy. | ||
- `name` (String) The name of the protection policy. | ||
|
||
|
||
<a id="nestedatt--replication_rules--remote_system"></a> | ||
### Nested Schema for `replication_rules.remote_system` | ||
|
||
Read-Only: | ||
|
||
- `id` (String) The ID of the remote system. | ||
- `name` (String) The name of the remote system. | ||
|
||
|
||
<a id="nestedatt--replication_rules--replication_sessions"></a> | ||
### Nested Schema for `replication_rules.replication_sessions` | ||
|
||
Read-Only: | ||
|
||
- `id` (String) The ID of the replication session. | ||
- `state` (String) The state of the replication session. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
--- | ||
# 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 resource" | ||
linkTitle: "powerstore_filesystem" | ||
page_title: "powerstore_filesystem Resource - powerstore" | ||
subcategory: "" | ||
description: |- | ||
This resource is used to manage the file system entity of PowerStore Array. We can Create, Update and Delete the file system using this resource. We can also import an existing file system from PowerStore array. | ||
--- | ||
|
||
# powerstore_filesystem (Resource) | ||
|
||
This resource is used to manage the file system entity of PowerStore Array. We can Create, Update and Delete the file system using this resource. We can also import an existing file system 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 and Import is supported for this resource | ||
resource "powerstore_filesystem" "test" { | ||
name = "test_fs" | ||
description = "testing file system" | ||
size = 3 | ||
nas_server_id = "654b2182-f674-f39a-66fc-52518d324736" | ||
flr_attributes = { | ||
mode = "Enterprise" | ||
minimum_retention = "1D" | ||
default_retention = "1D" | ||
maximum_retention = "infinite" | ||
} | ||
config_type = "General" | ||
access_policy = "UNIX" | ||
locking_policy = "Advisory" | ||
folder_rename_policy = "All_Allowed" | ||
is_smb_sync_writes_enabled = true | ||
is_smb_no_notify_enabled = true | ||
is_smb_op_locks_enabled = false | ||
is_smb_notify_on_access_enabled = true | ||
is_smb_notify_on_write_enabled = false | ||
smb_notify_on_change_dir_depth = 12 | ||
is_async_mtime_enabled = true | ||
file_events_publishing_mode = "All" | ||
} | ||
``` | ||
|
||
After the execution of above resource block replication rule would have been created on the PowerStore array. For more information, Please check the terraform state file. | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) Name of the file system. | ||
- `nas_server_id` (String) Unique identifier of the NAS Server on which the file system is mounted. | ||
- `size` (Number) Size that the file system presents to the host or end user. | ||
|
||
### Optional | ||
|
||
- `access_policy` (String) File system security access policies. | ||
- `capacity_unit` (String) The Capacity Unit corresponding to the size. | ||
- `config_type` (String) File system security access policies. | ||
- `description` (String) File system description. | ||
- `file_events_publishing_mode` (String) State of the event notification services for all file systems of the NAS server. | ||
- `flr_attributes` (Attributes) Type of filesystem: normal or snapshot. (see [below for nested schema](#nestedatt--flr_attributes)) | ||
- `folder_rename_policy` (String) File system folder rename policies for the file system with multiprotocol access enabled. | ||
- `host_io_size` (String) Typical size of writes from the server or other computer using the VMware file system to the storage system. | ||
- `is_async_mtime_enabled` (Boolean) Indicates whether asynchronous MTIME is enabled on the file system or protocol snaps that are mounted writeable. | ||
- `is_smb_no_notify_enabled` (Boolean) Indicates whether notifications of changes to directory file structure are enabled. | ||
- `is_smb_notify_on_access_enabled` (Boolean) Indicates whether file access notifications are enabled on the file system. | ||
- `is_smb_notify_on_write_enabled` (Boolean) Indicates whether file writes notifications are enabled on the file system. | ||
- `is_smb_op_locks_enabled` (Boolean) Indicates whether opportunistic file locking is enabled on the file system. | ||
- `is_smb_sync_writes_enabled` (Boolean) Indicates whether the synchronous writes option is enabled on the file system. | ||
- `locking_policy` (String) File system locking policies. | ||
- `protection_policy_id` (String) Unique identifier of the protection policy applied to the file system. | ||
- `smb_notify_on_change_dir_depth` (Number) Lowest directory level to which the enabled notifications apply, if any. | ||
|
||
### Read-Only | ||
|
||
- `file_system_type` (String) Type of filesystem: normal or snapshot. | ||
- `id` (String) Unique identifier of the file system. | ||
- `parent_id` (String) Unique identifier of the parent filesystem. | ||
|
||
<a id="nestedatt--flr_attributes"></a> | ||
### Nested Schema for `flr_attributes` | ||
|
||
Optional: | ||
|
||
- `default_retention` (String) The FLR type of the file system. | ||
- `maximum_retention` (String) The FLR type of the file system. | ||
- `minimum_retention` (String) The FLR type of the file system. | ||
- `mode` (String) The FLR type of the file system. | ||
|
||
## 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 file system : | ||
# Step 1 - To import a file system , we need the id of that file system | ||
# Step 2 - To check the id of the file system we can make use of file system datasource to read required/all file system ids. Alternatively, we can make GET request to file system endpoint. eg. https://10.0.0.1/api/rest/file_system which will return list of all file system ids. | ||
# Step 3 - Add empty resource block in tf file. | ||
# eg. | ||
# resource "powerstore_filesystem" "resource_block_name" { | ||
# (resource arguments) | ||
# } | ||
# Step 4 - Execute the command: terraform import "powerstore_filesystem.resource_block_name" "id_of_the_file_system" (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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
examples/data-sources/powerstore_replication_rule/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright (c) 2025 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 apply --auto-approve | ||
# This datasource reads replication rules either by id or name where user can provide a value to any one of them | ||
# If it is a empty datsource block , then it will read all the replication rules | ||
# If id or name is provided then it reads a particular replication rule with that id or name | ||
# Only one of the attribute can be provided among id and name | ||
|
||
# Get replication rule details using name | ||
data "powerstore_replication_rule" "test" { | ||
depends_on = [powerstore_replication_rule.test] | ||
name = "terraform_replication_rule" | ||
} | ||
|
||
# Get replication rule details using ID | ||
data "powerstore_replication_rule" "test" { | ||
id = "2d0780e3-2ce7-4d8b-b2ec-349c5e9e26a9" | ||
} | ||
|
||
output "replicationRule" { | ||
value = data.powerstore_replication_rule.test.replication_rules | ||
} |
33 changes: 33 additions & 0 deletions
33
examples/data-sources/powerstore_replication_rule/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Copyright (c) 2025 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 | ||
} |
Oops, something went wrong.