Async migrations API (v0.1)

http://localhost

Table of contents

Async migrations API

Running async migrations proceses for inventory enteties

Async migrations

GET /inventory-storage/migrations

Avalilible async migrations for the inventory-storage

GET /inventory-storage/migrations

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Post migration job request",
  "type": "object",
  "properties": {
    "asyncMigrations": {
      "description": "List of available migrations",
      "id": "asyncMigration",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Post migration job request",
        "properties": {
          "migrations": {
            "description": "Names of migration procedure",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "affectedEntities": {
            "description": "List of affected entities by particular migration",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "INSTANCE",
                "ITEM"
              ]
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      }
    },
    "totalRecords": {
      "type": "integer",
      "default": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "migrations",
    "totalRecords"
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /inventory-storage/migrations/jobs

Get migration jobs

GET /inventory-storage/migrations/jobs

Response 200

Migration jobs collection has returned

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Get collection of async jobs",
  "type": "object",
  "properties": {
    "jobs": {
      "description": "List of async jobs records",
      "javaType": "java.util.List<org.folio.rest.jaxrs.model.AsyncMigrationJob>"
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "additionalProperties": false
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /inventory-storage/migrations/jobs

Submit a migration job

POST /inventory-storage/migrations/jobs
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Post migration job request",
  "type": "object",
  "properties": {
    "migrations": {
      "description": "Names of migration procedure",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "affectedEntities": {
      "description": "List of affected entities by particular migration",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "INSTANCE",
          "ITEM"
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Response 200

Migration job has been submitted

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Get job by id response",
  "type": "object",
  "properties": {
    "id": {
      "description": "Job id",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "uuid.schema",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
    },
    "migrations": {
      "description": "Name of migration procedure",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "affectedEntities": {
      "description": "List of affected entities by particular migration",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "published": {
      "description": "Number of records that was published so far",
      "type": "array",
      "items": {
        "properties": {
          "migrationName": {
            "description": "Name of migration procedure",
            "type": "string"
          },
          "count": {
            "description": "Number of records that was published so far",
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        }
      }
    },
    "processed": {
      "description": "Number of records that was processed",
      "type": "array",
      "items": {
        "properties": {
          "migrationName": {
            "description": "Name of migration procedure",
            "type": "string"
          },
          "count": {
            "description": "Number of records that was processed",
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        }
      }
    },
    "jobStatus": {
      "description": "Overall job status",
      "type": "string",
      "enum": [
        "In progress",
        "Id publishing failed",
        "Ids published",
        "Pending cancel",
        "Cancelled",
        "Completed"
      ]
    },
    "submittedDate": {
      "description": "Timestamp when the job has been submitted",
      "type": "string",
      "format": "date-time"
    },
    "finishedDate": {
      "description": "Timestamp when the job has been finished",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /inventory-storage/migrations/jobs/{id}

Get migration job by id

GET /inventory-storage/migrations/jobs/{id}
URI Parameters
  • id: required (string)

Response 200

Migration job has returned

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Get job by id response",
  "type": "object",
  "properties": {
    "id": {
      "description": "Job id",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "uuid.schema",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
    },
    "migrations": {
      "description": "Name of migration procedure",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "affectedEntities": {
      "description": "List of affected entities by particular migration",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "published": {
      "description": "Number of records that was published so far",
      "type": "array",
      "items": {
        "properties": {
          "migrationName": {
            "description": "Name of migration procedure",
            "type": "string"
          },
          "count": {
            "description": "Number of records that was published so far",
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        }
      }
    },
    "processed": {
      "description": "Number of records that was processed",
      "type": "array",
      "items": {
        "properties": {
          "migrationName": {
            "description": "Name of migration procedure",
            "type": "string"
          },
          "count": {
            "description": "Number of records that was processed",
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        }
      }
    },
    "jobStatus": {
      "description": "Overall job status",
      "type": "string",
      "enum": [
        "In progress",
        "Id publishing failed",
        "Ids published",
        "Pending cancel",
        "Cancelled",
        "Completed"
      ]
    },
    "submittedDate": {
      "description": "Timestamp when the job has been submitted",
      "type": "string",
      "format": "date-time"
    },
    "finishedDate": {
      "description": "Timestamp when the job has been finished",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
}

Response 404

Migration job with id not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

DELETE /inventory-storage/migrations/jobs/{id}

Cancell migration job by id

DELETE /inventory-storage/migrations/jobs/{id}
URI Parameters
  • id: required (string)

Response 204

Migration job has been cancelled

Response 404

Migration job with id not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error