Integratec API Platform
persistGet

Description

Retrieves information from the database. The information retrieved is denoted by the getType property, which is required by the persistGet-req schema for all persistGet requests. Depending on getType, additional properties may be available and/or required. See the persistGet-req schema for more information.

See here for more details on Persist.

Remarks

The following getType values are supported:

  • job
  • jobs
  • jobRun
  • jobRuns
  • taskRun
  • taskRuns
  • countJobs
  • countJobsByName
  • countJobRuns

Example

Request

This request returns the count of how many times a JobID has been run.

{
"getType": "countJobRuns",
"jobID": 1
}

Reply

{
"result": 8
}

Request Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"definitions":{
"jobID":{
"title":"Job ID",
"description":"Identifies the Job record.",
"type":"integer"
},
"jobRunID":{
"title":"JobRun ID",
"description":"Identifies the JobRun record.",
"type":"integer"
},
"finishedJobRun":{
"title":"Finished",
"description":"Indicates whether or not a job run is finished.",
"type":"boolean"
}
},
"oneOf":[
{
"description":"Gets a Job record.",
"type":"object",
"required":[
"getType",
"jobID"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"job"
]
},
"jobID":{
"$ref":"#/definitions/jobID"
}
}
},
{
"description":"Gets all Job records.",
"type":"object",
"required":[
"getType"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"jobs"
]
}
}
},
{
"description":"Gets a JobRun record.",
"type":"object",
"required":[
"getType",
"jobRunID"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"jobRun"
]
},
"jobRunID":{
"$ref":"#/definitions/jobRunID"
}
}
},
{
"description":"Gets JobRun records by JobID.",
"type":"object",
"required":[
"getType",
"jobID"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"jobRuns"
]
},
"jobID":{
"$ref":"#/definitions/jobID"
}
}
},
{
"description":"Gets all JobRun records, all finished JobRun records, or all unfinished JobRun records",
"type":"object",
"required":[
"getType"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"jobRuns"
]
},
"finished":{
"$ref":"#/definitions/finishedJobRun"
}
}
},
{
"description":"Gets a TaskRun record.",
"type":"object",
"required":[
"getType",
"taskRunID"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"taskRun"
]
},
"taskRunID":{
"title":"TaskRun ID",
"description":"Identifies the TaskRun record.",
"type":"integer"
}
}
},
{
"description":"Gets TaskRun records by JobRunID.",
"type":"object",
"required":[
"getType",
"jobRunID"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"taskRuns"
]
},
"jobRunID":{
"$ref":"#/definitions/jobRunID"
}
}
},
{
"description":"Gets all TaskRun records, or TaskRun records by any combination of TaskType, WorkerUID, Started, and/or Finished.",
"type":"object",
"required":[
"getType"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"taskRuns"
]
},
"taskType":{
"title":"Task Type",
"description":"Filter by the task's request service identifier.",
"type":"string"
},
"workerUID":{
"title":"Worker UID",
"description":"Filter by an assigned minion's unique identifier.",
"type":"string"
},
"started":{
"title":"Started",
"description":"Filter by whether or not the task run has started.",
"type":"boolean"
},
"finished":{
"title":"Finished",
"description":"Filter by whether or not the task run has finished.",
"type":"boolean"
}
}
},
{
"description":"Gets count of all Job records, or count of Job records for a given JobID (0 or 1).",
"type":"object",
"required":[
"getType"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"countJobs"
]
},
"jobID":{
"$ref":"#/definitions/jobID"
}
}
},
{
"description":"Gets count of Jobs records by Name.",
"type":"object",
"required":[
"getType",
"name"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"countJobsByName"
]
},
"jobID":{
"$ref":"#/definitions/jobID"
},
"name":{
"title":"Name",
"description":"Filter by the Job record's name.",
"type":"string"
}
}
},
{
"description":"Gets count of all JobRun records, or count of JobRun records by any combination of JobRunID, JobID, and/or Finished.",
"type":"object",
"required":[
"getType"
],
"additionalProperties":false,
"properties":{
"getType":{
"title":"Get Type",
"description":"Specifies which records to get.",
"enum":[
"countJobRuns"
]
},
"jobRunID":{
"$ref":"#/definitions/jobRunID"
},
"jobID":{
"$ref":"#/definitions/jobID"
},
"finished":{
"$ref":"#/definitions/finishedJobRun"
}
}
}
]
}

