title | linkTitle | page_title | subcategory | description |
---|---|---|---|---|
powerflex_node data source |
powerflex_node |
powerflex_node Data Source - powerflex |
This datasource is used to query the existing nodes from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block. |
This datasource is used to query the existing nodes from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block.
/*
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 apply --auto-approve
# Get all node details present on the cluster
data "powerflex_node" "example1" {
}
# if a filter is of type string it has the ability to allow regular expressions
# data "powerflex_node" "node_filter_regex" {
# filter{
# name = ["^System_.*$"]
# manufacturer = ["^.*Corp.*$"]
# }
# }
# output "nodeFilterRegexResult"{
# value = data.powerflex_node.node_filter_regex.node_details
# }
// 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_node" "node" {
# filter{
# ref_id = ["id1", "id2"]
# state = ["READY"]
# ip_address = ["ip1", "ip2"]
# service_tag = ["serviceTag1", "serviceTag2"]
# current_ip_address = ["currentIp1", "currentIp2"]
# model = ["model1", "model2"]
# device_type = ["deviceType1", "deviceType2"]
# discover_device_type = ["discoverDeviceType1", "discoverDeviceType2"]
# display_name = ["displayName1", "displayName2"]
# managed_state = ["managedState1", "managedState2"]
# state = ["state1", "state2"]
# in_use = true
# custom_firmware = true
# needs_attention = true
# manufacturer = ["manufacturer1", "manufacturer2"]
# system_id = ["systemId1", "systemId2"]
# health = ["health1", "health2"]
# health_message = ["healthMessage1", "healthMessage2"]
# operating_system = ["operatingSystem1", "operatingSystem2"]
# number_of_cpus = [3, 2]
# nics = [3, 5]
# memory_in_gb = [3, 5]
# compliance_check_date = ["complianceCheckDate1", "complianceCheckDate2"]
# discovered_date = ["discoveredDate1", "discoveredDate2"]
# cred_id = ["credId1", "credId2"]
# compliance = ["compliance1", "compliance2"]
# puppet_cert_name = ["puppet_cert_name1","puppet_cert_name2"]
# failures_count = [3, 5]
# flex_os_maint_mode=[0]
# esxi_maint_mode=[0]
# }
}
output "node_result" {
value = data.powerflex_node.example1.node_details
}
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_node.datasource_block_name.attribute_name
where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch.
filter
(Block, Optional) (see below for nested schema)
id
(String) Placeholder attribute.node_details
(Attributes Set) Node details (see below for nested schema)
Optional:
compliance
(Set of String) List of compliancecompliance_check_date
(Set of String) List of compliance_check_datecred_id
(Set of String) List of cred_idcurrent_ip_address
(Set of String) List of current_ip_addresscustom_firmware
(Boolean) Value for custom_firmwaredevice_type
(Set of String) List of device_typediscover_device_type
(Set of String) List of discover_device_typediscovered_date
(Set of String) List of discovered_datedisplay_name
(Set of String) List of display_nameesxi_maint_mode
(Set of Number) List of esxi_maint_modefailures_count
(Set of Number) List of failures_countflex_os_maint_mode
(Set of Number) List of flex_os_maint_modehealth
(Set of String) List of healthhealth_message
(Set of String) List of health_messagein_use
(Boolean) Value for in_useip_address
(Set of String) List of ip_addressmanaged_state
(Set of String) List of managed_statemanufacturer
(Set of String) List of manufacturermemory_in_gb
(Set of Number) List of memory_in_gbmodel
(Set of String) List of modelneeds_attention
(Boolean) Value for needs_attentionnics
(Set of Number) List of nicsnumber_of_cpus
(Set of Number) List of number_of_cpusoperating_system
(Set of String) List of operating_systempuppet_cert_name
(Set of String) List of puppet_cert_nameref_id
(Set of String) List of ref_idservice_tag
(Set of String) List of service_tagstate
(Set of String) List of statesystem_id
(Set of String) List of system_id
Read-Only:
compliance
(String) Node compliance.compliance_check_date
(String) Compliance check date.cred_id
(String) Cred ID.current_ip_address
(String) Current IP address of the node.custom_firmware
(Boolean) Custom firmware of the node.device_group_list
(Attributes) Device group list. (see below for nested schema)device_type
(String) Device type of the node.discover_device_type
(String) Discover device type of the node.discovered_date
(String) Discovered date of the node.display_name
(String) Display name of the node.esxi_maint_mode
(Number) ESXi maintenance mode.facts
(String) Facts of the node.failures_count
(Number) Failures count.flex_os_maint_mode
(Number) FLEX OS maintenance mode.health
(String) Health of the node.health_message
(String) Health message.in_use
(Boolean) Flag specifying if node is in use.ip_address
(String) IP address of the node.managed_state
(String) Managed state of the node.manufacturer
(String) Manufacturer of the node.memory_in_gb
(Number) Memory in GB.model
(String) Model of the node.needs_attention
(Boolean) Flag specifying if node needs attention.nics
(Number) NICs of the node.number_of_cpus
(Number) Number of CPUs of the node.operating_system
(String) Operating system of the node.puppet_cert_name
(String) Puppet cert name of the node.ref_id
(String) Reference ID of the node.service_tag
(String) Service tag of the node.state
(String) State of the node.system_id
(String) System ID.
Read-Only:
device_group
(Attributes List) Device group information. (see below for nested schema)
Read-Only:
created_by
(String) User who created the group.created_date
(String) Creation date.group_description
(String) Group description.group_name
(String) Group name.group_seq_id
(Number) Group Sequence ID.group_user_list
(Attributes) Group user list. (see below for nested schema)updated_by
(String) User who updated the group.updated_date
(String) Updated date.
Read-Only:
group_users
(Attributes List) Group user information. (see below for nested schema)total_records
(Number) Total number of records.
Read-Only:
enabled
(Boolean) Enabled flag.first_name
(String) First name of the user.last_name
(String) Last name of the user.user_name
(String) User name.user_seq_id
(Number) User sequence ID.