1. Packages
  2. Talos Linux
  3. API Docs
  4. machine
  5. getDisks
talos v0.5.2 published on Thursday, Jan 23, 2025 by Pulumiverse

talos.machine.getDisks

Explore with Pulumi AI

talos v0.5.2 published on Thursday, Jan 23, 2025 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

import * as pulumi from "@pulumi/pulumi";
import * as talos from "@pulumi/talos";
import * as talos from "@pulumiverse/talos";

const thisSecrets = new talos.machine.Secrets("this", {});
const this = talos.machine.getDisksOutput({
    clientConfiguration: thisSecrets.clientConfiguration,
    node: "10.5.0.2",
    filters: {
        size: "> 100GB",
        type: "nvme",
    },
});
export const nvmeDisks = _this.apply(_this => _this.disks.map(__item => __item.name));
Copy
import pulumi
import pulumi_talos as talos
import pulumiverse_talos as talos

this_secrets = talos.machine.Secrets("this")
this = talos.machine.get_disks_output(client_configuration=this_secrets.client_configuration,
    node="10.5.0.2",
    filters={
        "size": "> 100GB",
        "type": "nvme",
    })
pulumi.export("nvmeDisks", this.apply(lambda this: [__item.name for __item in this.disks]))
Copy
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, "this", nil)
if err != nil {
return err
}
this := 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", this.ApplyT(func(this machine.GetDisksResult) ([]*string, error) {
var splat0 []*string
for _, val0 := range this.Disks {
splat0 = append(splat0, val0.Name)
}
return splat0, nil
}).(pulumi.[]*stringOutput))
return nil
})
}
Copy
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("this");

    var @this = 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"] = @this.Apply(@this => @this.Apply(getDisksResult => getDisksResult.Disks).Select(__item => __item.Name).ToList()),
    };
});
Copy
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 this = MachineFunctions.getDisks(GetDisksArgs.builder()
            .clientConfiguration(thisSecrets.clientConfiguration())
            .node("10.5.0.2")
            .filters(GetDisksFiltersArgs.builder()
                .size("> 100GB")
                .type("nvme")
                .build())
            .build());

        ctx.export("nvmeDisks", this_.applyValue(this_ -> this_.disks().stream().map(element -> element.name()).collect(toList())));
    }
}
Copy
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>
Copy
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]
Copy
func GetDisks(ctx *Context, args *GetDisksArgs, opts ...InvokeOption) (*GetDisksResult, error)
func GetDisksOutput(ctx *Context, args *GetDisksOutputArgs, opts ...InvokeOption) GetDisksResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetDisksResult> getDisks(GetDisksArgs args, InvokeOptions options)
public static Output<GetDisksResult> getDisks(GetDisksArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: talos:machine/getDisks:getDisks
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ClientConfiguration This property is required. Pulumiverse.Talos.Machine.Inputs.GetDisksClientConfiguration
The client configuration data
Node This property is required. 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 This property is required. GetDisksClientConfiguration
The client configuration data
Node This property is required. 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 This property is required. GetDisksClientConfiguration
The client configuration data
node This property is required. 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 This property is required. GetDisksClientConfiguration
The client configuration data
node This property is required. 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 This property is required. GetDisksClientConfiguration
The client configuration data
node This property is required. 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 This property is required. Property Map
The client configuration data
node This property is required. 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 This property is required. string
The client CA certificate
ClientCertificate This property is required. string
The client certificate
ClientKey This property is required. string
The client key
CaCertificate This property is required. string
The client CA certificate
ClientCertificate This property is required. string
The client certificate
ClientKey This property is required. string
The client key
caCertificate This property is required. String
The client CA certificate
clientCertificate This property is required. String
The client certificate
clientKey This property is required. String
The client key
caCertificate This property is required. string
The client CA certificate
clientCertificate This property is required. string
The client certificate
clientKey This property is required. string
The client key
ca_certificate This property is required. str
The client CA certificate
client_certificate This property is required. str
The client certificate
client_key This property is required. str
The client key
caCertificate This property is required. String
The client CA certificate
clientCertificate This property is required. String
The client certificate
clientKey This property is required. String
The client key

GetDisksDisk

BusPath This property is required. string
The bus path of the disk
Modalias This property is required. string
The modalias of the disk
Model This property is required. string
The model of the disk
Name This property is required. string
The name of the disk
Serial This property is required. string
The serial number of the disk
Size This property is required. string
The size of the disk
Type This property is required. string
The type of the disk
Uuid This property is required. string
The uuid of the disk
Wwid This property is required. string
The wwid of the disk
BusPath This property is required. string
The bus path of the disk
Modalias This property is required. string
The modalias of the disk
Model This property is required. string
The model of the disk
Name This property is required. string
The name of the disk
Serial This property is required. string
The serial number of the disk
Size This property is required. string
The size of the disk
Type This property is required. string
The type of the disk
Uuid This property is required. string
The uuid of the disk
Wwid This property is required. string
The wwid of the disk
busPath This property is required. String
The bus path of the disk
modalias This property is required. String
The modalias of the disk
model This property is required. String
The model of the disk
name This property is required. String
The name of the disk
serial This property is required. String
The serial number of the disk
size This property is required. String
The size of the disk
type This property is required. String
The type of the disk
uuid This property is required. String
The uuid of the disk
wwid This property is required. String
The wwid of the disk
busPath This property is required. string
The bus path of the disk
modalias This property is required. string
The modalias of the disk
model This property is required. string
The model of the disk
name This property is required. string
The name of the disk
serial This property is required. string
The serial number of the disk
size This property is required. string
The size of the disk
type This property is required. string
The type of the disk
uuid This property is required. string
The uuid of the disk
wwid This property is required. string
The wwid of the disk
bus_path This property is required. str
The bus path of the disk
modalias This property is required. str
The modalias of the disk
model This property is required. str
The model of the disk
name This property is required. str
The name of the disk
serial This property is required. str
The serial number of the disk
size This property is required. str
The size of the disk
type This property is required. str
The type of the disk
uuid This property is required. str
The uuid of the disk
wwid This property is required. str
The wwid of the disk
busPath This property is required. String
The bus path of the disk
modalias This property is required. String
The modalias of the disk
model This property is required. String
The model of the disk
name This property is required. String
The name of the disk
serial This property is required. String
The serial number of the disk
size This property is required. String
The size of the disk
type This property is required. String
The type of the disk
uuid This property is required. String
The uuid of the disk
wwid This property is required. 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 v0.5.2 published on Thursday, Jan 23, 2025 by Pulumiverse