Nomad v2.3.0 published on Wednesday, Jun 5, 2024 by Pulumi
nomad.getAllocations
Explore with Pulumi AI
Retrieve a list of allocations from Nomad.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";
const example = nomad.getAllocations({
    filter: "JobID == \"example\"",
});
import pulumi
import pulumi_nomad as nomad
example = nomad.get_allocations(filter="JobID == \"example\"")
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.GetAllocations(ctx, &nomad.GetAllocationsArgs{
			Filter: pulumi.StringRef("JobID == \"example\""),
		}, 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.GetAllocations.Invoke(new()
    {
        Filter = "JobID == \"example\"",
    });
});
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.GetAllocationsArgs;
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.getAllocations(GetAllocationsArgs.builder()
            .filter("JobID == \"example\"")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      Function: nomad:getAllocations
      Arguments:
        filter: JobID == "example"
Using getAllocations
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 getAllocations(args: GetAllocationsArgs, opts?: InvokeOptions): Promise<GetAllocationsResult>
function getAllocationsOutput(args: GetAllocationsOutputArgs, opts?: InvokeOptions): Output<GetAllocationsResult>def get_allocations(filter: Optional[str] = None,
                    namespace: Optional[str] = None,
                    prefix: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAllocationsResult
def get_allocations_output(filter: Optional[pulumi.Input[str]] = None,
                    namespace: Optional[pulumi.Input[str]] = None,
                    prefix: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAllocationsResult]func GetAllocations(ctx *Context, args *GetAllocationsArgs, opts ...InvokeOption) (*GetAllocationsResult, error)
func GetAllocationsOutput(ctx *Context, args *GetAllocationsOutputArgs, opts ...InvokeOption) GetAllocationsResultOutput> Note: This function is named GetAllocations in the Go SDK.
public static class GetAllocations 
{
    public static Task<GetAllocationsResult> InvokeAsync(GetAllocationsArgs args, InvokeOptions? opts = null)
    public static Output<GetAllocationsResult> Invoke(GetAllocationsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAllocationsResult> getAllocations(GetAllocationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: nomad:index/getAllocations:getAllocations
  arguments:
    # arguments dictionaryThe following arguments are supported:
getAllocations Result
The following output properties are available:
- Allocations
List<Get
Allocations Allocation>  (list of allocations)- A list of allocations matching the search criteria.- Id string
 - The provider-assigned unique ID for this managed resource.
 - Filter string
 - Namespace string
 (string)- The namespace the allocation belongs to.- Prefix string
 
- Allocations
[]Get
Allocations Allocation  (list of allocations)- A list of allocations matching the search criteria.- Id string
 - The provider-assigned unique ID for this managed resource.
 - Filter string
 - Namespace string
 (string)- The namespace the allocation belongs to.- Prefix string
 
- allocations
List<Get
Allocations Allocation>  (list of allocations)- A list of allocations matching the search criteria.- id String
 - The provider-assigned unique ID for this managed resource.
 - filter String
 - namespace String
 (string)- The namespace the allocation belongs to.- prefix String
 
- allocations
Get
Allocations Allocation[]  (list of allocations)- A list of allocations matching the search criteria.- id string
 - The provider-assigned unique ID for this managed resource.
 - filter string
 - namespace string
 (string)- The namespace the allocation belongs to.- prefix string
 
- allocations
Sequence[Get
Allocations Allocation]  (list of allocations)- A list of allocations matching the search criteria.- id str
 - The provider-assigned unique ID for this managed resource.
 - filter str
 - namespace str
 (string)- The namespace the allocation belongs to.- prefix str
 
- allocations List<Property Map>
 (list of allocations)- A list of allocations matching the search criteria.- id String
 - The provider-assigned unique ID for this managed resource.
 - filter String
 - namespace String
 (string)- The namespace the allocation belongs to.- prefix String
 
Supporting Types
GetAllocationsAllocation  
- Client
Status string (string)- The current client status of the allocation.- Create
Index int (int)- The Raft index in which the allocation was created.- Create
Time int (int)- The timestamp of when the allocation was created.- Desired
Status string (string)- The current desired status of the allocation.- Eval
Id string (string)- The ID of the evaluation that generated the allocation.- Followup
Eval stringId  (string)- The ID of the evaluation that succeeds the allocation evaluation.- Id string
 (string)- The ID of the allocation.- Job
Id string (string)- The ID of the job related to the allocation.- Job
Type string (string)- The type of the job related to the allocation.- Job
Version int (int)- The version of the job that generated the allocation.- Modify
Index int (int)- The Raft index in which the allocation was last modified.- Modify
Time int (int)- The timestamp of when the allocation was last modified.- Name string
 (string)- The name of the allocation.- Namespace string
 (string: <optional>)- Specifies the namespace to search for allocations in.- Next
Allocation string (string)- The ID of the allocation that succeeds the allocation.- Node
Id string (string)- The ID of the node to which the allocation was scheduled.- Node
Name string (string)- The ID of the node to which the allocation was scheduled.- Preempted
By stringAllocation  (string)- The ID of the allocation that preempted the allocation.- Task
Group string (string)- The job task group related to the allocation.
- Client
Status string (string)- The current client status of the allocation.- Create
Index int (int)- The Raft index in which the allocation was created.- Create
Time int (int)- The timestamp of when the allocation was created.- Desired
Status string (string)- The current desired status of the allocation.- Eval
Id string (string)- The ID of the evaluation that generated the allocation.- Followup
Eval stringId  (string)- The ID of the evaluation that succeeds the allocation evaluation.- Id string
 (string)- The ID of the allocation.- Job
Id string (string)- The ID of the job related to the allocation.- Job
Type string (string)- The type of the job related to the allocation.- Job
Version int (int)- The version of the job that generated the allocation.- Modify
Index int (int)- The Raft index in which the allocation was last modified.- Modify
Time int (int)- The timestamp of when the allocation was last modified.- Name string
 (string)- The name of the allocation.- Namespace string
 (string: <optional>)- Specifies the namespace to search for allocations in.- Next
Allocation string (string)- The ID of the allocation that succeeds the allocation.- Node
Id string (string)- The ID of the node to which the allocation was scheduled.- Node
Name string (string)- The ID of the node to which the allocation was scheduled.- Preempted
By stringAllocation  (string)- The ID of the allocation that preempted the allocation.- Task
Group string (string)- The job task group related to the allocation.
- client
Status String (string)- The current client status of the allocation.- create
Index Integer (int)- The Raft index in which the allocation was created.- create
Time Integer (int)- The timestamp of when the allocation was created.- desired
Status String (string)- The current desired status of the allocation.- eval
Id String (string)- The ID of the evaluation that generated the allocation.- followup
Eval StringId  (string)- The ID of the evaluation that succeeds the allocation evaluation.- id String
 (string)- The ID of the allocation.- job
Id String (string)- The ID of the job related to the allocation.- job
Type String (string)- The type of the job related to the allocation.- job
Version Integer (int)- The version of the job that generated the allocation.- modify
Index Integer (int)- The Raft index in which the allocation was last modified.- modify
Time Integer (int)- The timestamp of when the allocation was last modified.- name String
 (string)- The name of the allocation.- namespace String
 (string: <optional>)- Specifies the namespace to search for allocations in.- next
Allocation String (string)- The ID of the allocation that succeeds the allocation.- node
Id String (string)- The ID of the node to which the allocation was scheduled.- node
Name String (string)- The ID of the node to which the allocation was scheduled.- preempted
By StringAllocation  (string)- The ID of the allocation that preempted the allocation.- task
Group String (string)- The job task group related to the allocation.
- client
Status string (string)- The current client status of the allocation.- create
Index number (int)- The Raft index in which the allocation was created.- create
Time number (int)- The timestamp of when the allocation was created.- desired
Status string (string)- The current desired status of the allocation.- eval
Id string (string)- The ID of the evaluation that generated the allocation.- followup
Eval stringId  (string)- The ID of the evaluation that succeeds the allocation evaluation.- id string
 (string)- The ID of the allocation.- job
Id string (string)- The ID of the job related to the allocation.- job
Type string (string)- The type of the job related to the allocation.- job
Version number (int)- The version of the job that generated the allocation.- modify
Index number (int)- The Raft index in which the allocation was last modified.- modify
Time number (int)- The timestamp of when the allocation was last modified.- name string
 (string)- The name of the allocation.- namespace string
 (string: <optional>)- Specifies the namespace to search for allocations in.- next
Allocation string (string)- The ID of the allocation that succeeds the allocation.- node
Id string (string)- The ID of the node to which the allocation was scheduled.- node
Name string (string)- The ID of the node to which the allocation was scheduled.- preempted
By stringAllocation  (string)- The ID of the allocation that preempted the allocation.- task
Group string (string)- The job task group related to the allocation.
- client_
status str (string)- The current client status of the allocation.- create_
index int (int)- The Raft index in which the allocation was created.- create_
time int (int)- The timestamp of when the allocation was created.- desired_
status str (string)- The current desired status of the allocation.- eval_
id str (string)- The ID of the evaluation that generated the allocation.- followup_
eval_ strid  (string)- The ID of the evaluation that succeeds the allocation evaluation.- id str
 (string)- The ID of the allocation.- job_
id str (string)- The ID of the job related to the allocation.- job_
type str (string)- The type of the job related to the allocation.- job_
version int (int)- The version of the job that generated the allocation.- modify_
index int (int)- The Raft index in which the allocation was last modified.- modify_
time int (int)- The timestamp of when the allocation was last modified.- name str
 (string)- The name of the allocation.- namespace str
 (string: <optional>)- Specifies the namespace to search for allocations in.- next_
allocation str (string)- The ID of the allocation that succeeds the allocation.- node_
id str (string)- The ID of the node to which the allocation was scheduled.- node_
name str (string)- The ID of the node to which the allocation was scheduled.- preempted_
by_ strallocation  (string)- The ID of the allocation that preempted the allocation.- task_
group str (string)- The job task group related to the allocation.
- client
Status String (string)- The current client status of the allocation.- create
Index Number (int)- The Raft index in which the allocation was created.- create
Time Number (int)- The timestamp of when the allocation was created.- desired
Status String (string)- The current desired status of the allocation.- eval
Id String (string)- The ID of the evaluation that generated the allocation.- followup
Eval StringId  (string)- The ID of the evaluation that succeeds the allocation evaluation.- id String
 (string)- The ID of the allocation.- job
Id String (string)- The ID of the job related to the allocation.- job
Type String (string)- The type of the job related to the allocation.- job
Version Number (int)- The version of the job that generated the allocation.- modify
Index Number (int)- The Raft index in which the allocation was last modified.- modify
Time Number (int)- The timestamp of when the allocation was last modified.- name String
 (string)- The name of the allocation.- namespace String
 (string: <optional>)- Specifies the namespace to search for allocations in.- next
Allocation String (string)- The ID of the allocation that succeeds the allocation.- node
Id String (string)- The ID of the node to which the allocation was scheduled.- node
Name String (string)- The ID of the node to which the allocation was scheduled.- preempted
By StringAllocation  (string)- The ID of the allocation that preempted the allocation.- task
Group String (string)- The job task group related to the allocation.
Package Details
- Repository
 - HashiCorp Nomad pulumi/pulumi-nomad
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
nomadTerraform Provider.