foliolib.folio.api.sourceRecordStorage.SourceRecordStorageMigrationsJobs

class foliolib.folio.api.sourceRecordStorage.SourceRecordStorageMigrationsJobs(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Source Record Storage Migration Jobs API

API for managing asynchronous migration jobs

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

get_job(jobsId)

Get a migration job

set_job(job)

Initiate a migration job

get_job(jobsId: str)

Get a migration job

GET /source-storage/migrations/jobs/{jobsId}

Parameters

jobsId (str) –

Returns

See Schema below

Return type

dict

Raises

OkapiRequestNotFound – Not Found

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Asynchronous migration job",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "migrations": {
      "description": "Names of the migration tasks",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "description": "Status of migration job execution",
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "startedDate": {
      "description": "Date and time when migration job has been started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when migration job has been completed",
      "type": "string",
      "format": "date-time"
    },
    "errorMessage": {
      "description": "Error message that describes error occurred during migration job execution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "migrations",
    "status"
  ]
}
set_job(job: dict)

Initiate a migration job

POST /source-storage/migrations/jobs

Parameters

job (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises

OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Request to initialize asynchronous migration job",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "migrations": {
      "description": "Names of the migration tasks",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "migrations"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Asynchronous migration job",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "migrations": {
      "description": "Names of the migration tasks",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "description": "Status of migration job execution",
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "startedDate": {
      "description": "Date and time when migration job has been started",
      "type": "string",
      "format": "date-time"
    },
    "completedDate": {
      "description": "Date and time when migration job has been completed",
      "type": "string",
      "format": "date-time"
    },
    "errorMessage": {
      "description": "Error message that describes error occurred during migration job execution",
      "type": "string"
    }
  },
  "required": [
    "id",
    "migrations",
    "status"
  ]
}