foliolib.folio.api.dataExport.DataExportFileDefinition

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

Bases: foliolib.folio.FolioApi

Data export File Definition API

APIs for creating fileDefinition to upload files

Parameters
  • tenant (str) – Tenant id

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

Methods

get_fileDefinition(fileDefinitionId)

Method to get file definition by id

set_fileDefinition(fileDefinition)

API to create file definition to use it for the file uploading

upload_upload(fileDefinitionId, filePath)

Method to upload file

get_fileDefinition(fileDefinitionId: str)

Method to get file definition by id

GET /data-export/file-definitions/{fileDefinitionId}

Parameters

fileDefinitionId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "File definition",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID of this File Definition",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "fileName": {
      "description": "File name",
      "type": "string"
    },
    "jobExecutionId": {
      "description": "Job execution id",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "status": {
      "description": "Status of file upload",
      "type": "string",
      "enum": [
        "NEW",
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "size": {
      "description": "Size of the file in Kbyte",
      "type": "integer"
    },
    "uploadFormat": {
      "description": "Format of upload file",
      "type": "string",
      "enum": [
        "csv",
        "cql"
      ],
      "default": "csv"
    },
    "metadata": {
      "description": "Meta information ",
      "type": "object",
      "$ref": "../../ramls/raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "fileName"
  ]
}
set_fileDefinition(fileDefinition: dict)

API to create file definition to use it for the file uploading

POST /data-export/file-definitions

Parameters

fileDefinition (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestPayloadToLarge – Payload Too Large

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "File definition",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID of this File Definition",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "fileName": {
      "description": "File name",
      "type": "string"
    },
    "jobExecutionId": {
      "description": "Job execution id",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "status": {
      "description": "Status of file upload",
      "type": "string",
      "enum": [
        "NEW",
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "size": {
      "description": "Size of the file in Kbyte",
      "type": "integer"
    },
    "uploadFormat": {
      "description": "Format of upload file",
      "type": "string",
      "enum": [
        "csv",
        "cql"
      ],
      "default": "csv"
    },
    "metadata": {
      "description": "Meta information ",
      "type": "object",
      "$ref": "../../ramls/raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "fileName"
  ]
}
upload_upload(fileDefinitionId: str, filePath: str)

Method to upload file

POST /data-export/file-definitions/{fileDefinitionId}/upload

Parameters

fileDefinitionId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "File definition",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID of this File Definition",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "fileName": {
      "description": "File name",
      "type": "string"
    },
    "jobExecutionId": {
      "description": "Job execution id",
      "type": "string",
      "$ref": "../../ramls/raml-util/schemas/uuid.schema"
    },
    "sourcePath": {
      "description": "Path to the file",
      "type": "string"
    },
    "status": {
      "description": "Status of file upload",
      "type": "string",
      "enum": [
        "NEW",
        "IN_PROGRESS",
        "COMPLETED",
        "ERROR"
      ]
    },
    "size": {
      "description": "Size of the file in Kbyte",
      "type": "integer"
    },
    "uploadFormat": {
      "description": "Format of upload file",
      "type": "string",
      "enum": [
        "csv",
        "cql"
      ],
      "default": "csv"
    },
    "metadata": {
      "description": "Meta information ",
      "type": "object",
      "$ref": "../../ramls/raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "fileName"
  ]
}