title | linkTitle | page_title | subcategory | description |
---|---|---|---|---|
powerflex_snapshot_policy data source |
powerflex_snapshot_policy |
powerflex_snapshot_policy Data Source - powerflex |
This datasource is used to query the existing snapshot policies from the PowerFlex array. The information fetched from this datasource can be used for getting the details. |
This datasource is used to query the existing snapshot policies from the PowerFlex array. The information fetched from this datasource can be used for getting the details.
Note: Only one of
name
andid
can be provided at a time.
/*
Copyright (c) 2023-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 apply --auto-approve
data "powerflex_snapshot_policy" "sp" {
}
# if a filter is of type string it has the ability to allow regular expressions
# data "powerflex_snapshot_policy" "snapshot_policy_filter_regex" {
# filter{
# name = ["^System_.*$"]
# system_id = ["^.*0f$"]
# }
# }
# output "snapshotPolicyFilterRegexResult"{
# value = data.powerflex_snapshot_policy.snapshot_policy_regex.sp
# }
// If multiple filter fields are provided then it will show the intersection of all of those fields.
// If there is no intersection between the filters then an empty datasource will be returned
// For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/
# data "powerflex_snapshot_policy" "sp2" {
# filter{
# id = ["896a535700000000"]
# name = ["snap-create-test"]
# snapshot_policy_state = ["enabled"]
# auto_snapshot_creation_cadence_in_min = [5]
# max_vtree_auto_snapshots = [2]
# system_id = ["1234567890abcdef"]
# num_of_source_volumes = [7]
# num_of_expired_but_locked_snapshots = [5]
# num_of_creation_failures = [3]
# num_of_retained_snapshots_per_level = [2]
# snapshot_access_mode = ["read_write"]
# secure_snapshots = true
# time_of_last_auto_snapshot = [5]
# time_of_last_auto_snapshot_creation_failure = [5]
# last_auto_snapshot_creation_failure_reason = ["reason_for_failure"]
# last_auto_snapshot_failure_in_first_level = true
# num_of_auto_snapshots = [5]
# num_of_locked_snapshots = [5]
# }
# }
output "spResult" {
value = data.powerflex_snapshot_policy.sp
}
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.powerflex_powerflex_snapshot_policy.sp.attribute_name
where attribute_name is the attribute which user wants to fetch.
filter
(Block, Optional) (see below for nested schema)
id
(String) Unique identifier of the snapshot policy instance to fetch. Conflicts withname
.snapshotpolicies
(Attributes List) List of snapshot policies. (see below for nested schema)
Optional:
auto_snapshot_creation_cadence_in_min
(Set of Number) List of auto_snapshot_creation_cadence_in_minid
(Set of String) List of idlast_auto_snapshot_creation_failure_reason
(Set of String) List of last_auto_snapshot_creation_failure_reasonlast_auto_snapshot_failure_in_first_level
(Boolean) Value for last_auto_snapshot_failure_in_first_levelmax_vtree_auto_snapshots
(Set of Number) List of max_vtree_auto_snapshotsname
(Set of String) List of namenext_auto_snapshot_creation_time
(Set of Number) List of next_auto_snapshot_creation_timenum_of_auto_snapshots
(Set of Number) List of num_of_auto_snapshotsnum_of_creation_failures
(Set of Number) List of num_of_creation_failuresnum_of_expired_but_locked_snapshots
(Set of Number) List of num_of_expired_but_locked_snapshotsnum_of_locked_snapshots
(Set of Number) List of num_of_locked_snapshotsnum_of_retained_snapshots_per_level
(Set of Number) List of num_of_retained_snapshots_per_levelnum_of_source_volumes
(Set of Number) List of num_of_source_volumessecure_snapshots
(Boolean) Value for secure_snapshotssnapshot_access_mode
(Set of String) List of snapshot_access_modesnapshot_policy_state
(Set of String) List of snapshot_policy_statesystem_id
(Set of String) List of system_idtime_of_last_auto_snapshot
(Set of Number) List of time_of_last_auto_snapshottime_of_last_auto_snapshot_creation_failure
(Set of Number) List of time_of_last_auto_snapshot_creation_failure
Read-Only:
auto_snapshot_creation_cadence_in_min
(Number) Auto snapshot creation cadence in min.id
(String) Unique identifier of the snapshot policy instance.last_auto_snapshot_creation_failure_reason
(String) Last auto snapshot creation failure reason.last_auto_snapshot_failure_in_first_level
(Boolean) Last auto snapshot failure in first level.links
(Attributes List) Specifies the links associated for a snapshot policy. (see below for nested schema)max_vtree_auto_snapshots
(Number) Max vtree auto snapshots.name
(String) Name of the snapshot policy.next_auto_snapshot_creation_time
(Number) Next auto snapshot creation time.num_of_auto_snapshots
(Number) Number of auto snapshots.num_of_creation_failures
(Number) Number of creation failures.num_of_expired_but_locked_snapshots
(Number) Number of expired but locked snapshots.num_of_locked_snapshots
(Number) Number of locked snapshots.num_of_retained_snapshots_per_level
(List of Number) Number of retained snapshots per level.num_of_source_volumes
(Number) Number of source Volumes.secure_snapshots
(Boolean) Secure snapshots.snapshot_access_mode
(String) Snapshot Access Mode.snapshot_policy_state
(String) Specifies the current state of the snapshot policy.system_id
(String) System Identifier.time_of_last_auto_snapshot
(Number) Time of last auto snapshot.time_of_last_auto_snapshot_creation_failure
(Number) Time of last auto snapshot creation failure.
Read-Only:
href
(String) Specifies the exact path to fetch the details.rel
(String) Specifies the relationship with the snapshot policy.