NomadClient.Api.Jobs (nomad_client v0.12.1)
API calls for all endpoints tagged Jobs
.
Link to this section Summary
Functions
dispatches a new instance of a parameterized job
creates a new evaluation for the given job. This can be used to force run the scheduling logic if necessary
forces a new instance of the periodic job. A new instance will be created even if it violates the job's prohibit_overlap settings. As such, this should be only used to immediately run a periodic job
reads information about a single job for its specification and status
reads information about a single job's allocations
lists a single job's deployments
reads information about a single job's evaluations
get a single job's most recent deployment
reads scale information about a job
reads summary information about a job
reads information about all versions of a job
lists all known jobs in the system registered with Nomad
parse a HCL jobspec and produce the equivalent JSON encoded job
invokes a dry-run of the scheduler for the job
creates (aka "registers") a new job in the system
reverts the job to an older version
performs a scaling action against a job. Currently, this endpoint supports scaling the count for a task group
sets the job's stability
deregisters a job, and stops all allocations part of it
registers a new job or updates an existing job
validate object structs, fields, and types
Link to this section Functions
dispatch_job(connection, job_id, job_dispatch_request, opts \\ [])
Specs
dispatch_job( Tesla.Env.client(), String.t(), NomadClient.Model.JobDispatchRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobDispatchResponse.t()} | {:error, Tesla.Env.t()}
dispatches a new instance of a parameterized job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- job_dispatch_request (JobDispatchRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
evaluate_job(connection, job_id, job_evaluate_request, opts \\ [])
Specs
evaluate_job( Tesla.Env.client(), String.t(), NomadClient.Model.JobEvaluateRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobRegisterResponse.t()} | {:error, Tesla.Env.t()}
creates a new evaluation for the given job. This can be used to force run the scheduling logic if necessary
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- job_evaluate_request (JobEvaluateRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
force_new_periodic_instance(connection, job_id, opts \\ [])
Specs
force_new_periodic_instance(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.PeriodicForceResponse.t()} | {:error, Tesla.Env.t()}
forces a new instance of the periodic job. A new instance will be created even if it violates the job's prohibit_overlap settings. As such, this should be only used to immediately run a periodic job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_job(connection, job_id, opts \\ [])
Specs
get_job(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.Job.t()} | {:error, Tesla.Env.t()}
reads information about a single job for its specification and status
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_job_allocations(connection, job_id, opts \\ [])
Specs
get_job_allocations(Tesla.Env.client(), String.t(), keyword()) :: {:ok, [NomadClient.Model.AllocationListStub.t()]} | {:error, Tesla.Env.t()}
reads information about a single job's allocations
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
, ...]} on success {:error, Tesla.Env.t} on failure
get_job_deployments(connection, job_id, opts \\ [])
Specs
get_job_deployments(Tesla.Env.client(), String.t(), keyword()) :: {:ok, [NomadClient.Model.Deployment.t()]} | {:error, Tesla.Env.t()}
lists a single job's deployments
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
, ...]} on success {:error, Tesla.Env.t} on failure
get_job_evaluations(connection, job_id, opts \\ [])
Specs
get_job_evaluations(Tesla.Env.client(), String.t(), keyword()) :: {:ok, [NomadClient.Model.Evaluation.t()]} | {:error, Tesla.Env.t()}
reads information about a single job's evaluations
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
, ...]} on success {:error, Tesla.Env.t} on failure
get_job_latest_deployment(connection, job_id, opts \\ [])
Specs
get_job_latest_deployment(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.Deployment.t()} | {:error, Tesla.Env.t()}
get a single job's most recent deployment
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_job_scale_status(connection, job_id, opts \\ [])
Specs
get_job_scale_status(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.JobScaleStatusResponse.t()} | {:error, Tesla.Env.t()}
reads scale information about a job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_job_summary(connection, job_id, opts \\ [])
Specs
get_job_summary(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.JobSummary.t()} | {:error, Tesla.Env.t()}
reads summary information about a job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_job_versions(connection, job_id, opts \\ [])
Specs
get_job_versions(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.JobVersionsResponse.t()} | {:error, Tesla.Env.t()}
reads information about all versions of a job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
get_jobs(connection, opts \\ [])
Specs
get_jobs(Tesla.Env.client(), keyword()) :: {:ok, [NomadClient.Model.JobListStub.t()]} | {:error, Tesla.Env.t()}
lists all known jobs in the system registered with Nomad
Parameters
- connection (NomadClient.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
, ...]} on success {:error, Tesla.Env.t} on failure
parse_job_hcl(connection, jobs_parse_request, opts \\ [])
Specs
parse_job_hcl( Tesla.Env.client(), NomadClient.Model.JobsParseRequest.t(), keyword() ) :: {:ok, NomadClient.Model.Job.t()} | {:error, Tesla.Env.t()}
parse a HCL jobspec and produce the equivalent JSON encoded job
Parameters
- connection (NomadClient.Connection): Connection to server
- jobs_parse_request (JobsParseRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
plan_job(connection, job_id, job_plan_request, opts \\ [])
Specs
plan_job( Tesla.Env.client(), String.t(), NomadClient.Model.JobPlanRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobPlanResponse.t()} | {:error, Tesla.Env.t()}
invokes a dry-run of the scheduler for the job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- job_plan_request (JobPlanRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
register_job(connection, register_job_request, opts \\ [])
Specs
register_job( Tesla.Env.client(), NomadClient.Model.RegisterJobRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobRegisterResponse.t()} | {:error, Tesla.Env.t()}
creates (aka "registers") a new job in the system
Parameters
- connection (NomadClient.Connection): Connection to server
- register_job_request (RegisterJobRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
revert_job(connection, job_id, job_revert_request, opts \\ [])
Specs
revert_job( Tesla.Env.client(), String.t(), NomadClient.Model.JobRevertRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobRegisterResponse.t()} | {:error, Tesla.Env.t()}
reverts the job to an older version
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- job_revert_request (JobRevertRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
scale_task_group(connection, job_id, scaling_request, opts \\ [])
Specs
scale_task_group( Tesla.Env.client(), String.t(), NomadClient.Model.ScalingRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobRegisterResponse.t()} | {:error, Tesla.Env.t()}
performs a scaling action against a job. Currently, this endpoint supports scaling the count for a task group
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- scaling_request (ScalingRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
set_job_stability(connection, job_id, job_stability_request, opts \\ [])
Specs
set_job_stability( Tesla.Env.client(), String.t(), NomadClient.Model.JobStabilityRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobStabilityResponse.t()} | {:error, Tesla.Env.t()}
sets the job's stability
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- job_stability_request (JobStabilityRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
stop_job(connection, job_id, opts \\ [])
Specs
stop_job(Tesla.Env.client(), String.t(), keyword()) :: {:ok, NomadClient.Model.JobDeregisterResponse.t()} | {:error, Tesla.Env.t()}
deregisters a job, and stops all allocations part of it
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- opts (KeywordList): [optional] Optional parameters
on success {:error, Tesla.Env.t} on failure
update_job(connection, job_id, register_job_request, opts \\ [])
Specs
update_job( Tesla.Env.client(), String.t(), NomadClient.Model.RegisterJobRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobRegisterResponse.t()} | {:error, Tesla.Env.t()}
registers a new job or updates an existing job
Parameters
- connection (NomadClient.Connection): Connection to server
- job_id (String.t): job id
- register_job_request (RegisterJobRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure
validate_job(connection, job_validate_request, opts \\ [])
Specs
validate_job( Tesla.Env.client(), NomadClient.Model.JobValidateRequest.t(), keyword() ) :: {:ok, NomadClient.Model.JobValidateResponse.t()} | {:error, Tesla.Env.t()}
validate object structs, fields, and types
Parameters
- connection (NomadClient.Connection): Connection to server
- job_validate_request (JobValidateRequest):
- opts (KeywordList): [optional] Optional parameters
Returns
on success {:error, Tesla.Env.t} on failure