HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

getJob

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

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Nomad.GetJob.InvokeAsync(new Nomad.GetJobArgs
        {
            JobId = "example",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nomad.LookupJob(ctx, &GetJobArgs{
			JobId: "example",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_nomad as nomad

example = nomad.get_job(job_id="example")
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const example = pulumi.output(nomad.getJob({
    jobId: "example",
}));

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>
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]
func LookupJob(ctx *Context, args *LookupJobArgs, opts ...InvokeOption) (*LookupJobResult, error)
func LookupJobOutput(ctx *Context, args *LookupJobOutputArgs, opts ...InvokeOption) LookupJobResultOutput

> 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)
}

The following arguments are supported:

JobId string
Namespace string
JobId string
Namespace string
jobId string
namespace string
job_id str
namespace str

getJob Result

The following output properties are available:

AllAtOnce bool
Constraints List<GetJobConstraint>
CreateIndex int
Datacenters List<string>
Id string
The provider-assigned unique ID for this managed resource.
JobId string
JobModifyIndex int
ModifyIndex int
Name string
ParentId string
PeriodicConfigs List<GetJobPeriodicConfig>
Priority int
Region string
Stable bool
Status string
StatusDescription string
Stop bool
SubmitTime int
TaskGroups List<GetJobTaskGroup>
Type string
Version int
Namespace string
AllAtOnce bool
Constraints []GetJobConstraint
CreateIndex int
Datacenters []string
Id string
The provider-assigned unique ID for this managed resource.
JobId string
JobModifyIndex int
ModifyIndex int
Name string
ParentId string
PeriodicConfigs []GetJobPeriodicConfig
Priority int
Region string
Stable bool
Status string
StatusDescription string
Stop bool
SubmitTime int
TaskGroups []GetJobTaskGroup
Type string
Version int
Namespace string
allAtOnce boolean
constraints GetJobConstraint[]
createIndex number
datacenters string[]
id string
The provider-assigned unique ID for this managed resource.
jobId string
jobModifyIndex number
modifyIndex number
name string
parentId string
periodicConfigs GetJobPeriodicConfig[]
priority number
region string
stable boolean
status string
statusDescription string
stop boolean
submitTime number
taskGroups GetJobTaskGroup[]
type string
version number
namespace string

Supporting Types

GetJobConstraint

Ltarget string
Operand string
Rtarget string
Ltarget string
Operand string
Rtarget string
ltarget string
operand string
rtarget string
ltarget str
operand str
rtarget str

GetJobPeriodicConfig

Enabled bool
ProhibitOverlap bool
Spec string
SpecType string
Timezone string
Enabled bool
ProhibitOverlap bool
Spec string
SpecType string
Timezone string
enabled boolean
prohibitOverlap boolean
spec string
specType string
timezone string

GetJobTaskGroup

GetJobTaskGroupTask

Driver string
Meta Dictionary<string, object>
Name string
VolumeMounts List<GetJobTaskGroupTaskVolumeMount>
Driver string
Meta map[string]interface{}
Name string
VolumeMounts []GetJobTaskGroupTaskVolumeMount
driver string
meta {[key: string]: any}
name string
volumeMounts GetJobTaskGroupTaskVolumeMount[]

GetJobTaskGroupTaskVolumeMount

Destination string
ReadOnly bool
Volume string
Destination string
ReadOnly bool
Volume string
destination string
readOnly boolean
volume string

GetJobTaskGroupVolume

Name string
ReadOnly bool
Source string
Type string
Name string
ReadOnly bool
Source string
Type string
name string
readOnly boolean
source string
type string
name str
read_only bool
source str
type str

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.