Change Manager (v2.0)

http://localhost

Table of contents

Change Manager API

API for accessing ChangeManager's bussiness logic

/change-manager

POST /change-manager/jobExecutions

Initialize JobExecutions

POST /change-manager/jobExecutions
Body

Media type: application/json

Response 201

Body

Media type: application/json

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

PUT /change-manager/jobExecutions/{id}

Update jobExecution item with given {jobExecutionId}

PUT /change-manager/jobExecutions/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job Execution Schema",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string"
    },
    "hrId": {
      "description": "Human readable id",
      "type": "string"
    },
    "parentJobId": {
      "description": "Id of the parent JobExecution entity",
      "type": "string"
    },
    "subordinationType": {
      "description": "Type of subordination to another JobExecution entities",
      "type": "string",
      "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"]
    },
    "jobProfile": {
      "description": "Related JobProfile information",
      "type": "object",
      "$ref": "jobProfile.json"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "runBy": {
      "description": "First and last name of the user that triggered the job execution",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        }
      }
    },
    "progress": {
      "description": "Execution progress of the job",
      "type": "object",
      "properties": {
        "current": {
          "description": "Currently processing record",
          "type": "integer"
        },
        "total": {
          "description": "Total number of records to be processed",
          "type": "integer"
        }
      }
    },
    "startedDate": {
      "description": "Date and time when the job execution started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when the job execution completed",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Current status of the job execution",
      "type": "string",
      "$ref": "status.json"
    },
    "uiStatus": {
      "description": "Status that is rendered on UI",
      "type": "string",
      "$ref": "uiStatus.json"
    },
    "errorStatus": {
      "description": "Status that describe error state of job execution",
      "type": "string",
      "$ref": "errorStatus.json"
    },
    "userId": {
      "description": "ID of the user who created the JobExecution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "parentJobId",
    "subordinationType",
    "status",
    "uiStatus",
    "userId"
  ]
}

Example:

{
  "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "hrId": "10000",
  "jobProfile": {
     "id": "zxsrt6hm-1caf-4470-9ad1-d533f6360bdd",
     "name": "Profile for marc files"
  },
  "parentJobId": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "subordinationType": "PARENT_SINGLE",
  "sourcePath": "C:\import\files\import_1.csv",
  "runBy": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR"
  },
  "progress": {
    "current": 50,
    "total": 50
  },
  "startedDate": "2018-10-30T12:36:55.000",
  "completedDate": "2018-10-30T12:40:01.000",
  "status": "COMMITTED",
  "uiStatus": "RUNNING_COMPLETE",
  "userId": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1"
  }
}

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job Execution Schema",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string"
    },
    "hrId": {
      "description": "Human readable id",
      "type": "string"
    },
    "parentJobId": {
      "description": "Id of the parent JobExecution entity",
      "type": "string"
    },
    "subordinationType": {
      "description": "Type of subordination to another JobExecution entities",
      "type": "string",
      "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"]
    },
    "jobProfile": {
      "description": "Related JobProfile information",
      "type": "object",
      "$ref": "jobProfile.json"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "runBy": {
      "description": "First and last name of the user that triggered the job execution",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        }
      }
    },
    "progress": {
      "description": "Execution progress of the job",
      "type": "object",
      "properties": {
        "current": {
          "description": "Currently processing record",
          "type": "integer"
        },
        "total": {
          "description": "Total number of records to be processed",
          "type": "integer"
        }
      }
    },
    "startedDate": {
      "description": "Date and time when the job execution started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when the job execution completed",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Current status of the job execution",
      "type": "string",
      "$ref": "status.json"
    },
    "uiStatus": {
      "description": "Status that is rendered on UI",
      "type": "string",
      "$ref": "uiStatus.json"
    },
    "errorStatus": {
      "description": "Status that describe error state of job execution",
      "type": "string",
      "$ref": "errorStatus.json"
    },
    "userId": {
      "description": "ID of the user who created the JobExecution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "parentJobId",
    "subordinationType",
    "status",
    "uiStatus",
    "userId"
  ]
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update jobExecution -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobExecution not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /change-manager/jobExecutions/{id}

Get JobExecution by id

GET /change-manager/jobExecutions/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job Execution Schema",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string"
    },
    "hrId": {
      "description": "Human readable id",
      "type": "string"
    },
    "parentJobId": {
      "description": "Id of the parent JobExecution entity",
      "type": "string"
    },
    "subordinationType": {
      "description": "Type of subordination to another JobExecution entities",
      "type": "string",
      "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"]
    },
    "jobProfile": {
      "description": "Related JobProfile information",
      "type": "object",
      "$ref": "jobProfile.json"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "runBy": {
      "description": "First and last name of the user that triggered the job execution",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        }
      }
    },
    "progress": {
      "description": "Execution progress of the job",
      "type": "object",
      "properties": {
        "current": {
          "description": "Currently processing record",
          "type": "integer"
        },
        "total": {
          "description": "Total number of records to be processed",
          "type": "integer"
        }
      }
    },
    "startedDate": {
      "description": "Date and time when the job execution started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when the job execution completed",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Current status of the job execution",
      "type": "string",
      "$ref": "status.json"
    },
    "uiStatus": {
      "description": "Status that is rendered on UI",
      "type": "string",
      "$ref": "uiStatus.json"
    },
    "errorStatus": {
      "description": "Status that describe error state of job execution",
      "type": "string",
      "$ref": "errorStatus.json"
    },
    "userId": {
      "description": "ID of the user who created the JobExecution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "parentJobId",
    "subordinationType",
    "status",
    "uiStatus",
    "userId"
  ]
}

