{
  "openapi": "3.0.1",
  "info": {
    "title": "Jobs",
    "version": "9.1.20.0",
    "description": "Create and administer scheduler job records.",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Jobs",
      "description": "Provides RESTful services to manage scheduler job records."
    }
  ],
  "paths": {
    "/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get a collection of scheduler jobs.",
        "description": "Get a collection of scheduler jobs.",
        "operationId": "Job-get",
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "description": "The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store of the scheduler job. This field can only be assigned during job creation time.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobCollection"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Jobs"
        ],
        "summary": "Create a scheduler job.",
        "description": "Create a scheduler job.",
        "operationId": "Job-post",
        "requestBody": {
          "description": "Request body. The \"id\" field will be generated and it should not be part of the request body. The \"userId\" and \"activeState\" fields are managed and it cannot be specified.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Job"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The requested resource has been created.",
            "content": {},
            "headers": {
              "Location": {
                "description": "The URI of the job.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "CreateJobNewVersionByJobId": {
                "operationRef": "#/paths/~1jobs~1{id}~1new-version/post",
                "parameters": {
                  "id": "$response.header.Location#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `POST /jobs/{id}/new-version`.\n"
              },
              "GetJobsByJobId": {
                "operationRef": "#/paths/~1jobs~1{id}/get",
                "parameters": {
                  "id": "$response.header.Location#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `GET /jobs/{id}`.\n"
              },
              "DeleteJobsByJobId": {
                "operationRef": "#/paths/~1jobs~1{id}/delete",
                "parameters": {
                  "id": "$response.header.Location#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `DELETE /jobs/{id}`.\n"
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/jobs/{id}/new-version": {
      "post": {
        "tags": [
          "Jobs"
        ],
        "summary": "Edit a scheduler job.",
        "description": "Edit a scheduler job.",
        "operationId": "Job-createNewVersionJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the scheduler job.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Request body. The \"userId\" and \"activeState\" fields are managed and it cannot be specified.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Job"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The requested resource has been created.",
            "headers": {
              "Location": {
                "description": "Link to the newly created resource.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {}
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/jobs/{id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get a scheduler job by ID.",
        "description": "Get a scheduler job by ID.",
        "operationId": "Job-getById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the scheduler job.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Jobs"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Jobs"
        ],
        "summary": "Delete a job by ID.",
        "description": "Delete a scheduler job by ID",
        "operationId": "Job-delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the scheduler job.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The requested resource has been deleted.",
            "content": {}
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponseContainer": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "requestId": {
            "type": "string",
            "description": "The request identifier."
          }
        },
        "description": "The error message model."
      },
      "Error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "The error message code."
          },
          "errorMessage": {
            "type": "string",
            "description": "The error message."
          },
          "errorKey": {
            "type": "string",
            "description": "The error message key."
          },
          "errorParameters": {
            "type": "array",
            "description": "The arguments used to construct the error message.",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "errorLevel": {
            "type": "string",
            "description": "The error level."
          },
          "errorHref": {
            "type": "string",
            "description": "The error hypertext reference."
          }
        },
        "description": "The error message item model."
      },
      "JobCollection": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "The total number of item records that match the query parameters.",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "description": "The items.",
            "items": {
              "$ref": "#/components/schemas/Jobs"
            }
          }
        }
      },
      "Jobs": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique numeric ID for identifying the job."
          },
          "activeState": {
            "type": "string",
            "description": "The flag to indicate whether the scheduled job is active or not. Available values:<br>  A - The job is active and is scheduled to run after the configured interval elapses.<br>  D - The job has been disabled or completed."
          },
          "command": {
            "type": "string",
            "description": "The path information of the command that is to run for the job."
          },
          "interfaceName": {
            "type": "string",
            "description": "The interface name of the check command to be run before the command is run.  See SCHCONFIG table, INTERFACENAME column."
          },
          "host": {
            "type": "string",
            "description": "The name of the host that is allowed to run the job. If the value is null, the job can be run by any host. Use this parameter when you run jobs on multiple hosts and need to restrict a job to run a asingle host. The host name must be in the form \"name.domain\"."
          },
          "interval": {
            "type": "integer",
            "description": "The repeating interval (in seconds) between successive runs of this job. If the value is null, the job runs only once.",
            "format": "int32"
          },
          "jobType": {
            "type": "string",
            "description": "The type of the application thread pool where the scheduled job is included. This type is used to constrain resource-intensive jobs to a limited number of threads. The default application type is null."
          },
          "preferredStartDateTime": {
            "type": "string",
            "description": "The preferred date and time for when the job should start. The date and time must be entered as a timestamp in the ISO 8601 format \"YYYY-MM-DDThh:mm:ssZ\".",
            "format": "date-time"
          },
          "priority": {
            "type": "integer",
            "description": "The priority of the scheduled job.",
            "format": "int32"
          },
          "query": {
            "type": "string",
            "description": "The query string containing information used by the scheduled job."
          },
          "fixedTime": {
            "type": "integer",
            "description": "A flag indicating whether the job contained the fixed time parameter or not.  ie. 1 if fixedTime=1 exists, 0 otherwise.",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "description": "The description of the CustomJob being added.  This is the SCCDESCRIPTION column in the SCHCONFIG table."
          },
          "retryAttempts": {
            "type": "integer",
            "description": "The number of times that the job can be retried when the job fails. Both the retryAttempts and the retryDelay parameters need a value for a job to be retried.",
            "format": "int32"
          },
          "retryDelay": {
            "type": "integer",
            "description": "The delay (in seconds) between each retry attempt. Both the retryDelay and the retryAttempts parameters need a value for a job to be retried.",
            "format": "int32"
          },
          "sequence": {
            "type": "integer",
            "description": "Scheduling policy for the job.<br>  0 - Skip missed repeating job instances.<br>  1 - Run all missed repeating job instances.",
            "format": "int32"
          },
          "storeId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the store where the job runs. This value cannot be edited after job creation.",
            "format": "int32"
          },
          "userId": {
            "type": "string",
            "description": "The unique numeric ID for identifying the user on whose behalf the job is run. By default, the user ID of the current user is used as the value."
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string"
                  }
                }
              },
              "job-statuses": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string"
                  }
                }
              },
              "broadcast-job-statuses": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string"
                  }
                }
              },
              "active-jobs": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "command": {
            "type": "string",
            "description": "The path information of the command that is to run for the job."
          },
          "interfaceName": {
            "type": "string",
            "description": "The interface name of the check command to be run before the command is run.  See SCHCONFIG table, INTERFACENAME column."
          },
          "host": {
            "type": "string",
            "description": "The name of the host that is allowed to run the job. If the value is null, the job can be run by any host. Use this parameter when you run jobs on multiple hosts and need to restrict a job to run a asingle host. The host name must be in the form \"name.domain\"."
          },
          "interval": {
            "type": "integer",
            "description": "The repeating interval (in seconds) between successive runs of this job. If the value is null, the job runs only once.",
            "format": "int32"
          },
          "jobType": {
            "type": "string",
            "description": "The type of the application thread pool where the scheduled job is included. This type is used to constrain resource-intensive jobs to a limited number of threads. The default application type is null."
          },
          "preferredStartDateTime": {
            "type": "string",
            "description": "The preferred date and time for when the job should start. The date and time must be entered as a timestamp in the ISO 8601 format \"YYYY-MM-DDThh:mm:ssZ\".",
            "format": "date-time"
          },
          "priority": {
            "type": "integer",
            "description": "The priority of the scheduled job.",
            "format": "int32"
          },
          "query": {
            "type": "string",
            "description": "The query string containing information used by the scheduled job."
          },
          "fixedTime": {
            "type": "integer",
            "description": "A flag indicating whether the job contained the fixed time parameter or not.  ie. 1 if fixedTime=1 exists, 0 otherwise.",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "description": "The description of the CustomJob being added.  This is the SCCDESCRIPTION column in the SCHCONFIG table."
          },
          "retryAttempts": {
            "type": "integer",
            "description": "The number of times that the job can be retried when the job fails. Both the retryAttempts and the retryDelay parameters need a value for a job to be retried.",
            "format": "int32"
          },
          "retryDelay": {
            "type": "integer",
            "description": "The delay (in seconds) between each retry attempt. Both the retryDelay and the retryAttempts parameters need a value for a job to be retried.",
            "format": "int32"
          },
          "sequence": {
            "type": "integer",
            "description": "Scheduling policy for the job.<br>  0 - Skip missed repeating job instances.<br>  1 - Run all missed repeating job instances.",
            "format": "int32"
          },
          "storeId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the store where the job runs. This value cannot be edited after job creation.",
            "format": "int32"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
