1. Packages
  2. Nomad Provider
  3. API Docs
  4. getDynamicHostVolume
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

nomad.getDynamicHostVolume

Start a Neo task
Explain and create a nomad.getDynamicHostVolume resource
nomad logo
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

    Get information on a dynamic host volume from Nomad.

    Example Usage

    Check for the existing of a host volume:

    import * as pulumi from "@pulumi/pulumi";
    import * as nomad from "@pulumi/nomad";
    
    const example = nomad.getDynamicHostVolume({
        namespace: "prod",
        id: "d688ff7a-d299-11ef-ae3c-6f2400953c18",
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    example = nomad.get_dynamic_host_volume(namespace="prod",
        id="d688ff7a-d299-11ef-ae3c-6f2400953c18")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nomad.LookupDynamicHostVolume(ctx, &nomad.LookupDynamicHostVolumeArgs{
    			Namespace: pulumi.StringRef("prod"),
    			Id:        "d688ff7a-d299-11ef-ae3c-6f2400953c18",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nomad = Pulumi.Nomad;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Nomad.GetDynamicHostVolume.Invoke(new()
        {
            Namespace = "prod",
            Id = "d688ff7a-d299-11ef-ae3c-6f2400953c18",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nomad.NomadFunctions;
    import com.pulumi.nomad.inputs.GetDynamicHostVolumeArgs;
    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 example = NomadFunctions.getDynamicHostVolume(GetDynamicHostVolumeArgs.builder()
                .namespace("prod")
                .id("d688ff7a-d299-11ef-ae3c-6f2400953c18")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: nomad:getDynamicHostVolume
          arguments:
            namespace: prod
            id: d688ff7a-d299-11ef-ae3c-6f2400953c18
    

    This will check for a dynamic host volume with the ID d688ff7a-d299-11ef-ae3c-6f2400953c18.

    Using getDynamicHostVolume

    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 getDynamicHostVolume(args: GetDynamicHostVolumeArgs, opts?: InvokeOptions): Promise<GetDynamicHostVolumeResult>
    function getDynamicHostVolumeOutput(args: GetDynamicHostVolumeOutputArgs, opts?: InvokeOptions): Output<GetDynamicHostVolumeResult>
    def get_dynamic_host_volume(id: Optional[str] = None,
                                namespace: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetDynamicHostVolumeResult
    def get_dynamic_host_volume_output(id: Optional[pulumi.Input[str]] = None,
                                namespace: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetDynamicHostVolumeResult]
    func LookupDynamicHostVolume(ctx *Context, args *LookupDynamicHostVolumeArgs, opts ...InvokeOption) (*LookupDynamicHostVolumeResult, error)
    func LookupDynamicHostVolumeOutput(ctx *Context, args *LookupDynamicHostVolumeOutputArgs, opts ...InvokeOption) LookupDynamicHostVolumeResultOutput

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

    public static class GetDynamicHostVolume 
    {
        public static Task<GetDynamicHostVolumeResult> InvokeAsync(GetDynamicHostVolumeArgs args, InvokeOptions? opts = null)
        public static Output<GetDynamicHostVolumeResult> Invoke(GetDynamicHostVolumeInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDynamicHostVolumeResult> getDynamicHostVolume(GetDynamicHostVolumeArgs args, InvokeOptions options)
    public static Output<GetDynamicHostVolumeResult> getDynamicHostVolume(GetDynamicHostVolumeArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nomad:index/getDynamicHostVolume:getDynamicHostVolume
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    (string) - the ID of the volume
    Namespace string
    (string) - the namespace of the volume. Defaults to "default"
    Id string
    (string) - the ID of the volume
    Namespace string
    (string) - the namespace of the volume. Defaults to "default"
    id String
    (string) - the ID of the volume
    namespace String
    (string) - the namespace of the volume. Defaults to "default"
    id string
    (string) - the ID of the volume
    namespace string
    (string) - the namespace of the volume. Defaults to "default"
    id str
    (string) - the ID of the volume
    namespace str
    (string) - the namespace of the volume. Defaults to "default"
    id String
    (string) - the ID of the volume
    namespace String
    (string) - the namespace of the volume. Defaults to "default"

    getDynamicHostVolume Result

    The following output properties are available:

    Capabilities List<GetDynamicHostVolumeCapability>
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    Capacity string
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    CapacityBytes int
    (int) - The size of the volume, in bytes.
    CapacityMax string
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    CapacityMaxBytes int
    (string) - The requested maximum capacity of the volume, in bytes.
    CapacityMin string
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    CapacityMinBytes int
    (string) - The requested minimum capacity of the volume, in bytes.
    Constraints List<GetDynamicHostVolumeConstraint>
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    HostPath string
    (string) - The path on disk where the volume exists.
    Id string
    Name string
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    NodeId string
    (string) - A specific node where the volume is mounted.
    NodePool string
    (string: <optional>) - The node pool of the node where the volume is mounted.
    Parameters Dictionary<string, string>
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    PluginId string
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    State string
    Namespace string
    (string) - The namespace of the volume.
    Capabilities []GetDynamicHostVolumeCapability
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    Capacity string
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    CapacityBytes int
    (int) - The size of the volume, in bytes.
    CapacityMax string
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    CapacityMaxBytes int
    (string) - The requested maximum capacity of the volume, in bytes.
    CapacityMin string
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    CapacityMinBytes int
    (string) - The requested minimum capacity of the volume, in bytes.
    Constraints []GetDynamicHostVolumeConstraint
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    HostPath string
    (string) - The path on disk where the volume exists.
    Id string
    Name string
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    NodeId string
    (string) - A specific node where the volume is mounted.
    NodePool string
    (string: <optional>) - The node pool of the node where the volume is mounted.
    Parameters map[string]string
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    PluginId string
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    State string
    Namespace string
    (string) - The namespace of the volume.
    capabilities List<GetDynamicHostVolumeCapability>
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity String
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    capacityBytes Integer
    (int) - The size of the volume, in bytes.
    capacityMax String
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMaxBytes Integer
    (string) - The requested maximum capacity of the volume, in bytes.
    capacityMin String
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMinBytes Integer
    (string) - The requested minimum capacity of the volume, in bytes.
    constraints List<GetDynamicHostVolumeConstraint>
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    hostPath String
    (string) - The path on disk where the volume exists.
    id String
    name String
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    nodeId String
    (string) - A specific node where the volume is mounted.
    nodePool String
    (string: <optional>) - The node pool of the node where the volume is mounted.
    parameters Map<String,String>
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    pluginId String
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    state String
    namespace String
    (string) - The namespace of the volume.
    capabilities GetDynamicHostVolumeCapability[]
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity string
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    capacityBytes number
    (int) - The size of the volume, in bytes.
    capacityMax string
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMaxBytes number
    (string) - The requested maximum capacity of the volume, in bytes.
    capacityMin string
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMinBytes number
    (string) - The requested minimum capacity of the volume, in bytes.
    constraints GetDynamicHostVolumeConstraint[]
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    hostPath string
    (string) - The path on disk where the volume exists.
    id string
    name string
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    nodeId string
    (string) - A specific node where the volume is mounted.
    nodePool string
    (string: <optional>) - The node pool of the node where the volume is mounted.
    parameters {[key: string]: string}
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    pluginId string
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    state string
    namespace string
    (string) - The namespace of the volume.
    capabilities Sequence[GetDynamicHostVolumeCapability]
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity str
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    capacity_bytes int
    (int) - The size of the volume, in bytes.
    capacity_max str
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacity_max_bytes int
    (string) - The requested maximum capacity of the volume, in bytes.
    capacity_min str
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacity_min_bytes int
    (string) - The requested minimum capacity of the volume, in bytes.
    constraints Sequence[GetDynamicHostVolumeConstraint]
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    host_path str
    (string) - The path on disk where the volume exists.
    id str
    name str
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    node_id str
    (string) - A specific node where the volume is mounted.
    node_pool str
    (string: <optional>) - The node pool of the node where the volume is mounted.
    parameters Mapping[str, str]
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    plugin_id str
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    state str
    namespace str
    (string) - The namespace of the volume.
    capabilities List<Property Map>
    (block) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity String
    (string) - The size of the volume, in human-friendly format (ex. 10 GiB)
    capacityBytes Number
    (int) - The size of the volume, in bytes.
    capacityMax String
    (string) - The requested maximum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMaxBytes Number
    (string) - The requested maximum capacity of the volume, in bytes.
    capacityMin String
    (string) - The requested minimum capacity of the volume, in human-friendly format (ex. 10 GiB).
    capacityMinBytes Number
    (string) - The requested minimum capacity of the volume, in bytes.
    constraints List<Property Map>
    (block) - The restrictions used to place the volume on a node, similar to the [constraint][] block on a Nomad job specification. A volume may have multiple constraint blocks. Each constraint block has the following attributes.
    hostPath String
    (string) - The path on disk where the volume exists.
    id String
    name String
    (string) - The name of the volume, which is used as the [volume.source][volume_source] field in job specifications that claim this volume. Host volume names are be unique per node. Names are visible to any user with node:read ACL, even across namespaces, so they should not be treated as sensitive values.
    nodeId String
    (string) - A specific node where the volume is mounted.
    nodePool String
    (string: <optional>) - The node pool of the node where the volume is mounted.
    parameters Map<String>
    (map<string|string>) - A key-value map of strings passed directly to the plugin to configure the volume. The details of these parameters are specific to the plugin.
    pluginId String
    (string: <required>) - The ID of the [dynamic host volume plugin][dhv_plugin] that manages this volume.
    state String
    namespace String
    (string) - The namespace of the volume.

    Supporting Types

    GetDynamicHostVolumeCapability

    AccessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    AttachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    AccessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    AttachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode String
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode String
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    access_mode str
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachment_mode str
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode String
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode String
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.

    GetDynamicHostVolumeConstraint

    Attribute string
    (string) - The [node attribute][] to check for the constraint.
    Operator string
    (string)- The operator to use in the comparison.
    Value string
    (string) - The value of the attribute to compare against.
    Attribute string
    (string) - The [node attribute][] to check for the constraint.
    Operator string
    (string)- The operator to use in the comparison.
    Value string
    (string) - The value of the attribute to compare against.
    attribute String
    (string) - The [node attribute][] to check for the constraint.
    operator String
    (string)- The operator to use in the comparison.
    value String
    (string) - The value of the attribute to compare against.
    attribute string
    (string) - The [node attribute][] to check for the constraint.
    operator string
    (string)- The operator to use in the comparison.
    value string
    (string) - The value of the attribute to compare against.
    attribute str
    (string) - The [node attribute][] to check for the constraint.
    operator str
    (string)- The operator to use in the comparison.
    value str
    (string) - The value of the attribute to compare against.
    attribute String
    (string) - The [node attribute][] to check for the constraint.
    operator String
    (string)- The operator to use in the comparison.
    value String
    (string) - The value of the attribute to compare against.

    Package Details

    Repository
    HashiCorp Nomad pulumi/pulumi-nomad
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nomad Terraform Provider.
    nomad logo
    Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate