Retrieving a list of all servers
Uses this definition to retrieve a list of all servers that are managed by Lenovo XClarity Orchestrator.
Usage
data "lxco_server" "all" {}
output "all_servers" {
value = data.lxco_server.all
}
Example
The following example retrieves a list of all servers.
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}
provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}
# Fetch all server details
data "lxco_server" "all" {}
# Return details for all servers
output "all_servers" {
value = data.lxco_server.all
}
Inputs
None
Outputs
Name | Type | Description | ||
---|---|---|---|---|
servers | Array of objects | Information about each managed server | ||
domain_name | String | Domain name | ||
group_names | Array of strings | List of names of the groups to which the device belongs | ||
health_status | String | Health state of the device (translated). This can be one of the following values.
| ||
hostname | String | Hostname | ||
id | String | Device ID | ||
ipv4_addresses | Array of strings | List of IPv4 addresses | ||
ipv6_addresses | Array of strings | List of IPv6 addresses | ||
location | String | Location description | ||
location_lowest_rack_unit | String | Lowest rack unit | ||
location_rack | String | Rack name | ||
location_room | String | Room name | ||
machine_type | String | Device machine type | ||
manager_domain_name | String | Fully qualified domain name | ||
manager_hostname | String | Host name | ||
manager_ipv4_addresses | Array of strings | IPv4 addresses | ||
manager_ipv6_addresses | Array of strings | IPv6 addresses | ||
model | String | Device model | ||
power_status | String | Power status (translated). This can be one of the following values.
| ||
product_name | String | Device product name | ||
serial_number | String | Device serial number | ||
user_defined_name | String | User-defined name for the device | ||
uuid | String | Device UUID |
The following example is returned if the request is successful.
{
"servers": [{
"domain_name": "labs.lenovo.com",
"group_names": [],
"health_status": "Warning",
"hostname": "IMM2-3440b5e913f8",
"id": "FAAC1AC51EE411E3A8503440B5EAC7F0-23C87F0A2CB6491097489193447A655C",
"ipv4_addresses": ["10.243.10.193","169.254.95.118"],
"ipv6_addresses": ["2000:1013:0:0:0:0:217:105","fd55:faaf:e1ab:2021:3640:b5ff:fee9:13f8",
"fe80:0:0:0:3640:b5ff:fee9:13f8"],
"location": "Morrisville",
"location_lowest_rack_unit": 0,
"location_rack": "",
"location_room": "",
"machine_type": "7916",
"manager_domain_name": "labs.lenovo.com",
"manager_hostname": "xhmc194",
"manager_ipv4_addresses": ["10.243.2.107"],
"manager_ipv6_addresses": ["fd55:faaf:e1ab:2021:5054:ff:fec4:df97","fe80:0:0:0:5054:ff:fec4:df97"],
"model": "AC1",
"power_status": "On",
"product_name": "IBM Flex System x222 Lower Compute Node with embedded 10Gb Virtual Fabric",
"serial_number": "SLOT002",
"user_defined_name": "*node02_1",
"uuid": "FAAC1AC51EE411E3A8503440B5EAC7F0"
},
{
"domain_name": "labs.lenovo.com",
"group_names": [],
"health_status": "Warning",
"hostname": "IMM2-3440b5ee128c",
"id": "CB62A8381EEF11E387D53440B5EFC518-23C87F0A2CB6491097489193447A655C",
"ipv4_addresses": ["10.243.11.11","169.254.95.118"],
"ipv6_addresses": ["2000:1013:0:0:0:0:217:105","fd55:faaf:e1ab:2021:3640:b5ff:feee:128c",
"fe80:0:0:0:3640:b5ff:feee:128c"],
"location": "Morrisville",
"location_lowest_rack_unit": 0,
"location_rack": "",
"location_room": "",
"machine_type": "7916",
"manager_domain_name": "labs.lenovo.com",
"manager_hostname": "xhmc194",
"manager_ipv4_addresses": ["10.243.2.107"],
"manager_ipv6_addresses": ["fd55:faaf:e1ab:2021:5054:ff:fec4:df97","fe80:0:0:0:5054:ff:fec4:df97"],
"model": "99X",
"power_status": "On",
"product_name": "IBM Flex System x222 Upper Compute Node with embedded 10Gb Virtual Fabric",
"serial_number": "SLOT002",
"user_defined_name": "*node02_2",
"uuid": "CB62A8381EEF11E387D53440B5EFC518"
}]
}
Give documentation feedback