talos v0.4.1 published on Tuesday, Nov 5, 2024 by Pulumiverse
talos.machine.getDisks
Explore with Pulumi AI
Generate a machine configuration for a node type
Note: Since Talos natively supports
.machine.install.diskSelector
, thetalos.machine.getDisks
data source maybe just used to query disk information that could be used elsewhere. It’s recommended to usemachine.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));
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]))
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
})
}
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()),
};
});
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())));
}
}
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:
- Client
Configuration Pulumiverse.Talos. Machine. Inputs. Get Disks Client Configuration - 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. Get Disks Filters - Filters to apply to the disks
- Timeouts
Pulumiverse.
Talos. Machine. Inputs. Get Disks Timeouts
- Client
Configuration GetDisks Client Configuration - 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
Get
Disks Filters - Filters to apply to the disks
- Timeouts
Get
Disks Timeouts
- client
Configuration GetDisks Client Configuration - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client
Configuration GetDisks Client Configuration - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client_
configuration GetDisks Client Configuration - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client
Configuration 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:
- Client
Configuration Pulumiverse.Talos. Machine. Outputs. Get Disks Client Configuration - The client configuration data
- Disks
List<Pulumiverse.
Talos. Machine. Outputs. Get Disks Disk> - 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. Get Disks Filters - Filters to apply to the disks
- Timeouts
Pulumiverse.
Talos. Machine. Outputs. Get Disks Timeouts
- Client
Configuration GetDisks Client Configuration - The client configuration data
- Disks
[]Get
Disks Disk - 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
Get
Disks Filters - Filters to apply to the disks
- Timeouts
Get
Disks Timeouts
- client
Configuration GetDisks Client Configuration - The client configuration data
- disks
List<Get
Disks Disk> - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client
Configuration GetDisks Client Configuration - The client configuration data
- disks
Get
Disks Disk[] - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client_
configuration GetDisks Client Configuration - The client configuration data
- disks
Sequence[Get
Disks Disk] - 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
Get
Disks Filters - Filters to apply to the disks
- timeouts
Get
Disks Timeouts
- client
Configuration 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
- Ca
Certificate string - The client CA certificate
- Client
Certificate string - The client certificate
- Client
Key string - The client key
- Ca
Certificate string - The client CA certificate
- Client
Certificate string - The client certificate
- Client
Key string - The client key
- ca
Certificate String - The client CA certificate
- client
Certificate String - The client certificate
- client
Key String - The client key
- ca
Certificate string - The client CA certificate
- client
Certificate string - The client certificate
- client
Key string - The client key
- ca_
certificate str - The client CA certificate
- client_
certificate str - The client certificate
- client_
key str - The client key
- ca
Certificate String - The client CA certificate
- client
Certificate String - The client certificate
- client
Key String - The client key
GetDisksDisk
- Bus
Path 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 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 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 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 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
- Bus
Path 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 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 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 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 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.