foliolib.folio.api.mgrTenants.Mgrtenants

class foliolib.folio.api.mgrTenants.Mgrtenants(tenant: str)

Bases: foliolib.folio.FolioApi

Mgr-Tenants API

Tenant Manager API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

createtenant(tenant)

Create a new tenant

createtenantattributes(tenantId, ...)

Create or replace tenant-attributes associated with the specified tenant.

deletetenantattribute(tenantId, id_)

Delete tenant attribute

deletetenantbyid(id_)

Remove a tenant by id

gettenantattribute(tenantId, id_)

Retrieve tenant attribute by id

gettenantattributes(tenantId, **kwargs)

Retrieve list of available tenant attributes by tenant id

gettenantbyid(id_)

Get tenant by id

gettenantsbyquery(**kwargs)

Get tenants by query

updatetenantattribute(tenantId, ...)

Update tenant attribute

updatetenantbyid(tenant, id_)

Update a tenant

createtenant(tenant)

Create a new tenant

POST /tenants

Parameters

tenant (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response if request body contains validation error (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenant.json",
    "title": "Tenant Schema",
    "description": "Tenant information",
    "type": "object",
    "x-implements": [
        "org.folio.tm.domain.entity.base.Identifiable"
    ],
    "properties": {
        "id": {
            "description": "A UUID identifying this attribute",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "Tenant name",
            "type": "string",
            "pattern": "[a-z][a-z0-9_]{0,29}[a-z0-9]"
        },
        "description": {
            "description": "Tenant description",
            "type": "string"
        },
        "type": {
            "description": "Tenant type",
            "$ref": "tenantType.json"
        },
        "attributes": {
            "description": "List of tenant attributes",
            "type": "array",
            "items": {
                "$ref": "tenantAttribute.json"
            }
        },
        "metadata": {
            "$ref": "common/metadata.json"
        }
    },
    "additionalProperties": false,
    "required": [
        "name"
    ]
}
createtenantattributes(tenantId, tenantAttributes)

Create or replace tenant-attributes associated with the specified tenant. Idempotent operation

POST /tenants/{tenantId}/tenant-attributes

Parameters
  • tenantId (str) – Tenant id (format: uuid)

  • tenantAttributes (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response if request body contains validation error (in json format)

  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenantAttributes.json",
    "title": "Tenant Attributes Schema",
    "description": "Collection of tenant attributes",
    "type": "object",
    "properties": {
        "tenantAttributes": {
            "description": "List of tenant attributes",
            "type": "array",
            "items": {
                "$ref": "tenantAttribute.json"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "tenantAttributes"
    ]
}
deletetenantattribute(tenantId, id_)

Delete tenant attribute

DELETE /tenants/{tenantId}/tenant-attributes/{id}

Parameters

tenantId (str) – Tenant id (format: uuid)

Raises

OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deletetenantbyid(id_)

Remove a tenant by id

DELETE /tenants/{id}

Raises
  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

gettenantattribute(tenantId, id_)

Retrieve tenant attribute by id

GET /tenants/{tenantId}/tenant-attributes/{id}

Parameters

tenantId (str) – Tenant id (format: uuid)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenantAttribute.json",
    "title": "Tenant Attribute Schema",
    "description": "Tenant attribute",
    "type": "object",
    "x-implements": [
        "org.folio.tm.domain.entity.base.Identifiable"
    ],
    "properties": {
        "id": {
            "description": "A UUID identifying this attribute",
            "type": "string",
            "format": "uuid"
        },
        "key": {
            "description": "Key for this attribute",
            "type": "string"
        },
        "value": {
            "description": "Value for this attribute",
            "type": "string"
        },
        "metadata": {
            "$ref": "common/metadata.json"
        }
    },
    "additionalProperties": false,
    "required": [
        "key",
        "value"
    ]
}
gettenantattributes(tenantId, **kwargs)

Retrieve list of available tenant attributes by tenant id

GET /tenants/{tenantId}/tenant-attributes

Parameters

tenantId (str) – Tenant id (format: uuid)

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (minimum: 0, default: 0)

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 10)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenantAttributes.json",
    "title": "Tenant Attributes Schema",
    "description": "Collection of tenant attributes",
    "type": "object",
    "properties": {
        "tenantAttributes": {
            "description": "List of tenant attributes",
            "type": "array",
            "items": {
                "$ref": "tenantAttribute.json"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "tenantAttributes"
    ]
}
gettenantbyid(id_)

Get tenant by id

GET /tenants/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenant.json",
    "title": "Tenant Schema",
    "description": "Tenant information",
    "type": "object",
    "x-implements": [
        "org.folio.tm.domain.entity.base.Identifiable"
    ],
    "properties": {
        "id": {
            "description": "A UUID identifying this attribute",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "Tenant name",
            "type": "string",
            "pattern": "[a-z][a-z0-9_]{0,29}[a-z0-9]"
        },
        "description": {
            "description": "Tenant description",
            "type": "string"
        },
        "type": {
            "description": "Tenant type",
            "$ref": "tenantType.json"
        },
        "attributes": {
            "description": "List of tenant attributes",
            "type": "array",
            "items": {
                "$ref": "tenantAttribute.json"
            }
        },
        "metadata": {
            "$ref": "common/metadata.json"
        }
    },
    "additionalProperties": false,
    "required": [
        "name"
    ]
}
gettenantsbyquery(**kwargs)

Get tenants by query

GET /tenants

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (minimum: 0, default: 0)

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 10)

