Skip to content

Latest commit

 

History

History
237 lines (195 loc) · 9.67 KB

File metadata and controls

237 lines (195 loc) · 9.67 KB
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.

powerflex_node (Data Source)

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.

Example Usage

/*
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.

Schema

Optional

Read-Only

Nested Schema for filter

Optional:

  • compliance (Set of String) List of compliance
  • compliance_check_date (Set of String) List of compliance_check_date
  • cred_id (Set of String) List of cred_id
  • current_ip_address (Set of String) List of current_ip_address
  • custom_firmware (Boolean) Value for custom_firmware
  • device_type (Set of String) List of device_type
  • discover_device_type (Set of String) List of discover_device_type
  • discovered_date (Set of String) List of discovered_date
  • display_name (Set of String) List of display_name
  • esxi_maint_mode (Set of Number) List of esxi_maint_mode
  • failures_count (Set of Number) List of failures_count
  • flex_os_maint_mode (Set of Number) List of flex_os_maint_mode
  • health (Set of String) List of health
  • health_message (Set of String) List of health_message
  • in_use (Boolean) Value for in_use
  • ip_address (Set of String) List of ip_address
  • managed_state (Set of String) List of managed_state
  • manufacturer (Set of String) List of manufacturer
  • memory_in_gb (Set of Number) List of memory_in_gb
  • model (Set of String) List of model
  • needs_attention (Boolean) Value for needs_attention
  • nics (Set of Number) List of nics
  • number_of_cpus (Set of Number) List of number_of_cpus
  • operating_system (Set of String) List of operating_system
  • puppet_cert_name (Set of String) List of puppet_cert_name
  • ref_id (Set of String) List of ref_id
  • service_tag (Set of String) List of service_tag
  • state (Set of String) List of state
  • system_id (Set of String) List of system_id

Nested Schema for node_details

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.

Nested Schema for node_details.device_group_list

Read-Only:

Nested Schema for node_details.device_group_list.device_group

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.

Nested Schema for node_details.device_group_list.device_group.group_user_list

Read-Only:

  • group_users (Attributes List) Group user information. (see below for nested schema)
  • total_records (Number) Total number of records.

Nested Schema for node_details.device_group_list.device_group.group_user_list.group_users

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.