Skip to content

Latest commit

 

History

History
1792 lines (1452 loc) · 79.9 KB

File metadata and controls

1792 lines (1452 loc) · 79.9 KB

JobsApi

All URIs are relative to http://127.0.0.1:4646/v1

Method HTTP request Description
deleteJob DELETE /job/{jobName}
getJob GET /job/{jobName}
getJobAllocations GET /job/{jobName}/allocations
getJobDeployment GET /job/{jobName}/deployment
getJobDeployments GET /job/{jobName}/deployments
getJobEvaluations GET /job/{jobName}/evaluations
getJobScaleStatus GET /job/{jobName}/scale
getJobSummary GET /job/{jobName}/summary
getJobVersions GET /job/{jobName}/versions
getJobs GET /jobs
postJob POST /job/{jobName}
postJobDispatch POST /job/{jobName}/dispatch
postJobEvaluate POST /job/{jobName}/evaluate
postJobParse POST /jobs/parse
postJobPeriodicForce POST /job/{jobName}/periodic/force
postJobPlan POST /job/{jobName}/plan
postJobRevert POST /job/{jobName}/revert
postJobScalingRequest POST /job/{jobName}/scale
postJobStability POST /job/{jobName}/stable
postJobValidateRequest POST /validate/job
registerJob POST /jobs

deleteJob