Returns

See Schema below.

Return type

dict

Raises

OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenants.json",
    "title": "Tenants Schema",
    "description": "Collection of tenants",
    "type": "object",
    "properties": {
        "tenants": {
            "description": "List of tenants",
            "type": "array",
            "items": {
                "$ref": "tenant.json"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "tenants"
    ]
}
updatetenantattribute(tenantId, tenantAttribute, id_)

Update tenant attribute

PUT /tenants/{tenantId}/tenant-attributes/{id}

Parameters
  • tenantId (str) – Tenant id (format: uuid)

  • tenantAttribute (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response if request body contains validation error (in json format)

  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenantAttribute.json",
    "title": "Tenant Attribute Schema",
    "description": "Tenant attribute",
    "type": "object",
    "x-implements": [
        "org.folio.tm.domain.entity.base.Identifiable"
    ],
    "properties": {
        "id": {
            "description": "A UUID identifying this attribute",
            "type": "string",
            "format": "uuid"
        },
        "key": {
            "description": "Key for this attribute",
            "type": "string"
        },
        "value": {
            "description": "Value for this attribute",
            "type": "string"
        },
        "metadata": {
            "$ref": "common/metadata.json"
        }
    },
    "additionalProperties": false,
    "required": [
        "key",
        "value"
    ]
}
updatetenantbyid(tenant, id_)

Update a tenant

PUT /tenants/{id}

Parameters

tenant (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Error response if entity is not found by id (in json format)

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "tenant.json",
    "title": "Tenant Schema",
    "description": "Tenant information",
    "type": "object",
    "x-implements": [
        "org.folio.tm.domain.entity.base.Identifiable"
    ],
    "properties": {
        "id": {
            "description": "A UUID identifying this attribute",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "Tenant name",
            "type": "string",
            "pattern": "[a-z][a-z0-9_]{0,29}[a-z0-9]"
        },
        "description": {
            "description": "Tenant description",
            "type": "string"
        },
        "type": {
            "description": "Tenant type",
            "$ref": "tenantType.json"
        },
        "attributes": {
            "description": "List of tenant attributes",
            "type": "array",
            "items": {
                "$ref": "tenantAttribute.json"
            }
        },
        "metadata": {
            "$ref": "common/metadata.json"
        }
    },
    "additionalProperties": false,
    "required": [
        "name"
    ]
}