foliolib.folio.api.folioVertxLib.Tenant

class foliolib.folio.api.folioVertxLib.Tenant(tenant: str)

Bases: foliolib.folio.FolioApi

Tenant API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

deletetenantjob(id_)

delete tenant job

gettenantjob(id_, **kwargs)

Get tenant job

posttenant(tenantAttributes)

Start tenant operation

deletetenantjob(id_)

delete tenant job

DELETE /_/tenant/{id}

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – job id not found

  • OkapiRequestFatalError – Internal error

gettenantjob(id_, **kwargs)

Get tenant job

GET /_/tenant/{id}

Keyword Arguments

wait (int) – wait until job change, but no longer than the wait time - in milliseconds. 0 means “no wait” and is behavior if omitted.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – job id not found

  • OkapiRequestFatalError – Internal error

Schema

{
    "title": "Tenant job",
    "description": "Tenant job information",
    "type": "object",
    "properties": {
        "id": {
            "description": "Job ID",
            "type": "string",
            "format": "uuid"
        },
        "tenant": {
            "description": "Tenant ID",
            "type": "string"
        },
        "tenantAttributes": {
            "title": "Tenant job attributes",
            "description": "Configuration how to install, upgrade or delete a module for a tenant",
            "type": "object",
            "properties": {
                "module_from": {
                    "description": "Existing module ID. If omitted, the module is not enabled already",
                    "type": "string"
                },
                "module_to": {
                    "description": "Target module ID. If omitted, the existing module is disabled.",
                    "type": "string"
                },
                "purge": {
                    "description": "On disable should data also be purged",
                    "type": "boolean"
                },
                "parameters": {
                    "description": "List of key/value parameters of an error",
                    "type": "array",
                    "items": {
                        "description": "List of key/value parameters of an error",
                        "type": "object",
                        "properties": {
                            "key": {
                                "description": "The key for this parameter",
                                "type": "string"
                            },
                            "value": {
                                "description": "The value of this parameter",
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "required": [
                            "key"
                        ]
                    },
                    "additionalProperties": false
                }
            },
            "additionalProperties": false
        },
        "complete": {
            "description": "Whether job is complete (true) or ongoing (false)",
            "type": "boolean"
        },
        "error": {
            "description": "Error message if error has occurred",
            "type": "string"
        },
        "messages": {
            "description": "Additional messages (warnings, errors)",
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}
posttenant(tenantAttributes)

Start tenant operation

POST /_/tenant

Parameters

tenantAttributes (dict) – See Schema below.

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestPayloadToLarge – Payload Too large

  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal error

Schema

{
    "title": "Tenant job attributes",
    "description": "Configuration how to install, upgrade or delete a module for a tenant",
    "type": "object",
    "properties": {
        "module_from": {
            "description": "Existing module ID. If omitted, the module is not enabled already",
            "type": "string"
        },
        "module_to": {
            "description": "Target module ID. If omitted, the existing module is disabled.",
            "type": "string"
        },
        "purge": {
            "description": "On disable should data also be purged",
            "type": "boolean"
        },
        "parameters": {
            "description": "List of key/value parameters of an error",
            "type": "array",
            "items": {
                "description": "List of key/value parameters of an error",
                "type": "object",
                "properties": {
                    "key": {
                        "description": "The key for this parameter",
                        "type": "string"
                    },
                    "value": {
                        "description": "The value of this parameter",
                        "type": "string"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "key"
                ]
            },
            "additionalProperties": false
        }
    },
    "additionalProperties": false
}