Reply Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"definitions":{
"id":{
"title":"ID",
"type":"integer"
},
"name":{
"title":"Name",
"type":"string"
},
"dateCreate":{
"title":"Date Created",
"description":"Date and time the Job record was created.",
"type":"string"
},
"jobID":{
"title":"JobID",
"description":"Identifies the Job record of the JobRun record.",
"type":"integer"
},
"jobRunID":{
"title":"JobRunID",
"description":"Identifies the JobRun record of the TaskRun record.",
"type":"integer"
},
"taskID":{
"title":"TaskID",
"description":"Identifies the Task record of the TaskRun record.",
"type":"integer"
},
"date":{
"type":"string"
},
"dateStartJobRun":{
"title":"Date Started",
"description":"Date and time the job run was started.",
"$ref":"#/definitions/date"
},
"dateStartTaskRun":{
"title":"Date Started",
"description":"Date and time the task run was started.",
"$ref":"#/definitions/date"
},
"dateFinishJobRun":{
"title":"Date Finished",
"description":"Date and time the job run was finished.",
"$ref":"#/definitions/date"
},
"dateFinishTaskRun":{
"title":"Date Finished",
"description":"Date and time the task run was finished.",
"$ref":"#/definitions/date"
},
"workerUID":{
"title":"Worker UID",
"description":"Unique ID of the worker who performed the task run.",
"type":"string"
},
"currentPosition":{
"title":"Current Position",
"description":"Shows the current progress position of the task run.",
"oneOf":[
{
"type":"integer"
},
{
"type":"null"
}
]
},
"maximumPosition":{
"title":"Maximum Position",
"description":"Maximum progress position of the task run.",
"oneOf":[
{
"type":"integer"
},
{
"type":"null"
}
]
},
"message":{
"title":"Message",
"description":"Describes the outcome of the task run.",
"type":"string"
},
"resultTaskRun":{
"title":"Result",
"description":"Result code for the task run outcome.",
"type":"string"
}
},
"oneOf":[
{
"description":"Reply for the `job` get type.",
"type":"object",
"required":[
"id",
"name",
"dateCreate",
"tasks"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the Job record.",
"$ref":"#/definitions/id"
},
"name":{
"description":"Job record name.",
"$ref":"#/definitions/name"
},
"dateCreate":{
"$ref":"#/definitions/dateCreate"
},
"tasks":{
"title":"Tasks",
"description":"List of job tasks.",
"type":"array",
"items":{
"type":"object",
"required":[
"id",
"name",
"service",
"requestData"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the Task record.",
"$ref":"#/definitions/id"
},
"name":{
"description":"Task record Name.",
"$ref":"#/definitions/name"
},
"service":{
"title":"Service",
"description":"Task record Service.",
"type":"string"
},
"requestData":{
"title":"Request Data",
"description":"Task request parameters, encoded as a JSON string.",
"type":"string"
}
}
}
}
}
},
{
"description":"Reply for the `jobs` get type.",
"type":"object",
"required":[
"jobs"
],
"additionalProperties":false,
"properties":{
"jobs":{
"type":"array",
"items":{
"type":"object",
"required":[
"id",
"name",
"dateCreate"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the Job record.",
"$ref":"#/definitions/id"
},
"name":{
"description":"Job record Name.",
"$ref":"#/definitions/name"
},
"dateCreate":{
"$ref":"#/definitions/dateCreate"
}
}
}
}
}
},
{
"description":"Reply for the `jobRun` get type.",
"type":"object",
"required":[
"id",
"jobID",
"dateStart",
"dateFinish"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the JobRun record.",
"$ref":"#/definitions/id"
},
"jobID":{
"$ref":"#/definitions/jobID"
},
"dateStart":{
"$ref":"#/definitions/dateStartJobRun"
},
"dateFinish":{
"$ref":"#/definitions/dateFinishJobRun"
}
}
},
{
"description":"Reply for the `jobRuns` get type.",
"type":"object",
"required":[
"jobRuns"
],
"additionalProperties":false,
"properties":{
"jobRuns":{
"type":"array",
"items":{
"type":"object",
"required":[
"id",
"jobID",
"dateStart",
"dateFinish"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the JobRun record.",
"$ref":"#/definitions/id"
},
"jobID":{
"$ref":"#/definitions/jobID"
},
"dateStart":{
"$ref":"#/definitions/dateStartJobRun"
},
"dateFinish":{
"$ref":"#/definitions/dateFinishJobRun"
}
}
}
}
}
},
{
"description":"Reply for the `taskRun` get type.",
"type":"object",
"required":[
"id",
"jobRunID",
"taskID",
"dateStart",
"dateFinish",
"workerUID",
"currentPosition",
"maximumPosition",
"message",
"result"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the TaskRun record.",
"$ref":"#/definitions/id"
},
"jobRunID":{
"$ref":"#/definitions/jobRunID"
},
"taskID":{
"$ref":"#/definitions/taskID"
},
"dateStart":{
"$ref":"#/definitions/dateStartTaskRun"
},
"dateFinish":{
"$ref":"#/definitions/dateFinishTaskRun"
},
"workerUID":{
"$ref":"#/definitions/workerUID"
},
"currentPosition":{
"$ref":"#/definitions/currentPosition"
},
"maximumPosition":{
"$ref":"#/definitions/maximumPosition"
},
"message":{
"$ref":"#/definitions/message"
},
"result":{
"$ref":"#/definitions/resultTaskRun"
}
}
},
{
"description":"Reply for the `taskRuns` get type.",
"type":"object",
"required":[
"taskRuns"
],
"additionalProperties":false,
"properties":{
"taskRuns":{
"type":"array",
"items":{
"type":"object",
"required":[
"id",
"jobRunID",
"taskID",
"dateStart",
"dateFinish",
"workerUID",
"currentPosition",
"maximumPosition",
"message",
"result"
],
"additionalProperties":false,
"properties":{
"id":{
"description":"Identifies the TaskRun record.",
"$ref":"#/definitions/id"
},
"jobRunID":{
"$ref":"#/definitions/jobRunID"
},
"taskID":{
"$ref":"#/definitions/taskID"
},
"dateStart":{
"$ref":"#/definitions/dateStartTaskRun"
},
"dateFinish":{
"$ref":"#/definitions/dateFinishTaskRun"
},
"workerUID":{
"$ref":"#/definitions/workerUID"
},
"currentPosition":{
"$ref":"#/definitions/currentPosition"
},
"maximumPosition":{
"$ref":"#/definitions/maximumPosition"
},
"message":{
"$ref":"#/definitions/message"
},
"result":{
"$ref":"#/definitions/resultTaskRun"
}
}
}
}
}
},
{
"description":"Reply for `countJobs`, `countJobsByName` and `countJobRuns` get types.",
"type":"object",
"required":[
"result"
],
"additionalProperties":false,
"properties":{
"result":{
"title":"Result",
"description":"Count of returned records.",
"type":"integer"
}
}
}
]
}