Iterate instances (v0.1)

http://localhost

Table of contents

Instance iteration

Iterate instances by generating domain events for them

Iterate instances

POST /instance-storage/instances/iteration

Submit an iteration job

POST /instance-storage/instances/iteration
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Iteration job parameters",
  "type": "object",
  "javaType": "org.folio.rest.jaxrs.model.IterationJobParams",
  "properties": {
    "eventType": {
      "description": "Type of events to be published",
      "type": "string",
      "default": "ITERATE"
    },
    "topicName": {
      "description": "Name of Kafka topic to publish events to",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "topicName"
  ]
}

Response 201

Iteration job has been submitted

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Iteration job",
  "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}$"
    },
    "messagesPublished": {
      "description": "Number of messages that was published so far",
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "jobStatus": {
      "description": "Overall job status",
      "type": "string",
      "enum": [
        "In progress",
        "Failed",
        "Completed",
        "Cancellation pending",
        "Cancelled"
      ]
    },
    "submittedDate": {
      "description": "Timestamp when the job has been submitted",
      "type": "string",
      "format": "date-time"
    },
    "jobParams": {
      "description": "Job parameters",
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.IterationJobParams",
      "properties": {
        "eventType": {
          "description": "Type of events to be published",
          "type": "string",
          "default": "ITERATE"
        },
        "topicName": {
          "description": "Name of Kafka topic to publish events to",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "topicName"
      ]
    }
  },
  "additionalProperties": false
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /instance-storage/instances/iteration/{id}

Get iteration job by id

GET /instance-storage/instances/iteration/{id}
URI Parameters
  • id: required (string)

Response 200

Iteration job has returned

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Iteration job",
  "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}$"
    },
    "messagesPublished": {
      "description": "Number of messages that was published so far",
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "jobStatus": {
      "description": "Overall job status",
      "type": "string",
      "enum": [
        "In progress",
        "Failed",
        "Completed",
        "Cancellation pending",
        "Cancelled"
      ]
    },
    "submittedDate": {
      "description": "Timestamp when the job has been submitted",
      "type": "string",
      "format": "date-time"
    },
    "jobParams": {
      "description": "Job parameters",
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.IterationJobParams",
      "properties": {
        "eventType": {
          "description": "Type of events to be published",
          "type": "string",
          "default": "ITERATE"
        },
        "topicName": {
          "description": "Name of Kafka topic to publish events to",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "topicName"
      ]
    }
  },
  "additionalProperties": false
}

Response 404

Iteration 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 /instance-storage/instances/iteration/{id}

Cancel iteration job by id

DELETE /instance-storage/instances/iteration/{id}
URI Parameters
  • id: required (string)

Response 204

Iteration job has been cancelled

Response 404

Iteration 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