1. Packages
  2. Nsxt Provider
  3. API Docs
  4. getDiscoveredNode
nsxt 3.8.0 published on Monday, Apr 14, 2025 by vmware

nsxt.getDiscoveredNode

Explore with Pulumi AI

This data source provides information about Discovered Node configured in NSX. A Discovered Node can be used to create a Host Transport Node.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";

const test = nsxt.getDiscoveredNode({
    ipAddress: "10.43.251.142",
});
Copy
import pulumi
import pulumi_nsxt as nsxt

test = nsxt.get_discovered_node(ip_address="10.43.251.142")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nsxt.GetDiscoveredNode(ctx, &nsxt.GetDiscoveredNodeArgs{
			IpAddress: pulumi.StringRef("10.43.251.142"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nsxt = Pulumi.Nsxt;

return await Deployment.RunAsync(() => 
{
    var test = Nsxt.GetDiscoveredNode.Invoke(new()
    {
        IpAddress = "10.43.251.142",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nsxt.NsxtFunctions;
import com.pulumi.nsxt.inputs.GetDiscoveredNodeArgs;
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 test = NsxtFunctions.getDiscoveredNode(GetDiscoveredNodeArgs.builder()
            .ipAddress("10.43.251.142")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: nsxt:getDiscoveredNode
      arguments:
        ipAddress: 10.43.251.142
Copy

When Deploying Together With Compute Manager

import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";

const vc1ComputeManager = new nsxt.ComputeManager("vc1ComputeManager", {
    displayName: "test-vcenter",
    server: "34.34.34.34",
    multiNsx: false,
    credential: {
        usernamePasswordLogin: {
            username: "user1",
            password: "password1",
            thumbprint: "thumbprint1",
        },
    },
    originType: "vCenter",
});
const vc1ComputeManagerRealization = nsxt.getComputeManagerRealizationOutput({
    id: vc1ComputeManager.computeManagerId,
    timeout: 1200,
});
const test = vc1ComputeManagerRealization.apply(vc1ComputeManagerRealization => nsxt.getDiscoveredNodeOutput({
    computeManagerState: vc1ComputeManagerRealization.state,
    ipAddress: "10.43.251.142",
}));
Copy
import pulumi
import pulumi_nsxt as nsxt

vc1_compute_manager = nsxt.ComputeManager("vc1ComputeManager",
    display_name="test-vcenter",
    server="34.34.34.34",
    multi_nsx=False,
    credential={
        "username_password_login": {
            "username": "user1",
            "password": "password1",
            "thumbprint": "thumbprint1",
        },
    },
    origin_type="vCenter")
vc1_compute_manager_realization = nsxt.get_compute_manager_realization_output(id=vc1_compute_manager.compute_manager_id,
    timeout=1200)
test = vc1_compute_manager_realization.apply(lambda vc1_compute_manager_realization: nsxt.get_discovered_node_output(compute_manager_state=vc1_compute_manager_realization.state,
    ip_address="10.43.251.142"))
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		vc1ComputeManager, err := nsxt.NewComputeManager(ctx, "vc1ComputeManager", &nsxt.ComputeManagerArgs{
			DisplayName: pulumi.String("test-vcenter"),
			Server:      pulumi.String("34.34.34.34"),
			MultiNsx:    pulumi.Bool(false),
			Credential: &nsxt.ComputeManagerCredentialArgs{
				UsernamePasswordLogin: &nsxt.ComputeManagerCredentialUsernamePasswordLoginArgs{
					Username:   pulumi.String("user1"),
					Password:   pulumi.String("password1"),
					Thumbprint: pulumi.String("thumbprint1"),
				},
			},
			OriginType: pulumi.String("vCenter"),
		})
		if err != nil {
			return err
		}
		vc1ComputeManagerRealization := nsxt.GetComputeManagerRealizationOutput(ctx, nsxt.GetComputeManagerRealizationOutputArgs{
			Id:      vc1ComputeManager.ComputeManagerId,
			Timeout: pulumi.Float64(1200),
		}, nil)
		_ = vc1ComputeManagerRealization.ApplyT(func(vc1ComputeManagerRealization nsxt.GetComputeManagerRealizationResult) (nsxt.GetDiscoveredNodeResult, error) {
			return nsxt.GetDiscoveredNodeResult(interface{}(nsxt.GetDiscoveredNodeOutput(ctx, nsxt.GetDiscoveredNodeOutputArgs{
				ComputeManagerState: vc1ComputeManagerRealization.State,
				IpAddress:           "10.43.251.142",
			}, nil))), nil
		}).(nsxt.GetDiscoveredNodeResultOutput)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nsxt = Pulumi.Nsxt;

return await Deployment.RunAsync(() => 
{
    var vc1ComputeManager = new Nsxt.ComputeManager("vc1ComputeManager", new()
    {
        DisplayName = "test-vcenter",
        Server = "34.34.34.34",
        MultiNsx = false,
        Credential = new Nsxt.Inputs.ComputeManagerCredentialArgs
        {
            UsernamePasswordLogin = new Nsxt.Inputs.ComputeManagerCredentialUsernamePasswordLoginArgs
            {
                Username = "user1",
                Password = "password1",
                Thumbprint = "thumbprint1",
            },
        },
        OriginType = "vCenter",
    });

    var vc1ComputeManagerRealization = Nsxt.GetComputeManagerRealization.Invoke(new()
    {
        Id = vc1ComputeManager.ComputeManagerId,
        Timeout = 1200,
    });

    var test = Nsxt.GetDiscoveredNode.Invoke(new()
    {
        ComputeManagerState = vc1ComputeManagerRealization.Apply(getComputeManagerRealizationResult => getComputeManagerRealizationResult.State),
        IpAddress = "10.43.251.142",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nsxt.ComputeManager;
import com.pulumi.nsxt.ComputeManagerArgs;
import com.pulumi.nsxt.inputs.ComputeManagerCredentialArgs;
import com.pulumi.nsxt.inputs.ComputeManagerCredentialUsernamePasswordLoginArgs;
import com.pulumi.nsxt.NsxtFunctions;
import com.pulumi.nsxt.inputs.GetComputeManagerRealizationArgs;
import com.pulumi.nsxt.inputs.GetDiscoveredNodeArgs;
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) {
        var vc1ComputeManager = new ComputeManager("vc1ComputeManager", ComputeManagerArgs.builder()
            .displayName("test-vcenter")
            .server("34.34.34.34")
            .multiNsx(false)
            .credential(ComputeManagerCredentialArgs.builder()
                .usernamePasswordLogin(ComputeManagerCredentialUsernamePasswordLoginArgs.builder()
                    .username("user1")
                    .password("password1")
                    .thumbprint("thumbprint1")
                    .build())
                .build())
            .originType("vCenter")
            .build());

        final var vc1ComputeManagerRealization = NsxtFunctions.getComputeManagerRealization(GetComputeManagerRealizationArgs.builder()
            .id(vc1ComputeManager.computeManagerId())
            .timeout(1200)
            .build());

        final var test = NsxtFunctions.getDiscoveredNode(GetDiscoveredNodeArgs.builder()
            .computeManagerState(vc1ComputeManagerRealization.applyValue(getComputeManagerRealizationResult -> getComputeManagerRealizationResult).applyValue(vc1ComputeManagerRealization -> vc1ComputeManagerRealization.applyValue(getComputeManagerRealizationResult -> getComputeManagerRealizationResult.state())))
            .ipAddress("10.43.251.142")
            .build());

    }
}
Copy
resources:
  vc1ComputeManager:
    type: nsxt:ComputeManager
    properties:
      displayName: test-vcenter
      server: 34.34.34.34
      multiNsx: false
      credential:
        usernamePasswordLogin:
          username: user1
          password: password1
          thumbprint: thumbprint1
      originType: vCenter
variables:
  vc1ComputeManagerRealization:
    fn::invoke:
      function: nsxt:getComputeManagerRealization
      arguments:
        id: ${vc1ComputeManager.computeManagerId}
        timeout: 1200
  test:
    fn::invoke:
      function: nsxt:getDiscoveredNode
      arguments:
        computeManagerState: ${vc1ComputeManagerRealization.state}
        ipAddress: 10.43.251.142
Copy

Using getDiscoveredNode

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 getDiscoveredNode(args: GetDiscoveredNodeArgs, opts?: InvokeOptions): Promise<GetDiscoveredNodeResult>
function getDiscoveredNodeOutput(args: GetDiscoveredNodeOutputArgs, opts?: InvokeOptions): Output<GetDiscoveredNodeResult>
Copy
def get_discovered_node(compute_manager_state: Optional[str] = None,
                        id: Optional[str] = None,
                        ip_address: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetDiscoveredNodeResult
def get_discovered_node_output(compute_manager_state: Optional[pulumi.Input[str]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        ip_address: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetDiscoveredNodeResult]
Copy
func GetDiscoveredNode(ctx *Context, args *GetDiscoveredNodeArgs, opts ...InvokeOption) (*GetDiscoveredNodeResult, error)
func GetDiscoveredNodeOutput(ctx *Context, args *GetDiscoveredNodeOutputArgs, opts ...InvokeOption) GetDiscoveredNodeResultOutput
Copy

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

public static class GetDiscoveredNode 
{
    public static Task<GetDiscoveredNodeResult> InvokeAsync(GetDiscoveredNodeArgs args, InvokeOptions? opts = null)
    public static Output<GetDiscoveredNodeResult> Invoke(GetDiscoveredNodeInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDiscoveredNodeResult> getDiscoveredNode(GetDiscoveredNodeArgs args, InvokeOptions options)
public static Output<GetDiscoveredNodeResult> getDiscoveredNode(GetDiscoveredNodeArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: nsxt:index/getDiscoveredNode:getDiscoveredNode
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ComputeManagerState string
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
Id string
External id of the discovered node, ex. a mo-ref from VC.
IpAddress string
IP Address of the discovered node.
ComputeManagerState string
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
Id string
External id of the discovered node, ex. a mo-ref from VC.
IpAddress string
IP Address of the discovered node.
computeManagerState String
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
id String
External id of the discovered node, ex. a mo-ref from VC.
ipAddress String
IP Address of the discovered node.
computeManagerState string
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
id string
External id of the discovered node, ex. a mo-ref from VC.
ipAddress string
IP Address of the discovered node.
compute_manager_state str
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
id str
External id of the discovered node, ex. a mo-ref from VC.
ip_address str
IP Address of the discovered node.
computeManagerState String
Realized state of compute manager. This argument is only needed to ensure dependency upon nsxt.getComputeManagerRealization data source, so that nsxt.getDiscoveredNode is not evaluated before compute manager is fully functional.
id String
External id of the discovered node, ex. a mo-ref from VC.
ipAddress String
IP Address of the discovered node.

getDiscoveredNode Result

The following output properties are available:

Id string
External id of the discovered node, ex. a mo-ref from VC.
IpAddress string
IP Address of the discovered node.
ComputeManagerState string
Id string
External id of the discovered node, ex. a mo-ref from VC.
IpAddress string
IP Address of the discovered node.
ComputeManagerState string
id String
External id of the discovered node, ex. a mo-ref from VC.
ipAddress String
IP Address of the discovered node.
computeManagerState String
id string
External id of the discovered node, ex. a mo-ref from VC.
ipAddress string
IP Address of the discovered node.
computeManagerState string
id str
External id of the discovered node, ex. a mo-ref from VC.
ip_address str
IP Address of the discovered node.
compute_manager_state str
id String
External id of the discovered node, ex. a mo-ref from VC.
ipAddress String
IP Address of the discovered node.
computeManagerState String

Package Details

Repository
nsxt vmware/terraform-provider-nsxt
License
Notes
This Pulumi package is based on the nsxt Terraform Provider.