Example:

{
  "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "hrId": "10000",
  "jobProfile": {
     "id": "zxsrt6hm-1caf-4470-9ad1-d533f6360bdd",
     "name": "Profile for marc files"
  },
  "parentJobId": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "subordinationType": "PARENT_SINGLE",
  "sourcePath": "C:\import\files\import_1.csv",
  "runBy": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR"
  },
  "progress": {
    "current": 50,
    "total": 50
  },
  "startedDate": "2018-10-30T12:36:55.000",
  "completedDate": "2018-10-30T12:40:01.000",
  "status": "COMMITTED",
  "uiStatus": "RUNNING_COMPLETE",
  "userId": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobExecution not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /change-manager/jobExecutions/{id}

Delete jobExecution item with given {jobExecutionId}

DELETE /change-manager/jobExecutions/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete jobExecution -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobExecution not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /change-manager/jobExecutions/{id}/children

Get children JobExecutions by parent id, by default returns all existing children JobExecutions, in order to limit the collection parameter limit should be explicitly specified

GET /change-manager/jobExecutions/{id}/children
URI Parameters
  • id: required (string)
Query Parameters
  • limit: (integer - default: 2147483647 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example status=IMPORT_IN_PROGRESS

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    status=IMPORT_IN_PROGRESS
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of execution jobs",
  "type": "object",
  "properties": {
    "jobExecutions": {
      "description": "List of execution jobs",
      "type": "array",
      "id": "jobExecutionList",
      "items": {
        "type": "object",
        "$ref": "jobExecution.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "jobExecutions",
    "totalRecords"
  ]
}

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

PUT /change-manager/jobExecutions/{id}/status

Update JobExecution status

PUT /change-manager/jobExecutions/{id}/status
URI Parameters
  • id: required (string)
Body

Media type: application/json

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job Execution Schema",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string"
    },
    "hrId": {
      "description": "Human readable id",
      "type": "string"
    },
    "parentJobId": {
      "description": "Id of the parent JobExecution entity",
      "type": "string"
    },
    "subordinationType": {
      "description": "Type of subordination to another JobExecution entities",
      "type": "string",
      "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"]
    },
    "jobProfile": {
      "description": "Related JobProfile information",
      "type": "object",
      "$ref": "jobProfile.json"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "runBy": {
      "description": "First and last name of the user that triggered the job execution",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        }
      }
    },
    "progress": {
      "description": "Execution progress of the job",
      "type": "object",
      "properties": {
        "current": {
          "description": "Currently processing record",
          "type": "integer"
        },
        "total": {
          "description": "Total number of records to be processed",
          "type": "integer"
        }
      }
    },
    "startedDate": {
      "description": "Date and time when the job execution started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when the job execution completed",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Current status of the job execution",
      "type": "string",
      "$ref": "status.json"
    },
    "uiStatus": {
      "description": "Status that is rendered on UI",
      "type": "string",
      "$ref": "uiStatus.json"
    },
    "errorStatus": {
      "description": "Status that describe error state of job execution",
      "type": "string",
      "$ref": "errorStatus.json"
    },
    "userId": {
      "description": "ID of the user who created the JobExecution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "parentJobId",
    "subordinationType",
    "status",
    "uiStatus",
    "userId"
  ]
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

PUT /change-manager/jobExecutions/{id}/jobProfile

Set JobProfile for JobExecution

PUT /change-manager/jobExecutions/{id}/jobProfile
URI Parameters
  • id: required (string)
Body

Media type: application/json

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job Execution Schema",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string"
    },
    "hrId": {
      "description": "Human readable id",
      "type": "string"
    },
    "parentJobId": {
      "description": "Id of the parent JobExecution entity",
      "type": "string"
    },
    "subordinationType": {
      "description": "Type of subordination to another JobExecution entities",
      "type": "string",
      "enum": ["CHILD", "PARENT_SINGLE", "PARENT_MULTIPLE"]
    },
    "jobProfile": {
      "description": "Related JobProfile information",
      "type": "object",
      "$ref": "jobProfile.json"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "runBy": {
      "description": "First and last name of the user that triggered the job execution",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        }
      }
    },
    "progress": {
      "description": "Execution progress of the job",
      "type": "object",
      "properties": {
        "current": {
          "description": "Currently processing record",
          "type": "integer"
        },
        "total": {
          "description": "Total number of records to be processed",
          "type": "integer"
        }
      }
    },
    "startedDate": {
      "description": "Date and time when the job execution started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when the job execution completed",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Current status of the job execution",
      "type": "string",
      "$ref": "status.json"
    },
    "uiStatus": {
      "description": "Status that is rendered on UI",
      "type": "string",
      "$ref": "uiStatus.json"
    },
    "errorStatus": {
      "description": "Status that describe error state of job execution",
      "type": "string",
      "$ref": "errorStatus.json"
    },
    "userId": {
      "description": "ID of the user who created the JobExecution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "parentJobId",
    "subordinationType",
    "status",
    "uiStatus",
    "userId"
  ]
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /change-manager/jobExecutions/{id}/records

Receive chunk of raw records

POST /change-manager/jobExecutions/{id}/records
URI Parameters
  • id: required (string)
Body

Media type: application/json

Response 204

Body

Media type: text/plain

Type: any

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error