1. Packages
  2. Datadog Provider
  3. API Docs
  4. getHosts
Datadog v4.47.0 published on Thursday, Mar 20, 2025 by Pulumi

datadog.getHosts

Explore with Pulumi AI

Datadog v4.47.0 published on Thursday, Mar 20, 2025 by Pulumi

Use this data source to retrieve information about your live hosts in Datadog.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.DatadogFunctions;
import com.pulumi.datadog.inputs.GetHostsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var foo = DatadogFunctions.getHosts(GetHostsArgs.builder()
            .includeMutedHostsData(true)
            .includeHostsMetadata(true)
            .build());

    }
}
Copy
variables:
  foo:
    fn::invoke:
      function: datadog:getHosts
      arguments:
        includeMutedHostsData: true
        includeHostsMetadata: true
Copy

Using getHosts

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getHosts(args: GetHostsArgs, opts?: InvokeOptions): Promise<GetHostsResult>
function getHostsOutput(args: GetHostsOutputArgs, opts?: InvokeOptions): Output<GetHostsResult>
Copy
def get_hosts(filter: Optional[str] = None,
              from_: Optional[int] = None,
              include_muted_hosts_data: Optional[bool] = None,
              sort_dir: Optional[str] = None,
              sort_field: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetHostsResult
def get_hosts_output(filter: Optional[pulumi.Input[str]] = None,
              from_: Optional[pulumi.Input[int]] = None,
              include_muted_hosts_data: Optional[pulumi.Input[bool]] = None,
              sort_dir: Optional[pulumi.Input[str]] = None,
              sort_field: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetHostsResult]
Copy
func GetHosts(ctx *Context, args *GetHostsArgs, opts ...InvokeOption) (*GetHostsResult, error)
func GetHostsOutput(ctx *Context, args *GetHostsOutputArgs, opts ...InvokeOption) GetHostsResultOutput
Copy

> Note: This function is named GetHosts in the Go SDK.

public static class GetHosts 
{
    public static Task<GetHostsResult> InvokeAsync(GetHostsArgs args, InvokeOptions? opts = null)
    public static Output<GetHostsResult> Invoke(GetHostsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
public static Output<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: datadog:index/getHosts:getHosts
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filter string
String to filter search results.
From int
Number of seconds since UNIX epoch from which you want to search your hosts.
IncludeMutedHostsData bool
Include information on the muted status of hosts and when the mute expires.
SortDir string
Direction of sort.
SortField string
Sort hosts by this field.
Filter string
String to filter search results.
From int
Number of seconds since UNIX epoch from which you want to search your hosts.
IncludeMutedHostsData bool
Include information on the muted status of hosts and when the mute expires.
SortDir string
Direction of sort.
SortField string
Sort hosts by this field.
filter String
String to filter search results.
from Integer
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData Boolean
Include information on the muted status of hosts and when the mute expires.
sortDir String
Direction of sort.
sortField String
Sort hosts by this field.
filter string
String to filter search results.
from number
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData boolean
Include information on the muted status of hosts and when the mute expires.
sortDir string
Direction of sort.
sortField string
Sort hosts by this field.
filter str
String to filter search results.
from_ int
Number of seconds since UNIX epoch from which you want to search your hosts.
include_muted_hosts_data bool
Include information on the muted status of hosts and when the mute expires.
sort_dir str
Direction of sort.
sort_field str
Sort hosts by this field.
filter String
String to filter search results.
from Number
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData Boolean
Include information on the muted status of hosts and when the mute expires.
sortDir String
Direction of sort.
sortField String
Sort hosts by this field.

getHosts Result

The following output properties are available:

HostLists List<GetHostsHostList>
List of hosts (1000 Max).
Id string
The ID of this resource.
TotalMatching int
Number of host matching the query.
TotalReturned int
Number of host returned.
Filter string
String to filter search results.
From int
Number of seconds since UNIX epoch from which you want to search your hosts.
IncludeMutedHostsData bool
Include information on the muted status of hosts and when the mute expires.
SortDir string
Direction of sort.
SortField string
Sort hosts by this field.
HostLists []GetHostsHostList
List of hosts (1000 Max).
Id string
The ID of this resource.
TotalMatching int
Number of host matching the query.
TotalReturned int
Number of host returned.
Filter string
String to filter search results.
From int
Number of seconds since UNIX epoch from which you want to search your hosts.
IncludeMutedHostsData bool
Include information on the muted status of hosts and when the mute expires.
SortDir string
Direction of sort.
SortField string
Sort hosts by this field.
hostLists List<GetHostsHostList>
List of hosts (1000 Max).
id String
The ID of this resource.
totalMatching Integer
Number of host matching the query.
totalReturned Integer
Number of host returned.
filter String
String to filter search results.
from Integer
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData Boolean
Include information on the muted status of hosts and when the mute expires.
sortDir String
Direction of sort.
sortField String
Sort hosts by this field.
hostLists GetHostsHostList[]
List of hosts (1000 Max).
id string
The ID of this resource.
totalMatching number
Number of host matching the query.
totalReturned number
Number of host returned.
filter string
String to filter search results.
from number
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData boolean
Include information on the muted status of hosts and when the mute expires.
sortDir string
Direction of sort.
sortField string
Sort hosts by this field.
host_lists Sequence[GetHostsHostList]
List of hosts (1000 Max).
id str
The ID of this resource.
total_matching int
Number of host matching the query.
total_returned int
Number of host returned.
filter str
String to filter search results.
from_ int
Number of seconds since UNIX epoch from which you want to search your hosts.
include_muted_hosts_data bool
Include information on the muted status of hosts and when the mute expires.
sort_dir str
Direction of sort.
sort_field str
Sort hosts by this field.
hostLists List<Property Map>
List of hosts (1000 Max).
id String
The ID of this resource.
totalMatching Number
Number of host matching the query.
totalReturned Number
Number of host returned.
filter String
String to filter search results.
from Number
Number of seconds since UNIX epoch from which you want to search your hosts.
includeMutedHostsData Boolean
Include information on the muted status of hosts and when the mute expires.
sortDir String
Direction of sort.
sortField String
Sort hosts by this field.

Supporting Types

GetHostsHostList

Aliases This property is required. List<string>
Apps This property is required. List<string>
AwsName This property is required. string
HostName This property is required. string
Id This property is required. int
IsMuted This property is required. bool
LastReportedTime This property is required. int
Meta This property is required. GetHostsHostListMeta
Metrics This property is required. GetHostsHostListMetrics
MuteTimeout This property is required. int
Name This property is required. string
Sources This property is required. List<string>
TagsBySource This property is required. Dictionary<string, ImmutableArray<string>>
Up This property is required. bool
Aliases This property is required. []string
Apps This property is required. []string
AwsName This property is required. string
HostName This property is required. string
Id This property is required. int
IsMuted This property is required. bool
LastReportedTime This property is required. int
Meta This property is required. GetHostsHostListMeta
Metrics This property is required. GetHostsHostListMetrics
MuteTimeout This property is required. int
Name This property is required. string
Sources This property is required. []string
TagsBySource This property is required. map[string][]string
Up This property is required. bool
aliases This property is required. List<String>
apps This property is required. List<String>
awsName This property is required. String
hostName This property is required. String
id This property is required. Integer
isMuted This property is required. Boolean
lastReportedTime This property is required. Integer
meta This property is required. GetHostsHostListMeta
metrics This property is required. GetHostsHostListMetrics
muteTimeout This property is required. Integer
name This property is required. String
sources This property is required. List<String>
tagsBySource This property is required. Map<String,List<String>>
up This property is required. Boolean
aliases This property is required. string[]
apps This property is required. string[]
awsName This property is required. string
hostName This property is required. string
id This property is required. number
isMuted This property is required. boolean
lastReportedTime This property is required. number
meta This property is required. GetHostsHostListMeta
metrics This property is required. GetHostsHostListMetrics
muteTimeout This property is required. number
name This property is required. string
sources This property is required. string[]
tagsBySource This property is required. {[key: string]: string[]}
up This property is required. boolean
aliases This property is required. Sequence[str]
apps This property is required. Sequence[str]
aws_name This property is required. str
host_name This property is required. str
id This property is required. int
is_muted This property is required. bool
last_reported_time This property is required. int
meta This property is required. GetHostsHostListMeta
metrics This property is required. GetHostsHostListMetrics
mute_timeout This property is required. int
name This property is required. str
sources This property is required. Sequence[str]
tags_by_source This property is required. Mapping[str, Sequence[str]]
up This property is required. bool
aliases This property is required. List<String>
apps This property is required. List<String>
awsName This property is required. String
hostName This property is required. String
id This property is required. Number
isMuted This property is required. Boolean
lastReportedTime This property is required. Number
meta This property is required. Property Map
metrics This property is required. Property Map
muteTimeout This property is required. Number
name This property is required. String
sources This property is required. List<String>
tagsBySource This property is required. Map<List<String>>
up This property is required. Boolean

GetHostsHostListMeta

AgentVersion This property is required. string
CpuCores This property is required. int
Gohai This property is required. string
Machine This property is required. string
Platform This property is required. string
Processor This property is required. string
PythonVersion This property is required. string
SocketFqdn This property is required. string
SocketHostname This property is required. string
AgentVersion This property is required. string
CpuCores This property is required. int
Gohai This property is required. string
Machine This property is required. string
Platform This property is required. string
Processor This property is required. string
PythonVersion This property is required. string
SocketFqdn This property is required. string
SocketHostname This property is required. string
agentVersion This property is required. String
cpuCores This property is required. Integer
gohai This property is required. String
machine This property is required. String
platform This property is required. String
processor This property is required. String
pythonVersion This property is required. String
socketFqdn This property is required. String
socketHostname This property is required. String
agentVersion This property is required. string
cpuCores This property is required. number
gohai This property is required. string
machine This property is required. string
platform This property is required. string
processor This property is required. string
pythonVersion This property is required. string
socketFqdn This property is required. string
socketHostname This property is required. string
agent_version This property is required. str
cpu_cores This property is required. int
gohai This property is required. str
machine This property is required. str
platform This property is required. str
processor This property is required. str
python_version This property is required. str
socket_fqdn This property is required. str
socket_hostname This property is required. str
agentVersion This property is required. String
cpuCores This property is required. Number
gohai This property is required. String
machine This property is required. String
platform This property is required. String
processor This property is required. String
pythonVersion This property is required. String
socketFqdn This property is required. String
socketHostname This property is required. String

GetHostsHostListMetrics

Cpu This property is required. double
Iowait This property is required. double
Load This property is required. double
Cpu This property is required. float64
Iowait This property is required. float64
Load This property is required. float64
cpu This property is required. Double
iowait This property is required. Double
load This property is required. Double
cpu This property is required. number
iowait This property is required. number
load This property is required. number
cpu This property is required. float
iowait This property is required. float
load This property is required. float
cpu This property is required. Number
iowait This property is required. Number
load This property is required. Number

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.
Datadog v4.47.0 published on Thursday, Mar 20, 2025 by Pulumi