1. Packages
  2. Libvirt Provider
  3. API Docs
  4. getNodeDevices
libvirt 0.8.3 published on Tuesday, Mar 4, 2025 by dmacvicar

libvirt.getNodeDevices

Start a Neo task
Explain and create a libvirt.getNodeDevices resource
libvirt logo
libvirt 0.8.3 published on Tuesday, Mar 4, 2025 by dmacvicar

    Retrieve information about the devices present on the current node

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as libvirt from "@pulumi/libvirt";
    
    const node = libvirt.getNodeDevices({
        capability: "pci",
    });
    
    import pulumi
    import pulumi_libvirt as libvirt
    
    node = libvirt.get_node_devices(capability="pci")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/libvirt/libvirt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := libvirt.GetNodeDevices(ctx, &libvirt.GetNodeDevicesArgs{
    			Capability: pulumi.StringRef("pci"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Libvirt = Pulumi.Libvirt;
    
    return await Deployment.RunAsync(() => 
    {
        var node = Libvirt.GetNodeDevices.Invoke(new()
        {
            Capability = "pci",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.libvirt.LibvirtFunctions;
    import com.pulumi.libvirt.inputs.GetNodeDevicesArgs;
    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 node = LibvirtFunctions.getNodeDevices(GetNodeDevicesArgs.builder()
                .capability("pci")
                .build());
    
        }
    }
    
    variables:
      node:
        fn::invoke:
          function: libvirt:getNodeDevices
          arguments:
            capability: pci
    

    Using getNodeDevices

    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 getNodeDevices(args: GetNodeDevicesArgs, opts?: InvokeOptions): Promise<GetNodeDevicesResult>
    function getNodeDevicesOutput(args: GetNodeDevicesOutputArgs, opts?: InvokeOptions): Output<GetNodeDevicesResult>
    def get_node_devices(capability: Optional[str] = None,
                         id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNodeDevicesResult
    def get_node_devices_output(capability: Optional[pulumi.Input[str]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNodeDevicesResult]
    func GetNodeDevices(ctx *Context, args *GetNodeDevicesArgs, opts ...InvokeOption) (*GetNodeDevicesResult, error)
    func GetNodeDevicesOutput(ctx *Context, args *GetNodeDevicesOutputArgs, opts ...InvokeOption) GetNodeDevicesResultOutput

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

    public static class GetNodeDevices 
    {
        public static Task<GetNodeDevicesResult> InvokeAsync(GetNodeDevicesArgs args, InvokeOptions? opts = null)
        public static Output<GetNodeDevicesResult> Invoke(GetNodeDevicesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNodeDevicesResult> getNodeDevices(GetNodeDevicesArgs args, InvokeOptions options)
    public static Output<GetNodeDevicesResult> getNodeDevices(GetNodeDevicesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: libvirt:index/getNodeDevices:getNodeDevices
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Capability string
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    Id string
    Capability string
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    Id string
    capability String
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    id String
    capability string
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    id string
    capability str
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    id str
    capability String
    The type of device, used to filter the output by capability type. Can be one of system, pci, usb_device, usb, net, scsi_host, scsi_target, scsi, storage, fc_host, vports, scsi_generic, drm, mdev, mdev_types, ccw, css, ap_card, ap_queue, ap_matrix. Defaults to all active devices.
    id String

    getNodeDevices Result

    The following output properties are available:

    Devices List<string>
    A list of devices that match the selected capability
    Id string
    Capability string
    Devices []string
    A list of devices that match the selected capability
    Id string
    Capability string
    devices List<String>
    A list of devices that match the selected capability
    id String
    capability String
    devices string[]
    A list of devices that match the selected capability
    id string
    capability string
    devices Sequence[str]
    A list of devices that match the selected capability
    id str
    capability str
    devices List<String>
    A list of devices that match the selected capability
    id String
    capability String

    Package Details

    Repository
    libvirt dmacvicar/terraform-provider-libvirt
    License
    Notes
    This Pulumi package is based on the libvirt Terraform Provider.
    libvirt logo
    libvirt 0.8.3 published on Tuesday, Mar 4, 2025 by dmacvicar
      Meet Neo: Your AI Platform Teammate