Datadog v4.47.0 published on Thursday, Mar 20, 2025 by Pulumi
datadog.getHosts
Explore with Pulumi AI
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());
    }
}
variables:
  foo:
    fn::invoke:
      function: datadog:getHosts
      arguments:
        includeMutedHostsData: true
        includeHostsMetadata: true
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>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]func GetHosts(ctx *Context, args *GetHostsArgs, opts ...InvokeOption) (*GetHostsResult, error)
func GetHostsOutput(ctx *Context, args *GetHostsOutputArgs, opts ...InvokeOption) GetHostsResultOutput> 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)
}public static CompletableFuture<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
public static Output<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
fn::invoke:
  function: datadog:index/getHosts:getHosts
  arguments:
    # arguments dictionaryThe 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.
- IncludeMuted boolHosts Data 
- 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.
- IncludeMuted boolHosts Data 
- 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.
- includeMuted BooleanHosts Data 
- 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.
- includeMuted booleanHosts Data 
- 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_ boolhosts_ data 
- 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.
- includeMuted BooleanHosts Data 
- 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<GetHosts Host List> 
- 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.
- IncludeMuted boolHosts Data 
- 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 []GetHosts Host List 
- 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.
- IncludeMuted boolHosts Data 
- 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<GetHosts Host List> 
- 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.
- includeMuted BooleanHosts Data 
- 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 GetHosts Host List[] 
- 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.
- includeMuted booleanHosts Data 
- 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[GetHosts Host List] 
- 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_ boolhosts_ data 
- 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.
- includeMuted BooleanHosts Data 
- 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 List<string>
- Apps List<string>
- AwsName string
- HostName string
- Id int
- IsMuted bool
- LastReported intTime 
- Meta
GetHosts Host List Meta 
- Metrics
GetHosts Host List Metrics 
- MuteTimeout int
- Name string
- Sources List<string>
- 
Dictionary<string, ImmutableArray<string>> 
- Up bool
- Aliases []string
- Apps []string
- AwsName string
- HostName string
- Id int
- IsMuted bool
- LastReported intTime 
- Meta
GetHosts Host List Meta 
- Metrics
GetHosts Host List Metrics 
- MuteTimeout int
- Name string
- Sources []string
- map[string][]string
- Up bool
- aliases List<String>
- apps List<String>
- awsName String
- hostName String
- id Integer
- isMuted Boolean
- lastReported IntegerTime 
- meta
GetHosts Host List Meta 
- metrics
GetHosts Host List Metrics 
- muteTimeout Integer
- name String
- sources List<String>
- Map<String,List<String>>
- up Boolean
- aliases string[]
- apps string[]
- awsName string
- hostName string
- id number
- isMuted boolean
- lastReported numberTime 
- meta
GetHosts Host List Meta 
- metrics
GetHosts Host List Metrics 
- muteTimeout number
- name string
- sources string[]
- {[key: string]: string[]}
- up boolean
- aliases Sequence[str]
- apps Sequence[str]
- aws_name str
- host_name str
- id int
- is_muted bool
- last_reported_ inttime 
- meta
GetHosts Host List Meta 
- metrics
GetHosts Host List Metrics 
- mute_timeout int
- name str
- sources Sequence[str]
- Mapping[str, Sequence[str]]
- up bool
- aliases List<String>
- apps List<String>
- awsName String
- hostName String
- id Number
- isMuted Boolean
- lastReported NumberTime 
- meta Property Map
- metrics Property Map
- muteTimeout Number
- name String
- sources List<String>
- Map<List<String>>
- up Boolean
GetHostsHostListMeta    
- AgentVersion string
- CpuCores int
- Gohai string
- Machine string
- Platform string
- Processor string
- PythonVersion string
- SocketFqdn string
- SocketHostname string
- AgentVersion string
- CpuCores int
- Gohai string
- Machine string
- Platform string
- Processor string
- PythonVersion string
- SocketFqdn string
- SocketHostname string
- agentVersion String
- cpuCores Integer
- gohai String
- machine String
- platform String
- processor String
- pythonVersion String
- socketFqdn String
- socketHostname String
- agentVersion string
- cpuCores number
- gohai string
- machine string
- platform string
- processor string
- pythonVersion string
- socketFqdn string
- socketHostname string
- agent_version str
- cpu_cores int
- gohai str
- machine str
- platform str
- processor str
- python_version str
- socket_fqdn str
- socket_hostname str
- agentVersion String
- cpuCores Number
- gohai String
- machine String
- platform String
- processor String
- pythonVersion String
- socketFqdn String
- socketHostname String
GetHostsHostListMetrics    
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the datadogTerraform Provider.