JobDeregisterResponse deleteJob(jobName, region, namespace, xNomadToken, idempotencyToken, purge, global)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    Boolean purge = true; // Boolean | Boolean flag indicating whether to purge allocations of the job after deleting.
    Boolean global = true; // Boolean | Boolean flag indicating whether the operation should apply to all instances of the job globally.
    try {
      JobDeregisterResponse result = apiInstance.deleteJob(jobName, region, namespace, xNomadToken, idempotencyToken, purge, global);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#deleteJob");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]
purge Boolean Boolean flag indicating whether to purge allocations of the job after deleting. [optional]
global Boolean Boolean flag indicating whether the operation should apply to all instances of the job globally. [optional]

Return type

JobDeregisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJob

Job getJob(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      Job result = apiInstance.getJob(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJob");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

Job

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobAllocations

List<AllocationListStub> getJobAllocations(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, all)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    Boolean all = true; // Boolean | Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered.
    try {
      List<AllocationListStub> result = apiInstance.getJobAllocations(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, all);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobAllocations");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]
all Boolean Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered. [optional]

Return type

List<AllocationListStub>

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobDeployment

Deployment getJobDeployment(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      Deployment result = apiInstance.getJobDeployment(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobDeployment");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

Deployment

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobDeployments

List<Deployment> getJobDeployments(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, all)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    Integer all = 56; // Integer | Flag indicating whether to constrain by job creation index or not.
    try {
      List<Deployment> result = apiInstance.getJobDeployments(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, all);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobDeployments");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]
all Integer Flag indicating whether to constrain by job creation index or not. [optional]

Return type

List<Deployment>

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobEvaluations

List<Evaluation> getJobEvaluations(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      List<Evaluation> result = apiInstance.getJobEvaluations(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobEvaluations");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

List<Evaluation>

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobScaleStatus

JobScaleStatusResponse getJobScaleStatus(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      JobScaleStatusResponse result = apiInstance.getJobScaleStatus(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobScaleStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

JobScaleStatusResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobSummary

JobSummary getJobSummary(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      JobSummary result = apiInstance.getJobSummary(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobSummary");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

JobSummary

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobVersions

JobVersionsResponse getJobVersions(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, diffs)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    Boolean diffs = true; // Boolean | Boolean flag indicating whether to compute job diffs.
    try {
      JobVersionsResponse result = apiInstance.getJobVersions(jobName, region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken, diffs);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobVersions");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]
diffs Boolean Boolean flag indicating whether to compute job diffs. [optional]

Return type

JobVersionsResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

getJobs

List<JobListStub> getJobs(region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    Integer index = 56; // Integer | If set, wait until query exceeds given index. Must be provided with WaitParam.
    String wait = "wait_example"; // String | Provided with IndexParam to wait for change.
    String stale = "stale_example"; // String | If present, results will include stale reads.
    String prefix = "prefix_example"; // String | Constrains results to jobs that start with the defined prefix
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    Integer perPage = 56; // Integer | Maximum number of results to return.
    String nextToken = "nextToken_example"; // String | Indicates where to start paging for queries that support pagination.
    try {
      List<JobListStub> result = apiInstance.getJobs(region, namespace, index, wait, stale, prefix, xNomadToken, perPage, nextToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#getJobs");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
index Integer If set, wait until query exceeds given index. Must be provided with WaitParam. [optional]
wait String Provided with IndexParam to wait for change. [optional]
stale String If present, results will include stale reads. [optional]
prefix String Constrains results to jobs that start with the defined prefix [optional]
xNomadToken String A Nomad ACL token. [optional]
perPage Integer Maximum number of results to return. [optional]
nextToken String Indicates where to start paging for queries that support pagination. [optional]

Return type

List<JobListStub>

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJob

JobRegisterResponse postJob(jobName, jobRegisterRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobRegisterRequest jobRegisterRequest = new JobRegisterRequest(); // JobRegisterRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobRegisterResponse result = apiInstance.postJob(jobName, jobRegisterRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJob");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobRegisterRequest JobRegisterRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobRegisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobDispatch

JobDispatchResponse postJobDispatch(jobName, jobDispatchRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobDispatchRequest jobDispatchRequest = new JobDispatchRequest(); // JobDispatchRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobDispatchResponse result = apiInstance.postJobDispatch(jobName, jobDispatchRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobDispatch");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobDispatchRequest JobDispatchRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobDispatchResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobEvaluate

JobRegisterResponse postJobEvaluate(jobName, jobEvaluateRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobEvaluateRequest jobEvaluateRequest = new JobEvaluateRequest(); // JobEvaluateRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobRegisterResponse result = apiInstance.postJobEvaluate(jobName, jobEvaluateRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobEvaluate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobEvaluateRequest JobEvaluateRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobRegisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobParse

Job postJobParse(jobsParseRequest)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    JobsParseRequest jobsParseRequest = new JobsParseRequest(); // JobsParseRequest | 
    try {
      Job result = apiInstance.postJobParse(jobsParseRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobParse");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobsParseRequest JobsParseRequest

Return type

Job

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobPeriodicForce

PeriodicForceResponse postJobPeriodicForce(jobName, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      PeriodicForceResponse result = apiInstance.postJobPeriodicForce(jobName, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobPeriodicForce");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

PeriodicForceResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobPlan

JobPlanResponse postJobPlan(jobName, jobPlanRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobPlanRequest jobPlanRequest = new JobPlanRequest(); // JobPlanRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobPlanResponse result = apiInstance.postJobPlan(jobName, jobPlanRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobPlan");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobPlanRequest JobPlanRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobPlanResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobRevert

JobRegisterResponse postJobRevert(jobName, jobRevertRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobRevertRequest jobRevertRequest = new JobRevertRequest(); // JobRevertRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobRegisterResponse result = apiInstance.postJobRevert(jobName, jobRevertRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobRevert");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobRevertRequest JobRevertRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobRegisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobScalingRequest

JobRegisterResponse postJobScalingRequest(jobName, scalingRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    ScalingRequest scalingRequest = new ScalingRequest(); // ScalingRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobRegisterResponse result = apiInstance.postJobScalingRequest(jobName, scalingRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobScalingRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
scalingRequest ScalingRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobRegisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobStability

JobStabilityResponse postJobStability(jobName, jobStabilityRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    String jobName = "jobName_example"; // String | The job identifier.
    JobStabilityRequest jobStabilityRequest = new JobStabilityRequest(); // JobStabilityRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobStabilityResponse result = apiInstance.postJobStability(jobName, jobStabilityRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobStability");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobName String The job identifier.
jobStabilityRequest JobStabilityRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobStabilityResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

postJobValidateRequest

JobValidateResponse postJobValidateRequest(jobValidateRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    JobValidateRequest jobValidateRequest = new JobValidateRequest(); // JobValidateRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobValidateResponse result = apiInstance.postJobValidateRequest(jobValidateRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#postJobValidateRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobValidateRequest JobValidateRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobValidateResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

registerJob

JobRegisterResponse registerJob(jobRegisterRequest, region, namespace, xNomadToken, idempotencyToken)

Example

// Import classes:
import io.nomadproject.client.ApiClient;
import io.nomadproject.client.ApiException;
import io.nomadproject.client.Configuration;
import io.nomadproject.client.auth.*;
import io.nomadproject.client.models.*;
import io.nomadproject.client.api.JobsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://127.0.0.1:4646/v1");
    
    // Configure API key authorization: X-Nomad-Token
    ApiKeyAuth X-Nomad-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-Nomad-Token");
    X-Nomad-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-Nomad-Token.setApiKeyPrefix("Token");

    JobsApi apiInstance = new JobsApi(defaultClient);
    JobRegisterRequest jobRegisterRequest = new JobRegisterRequest(); // JobRegisterRequest | 
    String region = "region_example"; // String | Filters results based on the specified region.
    String namespace = "namespace_example"; // String | Filters results based on the specified namespace.
    String xNomadToken = "xNomadToken_example"; // String | A Nomad ACL token.
    String idempotencyToken = "idempotencyToken_example"; // String | Can be used to ensure operations are only run once.
    try {
      JobRegisterResponse result = apiInstance.registerJob(jobRegisterRequest, region, namespace, xNomadToken, idempotencyToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling JobsApi#registerJob");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
jobRegisterRequest JobRegisterRequest
region String Filters results based on the specified region. [optional]
namespace String Filters results based on the specified namespace. [optional]
xNomadToken String A Nomad ACL token. [optional]
idempotencyToken String Can be used to ensure operations are only run once. [optional]

Return type

JobRegisterResponse

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 * X-Nomad-Index - A unique identifier representing the current state of the requested resource. On a new Nomad cluster the value of this index starts at 1.
* X-Nomad-KnownLeader - Boolean indicating if there is a known cluster leader.
* X-Nomad-LastContact - The time in milliseconds that a server was last contacted by the leader node.
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -