1. Packages
  2. Nomad Provider
  3. API Docs
  4. getJob
Nomad v2.4.3 published on Saturday, Mar 15, 2025 by Pulumi

nomad.getJob

Explore with Pulumi AI

Nomad v2.4.3 published on Saturday, Mar 15, 2025 by Pulumi

Get information on a job ID. The aim of this datasource is to enable you to act on various settings and states of a particular job.

An error is triggered if zero or more than one result is returned by the query.

Example Usage

Get the data about a snapshot:

import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const example = nomad.getJob({
    jobId: "example",
    namespace: "dev",
});
Copy
import pulumi
import pulumi_nomad as nomad

example = nomad.get_job(job_id="example",
    namespace="dev")
Copy
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.LookupJob(ctx, &nomad.LookupJobArgs{
			JobId:     "example",
			Namespace: pulumi.StringRef("dev"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nomad = Pulumi.Nomad;

return await Deployment.RunAsync(() => 
{
    var example = Nomad.GetJob.Invoke(new()
    {
        JobId = "example",
        Namespace = "dev",
    });

});
Copy
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.GetJobArgs;
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.getJob(GetJobArgs.builder()
            .jobId("example")
            .namespace("dev")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: nomad:getJob
      arguments:
        jobId: example
        namespace: dev
Copy

Using getJob

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 getJob(args: GetJobArgs, opts?: InvokeOptions): Promise<GetJobResult>
function getJobOutput(args: GetJobOutputArgs, opts?: InvokeOptions): Output<GetJobResult>
Copy
def get_job(job_id: Optional[str] = None,
            namespace: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetJobResult
def get_job_output(job_id: Optional[pulumi.Input[str]] = None,
            namespace: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetJobResult]
Copy
func LookupJob(ctx *Context, args *LookupJobArgs, opts ...InvokeOption) (*LookupJobResult, error)
func LookupJobOutput(ctx *Context, args *LookupJobOutputArgs, opts ...InvokeOption) LookupJobResultOutput
Copy

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

public static class GetJob 
{
    public static Task<GetJobResult> InvokeAsync(GetJobArgs args, InvokeOptions? opts = null)
    public static Output<GetJobResult> Invoke(GetJobInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetJobResult> getJob(GetJobArgs args, InvokeOptions options)
public static Output<GetJobResult> getJob(GetJobArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: nomad:index/getJob:getJob
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

JobId This property is required. string
(string) ID of the job.
Namespace string
(string) Namespace of the specified job.
JobId This property is required. string
(string) ID of the job.
Namespace string
(string) Namespace of the specified job.
jobId This property is required. String
(string) ID of the job.
namespace String
(string) Namespace of the specified job.
jobId This property is required. string
(string) ID of the job.
namespace string
(string) Namespace of the specified job.
job_id This property is required. str
(string) ID of the job.
namespace str
(string) Namespace of the specified job.
jobId This property is required. String
(string) ID of the job.
namespace String
(string) Namespace of the specified job.

getJob Result

The following output properties are available:

AllAtOnce bool
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
Constraints List<GetJobConstraint>
CreateIndex int
(integer) Creation Index.
Datacenters List<string>
(list of strings) Datacenters allowed to run the specified job.
Id string
The provider-assigned unique ID for this managed resource.
JobId string
JobModifyIndex int
(integer) Job modify index (used for version verification).
ModifyIndex int
(integer) Modification Index.
Name string
(string) Name of the job.
ParentId string
(string) Job's parent ID.
PeriodicConfigs List<GetJobPeriodicConfig>
(list of maps) Job's periodic configuration (time based scheduling).
Priority int
(integer) Used for the prioritization of scheduling and resource access.
Region string
(string) Region where the Nomad cluster resides.
Stable bool
(boolean) Job stability status.
Status string
(string) Execution status of the specified job.
StatusDescription string
(string) Status description of the specified job.
Stop bool
(boolean) Job enabled status.
SubmitTime int
(integer) Job submission date.
TaskGroups List<GetJobTaskGroup>
(list of maps) A list of of the job's task groups.
Type string
(string) Scheduler type used during job creation.
Version int
(integer) Version of the specified job.
Namespace string
AllAtOnce bool
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
Constraints []GetJobConstraint
CreateIndex int
(integer) Creation Index.
Datacenters []string
(list of strings) Datacenters allowed to run the specified job.
Id string
The provider-assigned unique ID for this managed resource.
JobId string
JobModifyIndex int
(integer) Job modify index (used for version verification).
ModifyIndex int
(integer) Modification Index.
Name string
(string) Name of the job.
ParentId string
(string) Job's parent ID.
PeriodicConfigs []GetJobPeriodicConfig
(list of maps) Job's periodic configuration (time based scheduling).
Priority int
(integer) Used for the prioritization of scheduling and resource access.
Region string
(string) Region where the Nomad cluster resides.
Stable bool
(boolean) Job stability status.
Status string
(string) Execution status of the specified job.
StatusDescription string
(string) Status description of the specified job.
Stop bool
(boolean) Job enabled status.
SubmitTime int
(integer) Job submission date.
TaskGroups []GetJobTaskGroup
(list of maps) A list of of the job's task groups.
Type string
(string) Scheduler type used during job creation.
Version int
(integer) Version of the specified job.
Namespace string
allAtOnce Boolean
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
constraints List<GetJobConstraint>
createIndex Integer
(integer) Creation Index.
datacenters List<String>
(list of strings) Datacenters allowed to run the specified job.
id String
The provider-assigned unique ID for this managed resource.
jobId String
jobModifyIndex Integer
(integer) Job modify index (used for version verification).
modifyIndex Integer
(integer) Modification Index.
name String
(string) Name of the job.
parentId String
(string) Job's parent ID.
periodicConfigs List<GetJobPeriodicConfig>
(list of maps) Job's periodic configuration (time based scheduling).
priority Integer
(integer) Used for the prioritization of scheduling and resource access.
region String
(string) Region where the Nomad cluster resides.
stable Boolean
(boolean) Job stability status.
status String
(string) Execution status of the specified job.
statusDescription String
(string) Status description of the specified job.
stop Boolean
(boolean) Job enabled status.
submitTime Integer
(integer) Job submission date.
taskGroups List<GetJobTaskGroup>
(list of maps) A list of of the job's task groups.
type String
(string) Scheduler type used during job creation.
version Integer
(integer) Version of the specified job.
namespace String
allAtOnce boolean
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
constraints GetJobConstraint[]
createIndex number
(integer) Creation Index.
datacenters string[]
(list of strings) Datacenters allowed to run the specified job.
id string
The provider-assigned unique ID for this managed resource.
jobId string
jobModifyIndex number
(integer) Job modify index (used for version verification).
modifyIndex number
(integer) Modification Index.
name string
(string) Name of the job.
parentId string
(string) Job's parent ID.
periodicConfigs GetJobPeriodicConfig[]
(list of maps) Job's periodic configuration (time based scheduling).
priority number
(integer) Used for the prioritization of scheduling and resource access.
region string
(string) Region where the Nomad cluster resides.
stable boolean
(boolean) Job stability status.
status string
(string) Execution status of the specified job.
statusDescription string
(string) Status description of the specified job.
stop boolean
(boolean) Job enabled status.
submitTime number
(integer) Job submission date.
taskGroups GetJobTaskGroup[]
(list of maps) A list of of the job's task groups.
type string
(string) Scheduler type used during job creation.
version number
(integer) Version of the specified job.
namespace string
all_at_once bool
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
constraints Sequence[GetJobConstraint]
create_index int
(integer) Creation Index.
datacenters Sequence[str]
(list of strings) Datacenters allowed to run the specified job.
id str
The provider-assigned unique ID for this managed resource.
job_id str
job_modify_index int
(integer) Job modify index (used for version verification).
modify_index int
(integer) Modification Index.
name str
(string) Name of the job.
parent_id str
(string) Job's parent ID.
periodic_configs Sequence[GetJobPeriodicConfig]
(list of maps) Job's periodic configuration (time based scheduling).
priority int
(integer) Used for the prioritization of scheduling and resource access.
region str
(string) Region where the Nomad cluster resides.
stable bool
(boolean) Job stability status.
status str
(string) Execution status of the specified job.
status_description str
(string) Status description of the specified job.
stop bool
(boolean) Job enabled status.
submit_time int
(integer) Job submission date.
task_groups Sequence[GetJobTaskGroup]
(list of maps) A list of of the job's task groups.
type str
(string) Scheduler type used during job creation.
version int
(integer) Version of the specified job.
namespace str
allAtOnce Boolean
(boolean) If the scheduler can make partial placements on oversubscribed nodes.
constraints List<Property Map>
createIndex Number
(integer) Creation Index.
datacenters List<String>
(list of strings) Datacenters allowed to run the specified job.
id String
The provider-assigned unique ID for this managed resource.
jobId String
jobModifyIndex Number
(integer) Job modify index (used for version verification).
modifyIndex Number
(integer) Modification Index.
name String
(string) Name of the job.
parentId String
(string) Job's parent ID.
periodicConfigs List<Property Map>
(list of maps) Job's periodic configuration (time based scheduling).
priority Number
(integer) Used for the prioritization of scheduling and resource access.
region String
(string) Region where the Nomad cluster resides.
stable Boolean
(boolean) Job stability status.
status String
(string) Execution status of the specified job.
statusDescription String
(string) Status description of the specified job.
stop Boolean
(boolean) Job enabled status.
submitTime Number
(integer) Job submission date.
taskGroups List<Property Map>
(list of maps) A list of of the job's task groups.
type String
(string) Scheduler type used during job creation.
version Number
(integer) Version of the specified job.
namespace String

Supporting Types

GetJobConstraint

Ltarget This property is required. string
(string) Attribute being constrained.
Operand This property is required. string
(string) Operator used to compare the attribute to the constraint.
Rtarget This property is required. string
(string) Constraint value.
Ltarget This property is required. string
(string) Attribute being constrained.
Operand This property is required. string
(string) Operator used to compare the attribute to the constraint.
Rtarget This property is required. string
(string) Constraint value.
ltarget This property is required. String
(string) Attribute being constrained.
operand This property is required. String
(string) Operator used to compare the attribute to the constraint.
rtarget This property is required. String
(string) Constraint value.
ltarget This property is required. string
(string) Attribute being constrained.
operand This property is required. string
(string) Operator used to compare the attribute to the constraint.
rtarget This property is required. string
(string) Constraint value.
ltarget This property is required. str
(string) Attribute being constrained.
operand This property is required. str
(string) Operator used to compare the attribute to the constraint.
rtarget This property is required. str
(string) Constraint value.
ltarget This property is required. String
(string) Attribute being constrained.
operand This property is required. String
(string) Operator used to compare the attribute to the constraint.
rtarget This property is required. String
(string) Constraint value.

GetJobPeriodicConfig

Enabled This property is required. bool
(boolean) If periodic scheduling is enabled for the specified job.
ProhibitOverlap This property is required. bool
(boolean) If the specified job should wait until previous instances of the job have completed.
Spec This property is required. string
(string)
SpecType This property is required. string
(string)
Timezone This property is required. string
(string) Time zone to evaluate the next launch interval against.
Enabled This property is required. bool
(boolean) If periodic scheduling is enabled for the specified job.
ProhibitOverlap This property is required. bool
(boolean) If the specified job should wait until previous instances of the job have completed.
Spec This property is required. string
(string)
SpecType This property is required. string
(string)
Timezone This property is required. string
(string) Time zone to evaluate the next launch interval against.
enabled This property is required. Boolean
(boolean) If periodic scheduling is enabled for the specified job.
prohibitOverlap This property is required. Boolean
(boolean) If the specified job should wait until previous instances of the job have completed.
spec This property is required. String
(string)
specType This property is required. String
(string)
timezone This property is required. String
(string) Time zone to evaluate the next launch interval against.
enabled This property is required. boolean
(boolean) If periodic scheduling is enabled for the specified job.
prohibitOverlap This property is required. boolean
(boolean) If the specified job should wait until previous instances of the job have completed.
spec This property is required. string
(string)
specType This property is required. string
(string)
timezone This property is required. string
(string) Time zone to evaluate the next launch interval against.
enabled This property is required. bool
(boolean) If periodic scheduling is enabled for the specified job.
prohibit_overlap This property is required. bool
(boolean) If the specified job should wait until previous instances of the job have completed.
spec This property is required. str
(string)
spec_type This property is required. str
(string)
timezone This property is required. str
(string) Time zone to evaluate the next launch interval against.
enabled This property is required. Boolean
(boolean) If periodic scheduling is enabled for the specified job.
prohibitOverlap This property is required. Boolean
(boolean) If the specified job should wait until previous instances of the job have completed.
spec This property is required. String
(string)
specType This property is required. String
(string)
timezone This property is required. String
(string) Time zone to evaluate the next launch interval against.

GetJobTaskGroup

Count This property is required. int
Meta This property is required. Dictionary<string, string>
Name This property is required. string
(string) Name of the job.
Tasks This property is required. List<GetJobTaskGroupTask>
Volumes This property is required. List<GetJobTaskGroupVolume>
Count This property is required. int
Meta This property is required. map[string]string
Name This property is required. string
(string) Name of the job.
Tasks This property is required. []GetJobTaskGroupTask
Volumes This property is required. []GetJobTaskGroupVolume
count This property is required. Integer
meta This property is required. Map<String,String>
name This property is required. String
(string) Name of the job.
tasks This property is required. List<GetJobTaskGroupTask>
volumes This property is required. List<GetJobTaskGroupVolume>
count This property is required. number
meta This property is required. {[key: string]: string}
name This property is required. string
(string) Name of the job.
tasks This property is required. GetJobTaskGroupTask[]
volumes This property is required. GetJobTaskGroupVolume[]
count This property is required. int
meta This property is required. Mapping[str, str]
name This property is required. str
(string) Name of the job.
tasks This property is required. Sequence[GetJobTaskGroupTask]
volumes This property is required. Sequence[GetJobTaskGroupVolume]
count This property is required. Number
meta This property is required. Map<String>
name This property is required. String
(string) Name of the job.
tasks This property is required. List<Property Map>
volumes This property is required. List<Property Map>

GetJobTaskGroupTask

Driver This property is required. string
Meta This property is required. Dictionary<string, string>
Name This property is required. string
(string) Name of the job.
VolumeMounts This property is required. List<GetJobTaskGroupTaskVolumeMount>
Driver This property is required. string
Meta This property is required. map[string]string
Name This property is required. string
(string) Name of the job.
VolumeMounts This property is required. []GetJobTaskGroupTaskVolumeMount
driver This property is required. String
meta This property is required. Map<String,String>
name This property is required. String
(string) Name of the job.
volumeMounts This property is required. List<GetJobTaskGroupTaskVolumeMount>
driver This property is required. string
meta This property is required. {[key: string]: string}
name This property is required. string
(string) Name of the job.
volumeMounts This property is required. GetJobTaskGroupTaskVolumeMount[]
driver This property is required. str
meta This property is required. Mapping[str, str]
name This property is required. str
(string) Name of the job.
volume_mounts This property is required. Sequence[GetJobTaskGroupTaskVolumeMount]
driver This property is required. String
meta This property is required. Map<String>
name This property is required. String
(string) Name of the job.
volumeMounts This property is required. List<Property Map>

GetJobTaskGroupTaskVolumeMount

Destination This property is required. string
ReadOnly This property is required. bool
Volume This property is required. string
Destination This property is required. string
ReadOnly This property is required. bool
Volume This property is required. string
destination This property is required. String
readOnly This property is required. Boolean
volume This property is required. String
destination This property is required. string
readOnly This property is required. boolean
volume This property is required. string
destination This property is required. str
read_only This property is required. bool
volume This property is required. str
destination This property is required. String
readOnly This property is required. Boolean
volume This property is required. String

GetJobTaskGroupVolume

Name This property is required. string
(string) Name of the job.
ReadOnly This property is required. bool
Source This property is required. string
Type This property is required. string
(string) Scheduler type used during job creation.
Name This property is required. string
(string) Name of the job.
ReadOnly This property is required. bool
Source This property is required. string
Type This property is required. string
(string) Scheduler type used during job creation.
name This property is required. String
(string) Name of the job.
readOnly This property is required. Boolean
source This property is required. String
type This property is required. String
(string) Scheduler type used during job creation.
name This property is required. string
(string) Name of the job.
readOnly This property is required. boolean
source This property is required. string
type This property is required. string
(string) Scheduler type used during job creation.
name This property is required. str
(string) Name of the job.
read_only This property is required. bool
source This property is required. str
type This property is required. str
(string) Scheduler type used during job creation.
name This property is required. String
(string) Name of the job.
readOnly This property is required. Boolean
source This property is required. String
type This property is required. String
(string) Scheduler type used during job creation.

Package Details

Repository
HashiCorp Nomad pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.
Nomad v2.4.3 published on Saturday, Mar 15, 2025 by Pulumi