June 20-22 Announcing HashiConf Europe full schedule: keynotes, sessions, labs & more Register Now
  • Overview
    • Batch Processing Workloads
    • Edge Workload Management
    • Non-Containerized Application Orchestration
    • Simple Container Orchestration
  • Enterprise
  • Tutorials
  • Docs
  • API
  • Plugins
  • Tools
  • Community
GitHub—Stars on GitHub
Download
    • v1.3.x (latest)
    • v1.2.x
    • v1.1.x
    • v1.0.x
    • v0.12.x
    • v0.11.x
  • HTTP API Overview

  • Libraries & SDKs
  • JSON Jobs

  • ACL Policies
  • ACL Tokens
  • Agent
  • Allocations
  • Client
  • Deployments
  • Evaluations
  • Events
  • Jobs
  • Namespaces
  • Nodes
  • Metrics
    • Overview
    • Autopilot
    • Raft
    • License
    • Scheduler
    • Snapshot
  • Plugins
  • Quotas
  • Recommendations
  • Regions
  • Scaling Policies
  • Search
  • Sentinel Policies
  • Services
  • Status
  • System
  • UI
  • Validate
  • Volumes
Type '/' to Search

»Validate HTTP API

The /validate endpoints are used to validate object structs, fields, and types.

»Validate Job

This endpoint validates a Nomad job file. The local Nomad agent forwards the request to a server. In the event a server can't be reached the agent verifies the job file locally but skips validating driver configurations.

This endpoint accepts a JSON job file, not an HCL job file.

MethodPathProduces
POST/v1/validate/jobapplication/json

The table below shows this endpoint's support for blocking queries and required ACLs.

Blocking QueriesACL Required
NOnamespace:read-job

»Parameters

There are no parameters, but the request body contains the entire job file.

»Sample Payload

(any valid nomad job IN JSON FORMAT)
(any valid nomad job IN JSON FORMAT)

»Sample Request

$ curl \
    --request POST \
    --data @my-job.nomad \
    https://localhost:4646/v1/validate/job
$ curl \
    --request POST \
    --data @my-job.nomad \
    https://localhost:4646/v1/validate/job

»Sample Response

{
  "DriverConfigValidated": true,
  "ValidationErrors": [
    "Task group cache validation failed: 1 error(s) occurred:\n\n* Task redis validation failed: 1 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* minimum CPU value is 20; got 1"
  ],
  "Warnings": "1 warning(s):\n\n* Group \"cache\" has warnings: 1 error(s) occurred:\n\n* Update max parallel count is greater than task group count (13 > 1). A destructive change would result in the simultaneous replacement of all allocations.",
  "Error": "1 error(s) occurred:\n\n* Task group cache validation failed: 1 error(s) occurred:\n\n* Task redis validation failed: 1 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* minimum CPU value is 20; got 1"
}
{
  "DriverConfigValidated": true,
  "ValidationErrors": [
    "Task group cache validation failed: 1 error(s) occurred:\n\n* Task redis validation failed: 1 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* minimum CPU value is 20; got 1"
  ],
  "Warnings": "1 warning(s):\n\n* Group \"cache\" has warnings: 1 error(s) occurred:\n\n* Update max parallel count is greater than task group count (13 > 1). A destructive change would result in the simultaneous replacement of all allocations.",
  "Error": "1 error(s) occurred:\n\n* Task group cache validation failed: 1 error(s) occurred:\n\n* Task redis validation failed: 1 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* minimum CPU value is 20; got 1"
}
github logoEdit this page
DocsAPIResourcesPrivacySecurityPress KitConsent Manager