{
  "openapi": "3.0.1",
  "info": {
    "title": "Scheduler Job Statuses",
    "version": "9.1.20.0",
    "description": "Provide access to scheduled job statuses.",
    "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 Statuses",
      "description": "Provides RESTful services to manage scheduled job status resources."
    }
  ],
  "paths": {
    "/job-statuses": {
      "get": {
        "tags": [
          "Jobs Statuses"
        ],
        "summary": "Get a collection of scheduled job statuses.",
        "description": "Get a collection of scheduled job statuses.",
        "operationId": "getScheduledJobStatuses",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "This is the content type to be placed in the header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "criteriaStart",
            "in": "query",
            "description": "The start date of the date range for the scheduled job status to return.  The value is the actual start date the job was run on the server's time zone.  The date format is yyyy-MM-dd'T'HH:mm:ss, ie. 2020-04-20T04:00:00.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "criteriaEnd",
            "in": "query",
            "description": "The end date of the date range for the scheduled job status to return.  The value is the actual end date the job was run on the server's time zone.  The date format is yyyy-MM-dd'T'HH:mm:ss, ie. 2020-04-20T04:00:00.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxItems",
            "in": "query",
            "description": "The maxiumum number of items to fetch from the database.  Default is 15000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 15000
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID of the store that the jobs are running for.  If site, store ID must be 0.",
            "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",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "The comma-separated set of properties that control the order of the listed items. Properties can be prefixed by either (-) to sort in descending order, or (+) to sort in ascending order. By default, properties are sorted in ascending order. For example, sort=name will order the items based on the name value in ascending order.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Limits search results to only include scheduled job status with a command name that matches the value of this parameter. Searches are case-insensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Limits search results to only include scheduled job status with a state that matches the value of this parameter. Searches are case-sensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Limits search results to only include scheduled job status with a status that matches the value of this parameter. Searches are case-sensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "applicationType",
            "in": "query",
            "description": "Limits search results to only include scheduled job status with an application type that matches the value of this parameter. Searches are case-sensitive.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatusesCollection"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Jobs Statuses"
        ],
        "summary": "Delete previous scheduler job status that has completed successfully, or failed.",
        "description": "Delete previous scheduler job status that has completed successfully, or failed.",
        "operationId": "Job-Statuses-delete",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "This is the content type to be placed in the header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID of the store that the jobs are running for.  If site, store ID must be 0.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "The end time of when the jobs were run, to remove status for.  The value is the end date that the job status should be removed for.  The date format is yyyy-MM-dd'T'HH:mm:ss, ie. 2020-04-20T04:00:00.",
            "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"
                }
              }
            }
          }
        }
      }
    },
    "/job-statuses/{id}": {
      "delete": {
        "tags": [
          "Jobs Statuses"
        ],
        "summary": "Delete previous scheduler job status for the Job specified, that has completed successfully, or failed.",
        "description": "Delete previous scheduler job status for the Job specified, that has completed successfully, or failed.",
        "operationId": "Job-Statuses-by-JobId-delete",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "This is the content type to be placed in the header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the scheduler job.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID of the store that the jobs are running for.  If site, store ID must be 0.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "The end time of when the jobs were run, to remove status for.  The value is the end date that the job status should be removed for.  The date format is yyyy-MM-dd'T'HH:mm:ss, ie. 2020-04-20T04:00:00.",
            "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."
      },
      "JobStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique numeric ID of the job status (job instance)."
          },
          "jobId": {
            "type": "string",
            "description": "The unique numeric ID of the job (job configuration)."
          },
          "applicationType": {
            "type": "string",
            "description": "The application type of the job."
          },
          "start": {
            "type": "string",
            "description": "The start date of the date range to return the job statuses. The date is respective of the server locale and of the format yyyy-MM-dd HH:mm:ss ie. 2020-05-29 16:15:53.092"
          },
          "end": {
            "type": "string",
            "description": "The end date of the date range to return the job statuses. The date is respective of the server locale and of the format yyyy-MM-dd HH:mm:ss ie. 2020-05-29 16:15:53.092"
          },
          "state": {
            "type": "string",
            "description": "The state of the job execution.  ie. Has the job run?"
          },
          "status": {
            "type": "string",
            "description": "The status of the job execution.  ie.  Successful / Failed"
          },
          "pathInfo": {
            "type": "string",
            "description": "The command / path information of the job."
          },
          "queryString": {
            "type": "string",
            "description": "The parameter list of the job."
          }
        }
      },
      "JobStatusesCollection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          "offset": {
            "minimum": 0,
            "type": "integer",
            "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.",
            "format": "int32"
          },
          "count": {
            "minimum": 0,
            "type": "integer",
            "description": "The total number of item records that match the query parameters.",
            "format": "int32"
          },
          "limit": {
            "maximum": 500,
            "type": "integer",
            "description": "The maximum number of records to return.",
            "format": "int32"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
