1. Packages
  2. Talos Linux
  3. API Docs
  4. machine
  5. getDisks
talos v0.2.0 published on Thursday, Dec 21, 2023 by Pulumiverse

talos.machine.getDisks

Explore with Pulumi AI

talos logo
talos v0.2.0 published on Thursday, Dec 21, 2023 by Pulumiverse

    Generate a machine configuration for a node type

    Note: Since Talos natively supports .machine.install.diskSelector, the talos.machine.getDisks data source maybe just used to query disk information that could be used elsewhere. It’s recommended to use machine.install.diskSelector in Talos machine configuration.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Talos = Pulumi.Talos;
    using Talos = Pulumiverse.Talos;
    
    return await Deployment.RunAsync(() => 
    {
        var thisSecrets = new Talos.Machine.Secrets("thisSecrets");
    
        var thisDisks = Talos.Machine.GetDisks.Invoke(new()
        {
            ClientConfiguration = thisSecrets.ClientConfiguration,
            Node = "10.5.0.2",
            Filters = new Talos.Machine.Inputs.GetDisksFiltersInputArgs
            {
                Size = "> 100GB",
                Type = "nvme",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["nvmeDisks"] = thisDisks.Apply(getDisksResult => getDisksResult.Disks).Select(__item => __item.Name).ToList(),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-talos/sdk/go/talos/machine"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    thisSecrets, err := machine.NewSecrets(ctx, "thisSecrets", nil)
    if err != nil {
    return err
    }
    thisDisks := machine.GetDisksOutput(ctx, machine.GetDisksOutputArgs{
    ClientConfiguration: thisSecrets.ClientConfiguration,
    Node: pulumi.String("10.5.0.2"),
    Filters: &machine.GetDisksFiltersArgs{
    Size: pulumi.String("> 100GB"),
    Type: pulumi.String("nvme"),
    },
    }, nil);
    ctx.Export("nvmeDisks", thisDisks.ApplyT(func(thisDisks machine.GetDisksResult) ([]*string, error) {
    var splat0 []*string
    for _, val0 := range thisDisks.Disks {
    splat0 = append(splat0, val0.Name)
    }
    return splat0, nil
    }).(pulumi.[]*stringOutput))
    return nil
    })
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.talos.machine.Secrets;
    import com.pulumi.talos.machine.MachineFunctions;
    import com.pulumi.talos.machine.inputs.GetDisksArgs;
    import com.pulumi.talos.machine.inputs.GetDisksFiltersArgs;
    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 thisSecrets = new Secrets("thisSecrets");
    
            final var thisDisks = MachineFunctions.getDisks(GetDisksArgs.builder()
                .clientConfiguration(thisSecrets.clientConfiguration())
                .node("10.5.0.2")
                .filters(GetDisksFiltersArgs.builder()
                    .size("> 100GB")
                    .type("nvme")
                    .build())
                .build());
    
            ctx.export("nvmeDisks", thisDisks.applyValue(getDisksResult -> getDisksResult).applyValue(thisDisks -> thisDisks.applyValue(getDisksResult -> getDisksResult.disks()).stream().map(element -> element.name()).collect(toList())));
        }
    }
    
    import pulumi
    import pulumi_talos as talos
    import pulumiverse_talos as talos
    
    this_secrets = talos.machine.Secrets("thisSecrets")
    this_disks = talos.machine.get_disks_output(client_configuration=this_secrets.client_configuration,
        node="10.5.0.2",
        filters=talos.machine.GetDisksFiltersArgs(
            size="> 100GB",
            type="nvme",
        ))
    pulumi.export("nvmeDisks", this_disks.apply(lambda this_disks: [__item.name for __item in this_disks.disks]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as talos from "@pulumi/talos";
    import * as talos from "@pulumiverse/talos";
    
    const thisSecrets = new talos.machine.Secrets("thisSecrets", {});
    const thisDisks = talos.machine.getDisksOutput({
        clientConfiguration: thisSecrets.clientConfiguration,
        node: "10.5.0.2",
        filters: {
            size: "> 100GB",
            type: "nvme",
        },
    });
    export const nvmeDisks = thisDisks.apply(thisDisks => thisDisks.disks.map(__item => __item.name));
    

    Coming soon!

    Using getDisks

    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 getDisks(args: GetDisksArgs, opts?: InvokeOptions): Promise<GetDisksResult>
    function getDisksOutput(args: GetDisksOutputArgs, opts?: InvokeOptions): Output<GetDisksResult>
    def get_disks(client_configuration: Optional[GetDisksClientConfiguration] = None,
                  endpoint: Optional[str] = None,
                  filters: Optional[GetDisksFilters] = None,
                  node: Optional[str] = None,
                  timeouts: Optional[GetDisksTimeouts] = None,
                  opts: Optional[InvokeOptions] = None) -> GetDisksResult
    def get_disks_output(client_configuration: Optional[pulumi.Input[GetDisksClientConfigurationArgs]] = None,
                  endpoint: Optional[pulumi.Input[str]] = None,
                  filters: Optional[pulumi.Input[GetDisksFiltersArgs]] = None,
                  node: Optional[pulumi.Input[str]] = None,
                  timeouts: Optional[pulumi.Input[GetDisksTimeoutsArgs]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetDisksResult]
    func GetDisks(ctx *Context, args *GetDisksArgs, opts ...InvokeOption) (*GetDisksResult, error)
    func GetDisksOutput(ctx *Context, args *GetDisksOutputArgs, opts ...InvokeOption) GetDisksResultOutput

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

    public static class GetDisks 
    {
        public static Task<GetDisksResult> InvokeAsync(GetDisksArgs args, InvokeOptions? opts = null)
        public static Output<GetDisksResult> Invoke(GetDisksInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDisksResult> getDisks(GetDisksArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: talos:machine/getDisks:getDisks
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClientConfiguration Pulumiverse.Talos.Machine.Inputs.GetDisksClientConfiguration
    The client configuration data
    Node string
    controlplane node to retrieve the kubeconfig from
    Endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    Filters Pulumiverse.Talos.Machine.Inputs.GetDisksFilters
    Filters to apply to the disks
    Timeouts Pulumiverse.Talos.Machine.Inputs.GetDisksTimeouts
    ClientConfiguration GetDisksClientConfiguration
    The client configuration data
    Node string
    controlplane node to retrieve the kubeconfig from
    Endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    Filters GetDisksFilters
    Filters to apply to the disks
    Timeouts GetDisksTimeouts
    clientConfiguration GetDisksClientConfiguration
    The client configuration data
    node String
    controlplane node to retrieve the kubeconfig from
    endpoint String
    endpoint to use for the talosclient. If not set, the node value will be used
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    clientConfiguration GetDisksClientConfiguration
    The client configuration data
    node string
    controlplane node to retrieve the kubeconfig from
    endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    client_configuration GetDisksClientConfiguration
    The client configuration data
    node str
    controlplane node to retrieve the kubeconfig from
    endpoint str
    endpoint to use for the talosclient. If not set, the node value will be used
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    clientConfiguration Property Map
    The client configuration data
    node String
    controlplane node to retrieve the kubeconfig from
    endpoint String
    endpoint to use for the talosclient. If not set, the node value will be used
    filters Property Map
    Filters to apply to the disks
    timeouts Property Map

    getDisks Result

    The following output properties are available:

    ClientConfiguration Pulumiverse.Talos.Machine.Outputs.GetDisksClientConfiguration
    The client configuration data
    Disks List<Pulumiverse.Talos.Machine.Outputs.GetDisksDisk>
    The disks that match the filters
    Endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    Id string
    The generated ID of this resource
    Node string
    controlplane node to retrieve the kubeconfig from
    Filters Pulumiverse.Talos.Machine.Outputs.GetDisksFilters
    Filters to apply to the disks
    Timeouts Pulumiverse.Talos.Machine.Outputs.GetDisksTimeouts
    ClientConfiguration GetDisksClientConfiguration
    The client configuration data
    Disks []GetDisksDisk
    The disks that match the filters
    Endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    Id string
    The generated ID of this resource
    Node string
    controlplane node to retrieve the kubeconfig from
    Filters GetDisksFilters
    Filters to apply to the disks
    Timeouts GetDisksTimeouts
    clientConfiguration GetDisksClientConfiguration
    The client configuration data
    disks List<GetDisksDisk>
    The disks that match the filters
    endpoint String
    endpoint to use for the talosclient. If not set, the node value will be used
    id String
    The generated ID of this resource
    node String
    controlplane node to retrieve the kubeconfig from
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    clientConfiguration GetDisksClientConfiguration
    The client configuration data
    disks GetDisksDisk[]
    The disks that match the filters
    endpoint string
    endpoint to use for the talosclient. If not set, the node value will be used
    id string
    The generated ID of this resource
    node string
    controlplane node to retrieve the kubeconfig from
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    client_configuration GetDisksClientConfiguration
    The client configuration data
    disks Sequence[GetDisksDisk]
    The disks that match the filters
    endpoint str
    endpoint to use for the talosclient. If not set, the node value will be used
    id str
    The generated ID of this resource
    node str
    controlplane node to retrieve the kubeconfig from
    filters GetDisksFilters
    Filters to apply to the disks
    timeouts GetDisksTimeouts
    clientConfiguration Property Map
    The client configuration data
    disks List<Property Map>
    The disks that match the filters
    endpoint String
    endpoint to use for the talosclient. If not set, the node value will be used
    id String
    The generated ID of this resource
    node String
    controlplane node to retrieve the kubeconfig from
    filters Property Map
    Filters to apply to the disks
    timeouts Property Map

    Supporting Types

    GetDisksClientConfiguration

    CaCertificate string
    The client CA certificate
    ClientCertificate string
    The client certificate
    ClientKey string
    The client key
    CaCertificate string
    The client CA certificate
    ClientCertificate string
    The client certificate
    ClientKey string
    The client key
    caCertificate String
    The client CA certificate
    clientCertificate String
    The client certificate
    clientKey String
    The client key
    caCertificate string
    The client CA certificate
    clientCertificate string
    The client certificate
    clientKey string
    The client key
    ca_certificate str
    The client CA certificate
    client_certificate str
    The client certificate
    client_key str
    The client key
    caCertificate String
    The client CA certificate
    clientCertificate String
    The client certificate
    clientKey String
    The client key

    GetDisksDisk

    BusPath string
    The bus path of the disk
    Modalias string
    The modalias of the disk
    Model string
    The model of the disk
    Name string
    The name of the disk
    Serial string
    The serial number of the disk
    Size string
    The size of the disk
    Type string
    The type of the disk
    Uuid string
    The uuid of the disk
    Wwid string
    The wwid of the disk
    BusPath string
    The bus path of the disk
    Modalias string
    The modalias of the disk
    Model string
    The model of the disk
    Name string
    The name of the disk
    Serial string
    The serial number of the disk
    Size string
    The size of the disk
    Type string
    The type of the disk
    Uuid string
    The uuid of the disk
    Wwid string
    The wwid of the disk
    busPath String
    The bus path of the disk
    modalias String
    The modalias of the disk
    model String
    The model of the disk
    name String
    The name of the disk
    serial String
    The serial number of the disk
    size String
    The size of the disk
    type String
    The type of the disk
    uuid String
    The uuid of the disk
    wwid String
    The wwid of the disk
    busPath string
    The bus path of the disk
    modalias string
    The modalias of the disk
    model string
    The model of the disk
    name string
    The name of the disk
    serial string
    The serial number of the disk
    size string
    The size of the disk
    type string
    The type of the disk
    uuid string
    The uuid of the disk
    wwid string
    The wwid of the disk
    bus_path str
    The bus path of the disk
    modalias str
    The modalias of the disk
    model str
    The model of the disk
    name str
    The name of the disk
    serial str
    The serial number of the disk
    size str
    The size of the disk
    type str
    The type of the disk
    uuid str
    The uuid of the disk
    wwid str
    The wwid of the disk
    busPath String
    The bus path of the disk
    modalias String
    The modalias of the disk
    model String
    The model of the disk
    name String
    The name of the disk
    serial String
    The serial number of the disk
    size String
    The size of the disk
    type String
    The type of the disk
    uuid String
    The uuid of the disk
    wwid String
    The wwid of the disk

    GetDisksFilters

    BusPath string
    Filter disks by bus path
    Modalias string
    Filter disks by modalias
    Model string
    Filter disks by model
    Name string
    Filter disks by name
    Serial string
    Filter disks by serial number
    Size string
    Filter disks by size
    Type string
    Filter disks by type
    Uuid string
    Filter disks by uuid
    Wwid string
    Filter disks by wwid
    BusPath string
    Filter disks by bus path
    Modalias string
    Filter disks by modalias
    Model string
    Filter disks by model
    Name string
    Filter disks by name
    Serial string
    Filter disks by serial number
    Size string
    Filter disks by size
    Type string
    Filter disks by type
    Uuid string
    Filter disks by uuid
    Wwid string
    Filter disks by wwid
    busPath String
    Filter disks by bus path
    modalias String
    Filter disks by modalias
    model String
    Filter disks by model
    name String
    Filter disks by name
    serial String
    Filter disks by serial number
    size String
    Filter disks by size
    type String
    Filter disks by type
    uuid String
    Filter disks by uuid
    wwid String
    Filter disks by wwid
    busPath string
    Filter disks by bus path
    modalias string
    Filter disks by modalias
    model string
    Filter disks by model
    name string
    Filter disks by name
    serial string
    Filter disks by serial number
    size string
    Filter disks by size
    type string
    Filter disks by type
    uuid string
    Filter disks by uuid
    wwid string
    Filter disks by wwid
    bus_path str
    Filter disks by bus path
    modalias str
    Filter disks by modalias
    model str
    Filter disks by model
    name str
    Filter disks by name
    serial str
    Filter disks by serial number
    size str
    Filter disks by size
    type str
    Filter disks by type
    uuid str
    Filter disks by uuid
    wwid str
    Filter disks by wwid
    busPath String
    Filter disks by bus path
    modalias String
    Filter disks by modalias
    model String
    Filter disks by model
    name String
    Filter disks by name
    serial String
    Filter disks by serial number
    size String
    Filter disks by size
    type String
    Filter disks by type
    uuid String
    Filter disks by uuid
    wwid String
    Filter disks by wwid

    GetDisksTimeouts

    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    read str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

    Package Details

    Repository
    talos pulumiverse/pulumi-talos
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the talos Terraform Provider.
    talos logo
    talos v0.2.0 published on Thursday, Dec 21, 2023 by Pulumiverse