foliolib.folio.api.mgrApplications.Am

class foliolib.folio.api.mgrApplications.Am(tenant: str)

Bases: foliolib.folio.FolioApi

Manager Applications API

Manager Applications API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

createmodulediscoveries(moduleDiscoveries)

Creates module discovery information in a batch

createmodulediscovery(moduleDiscovery, id_)

Creates a discovery for the module referenced by id.

deletemodulediscovery(id_)

Delete discovery of the module referenced by id.

deregisterapplicationbyid(id_)

De-register (delete) application by id.

getapplicationbyid(id_, **kwargs)

Retrieve registered application by id.

getapplicationsbyquery(**kwargs)

Retrieve registered application by query.

getdiscovery(id_, **kwargs)

Retrieve module discovery info for application referenced by id.

getmodulebootstrap(id_)

Retrieve bootstrap information for module referenced by id

getmodulediscovery(id_)

Retrieving discovery for the module referenced by id.

registerapplication(applicationDescriptor, ...)

Register a new application.

searchmodulediscovery(**kwargs)

Retrieving module discovery information by CQL query and pagination parameters.

updatemodulediscovery(moduleDiscovery, id_)

Update discovery for the module referenced by id.

validateapplicationdescriptor(...)

Validate application descriptor.

createmodulediscoveries(moduleDiscoveries)

Creates module discovery information in a batch

POST /modules/discovery

Parameters

moduleDiscoveries (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#",
    "type": "object",
    "description": "Collection of discovery information for modules that comprise an application",
    "properties": {
        "discovery": {
            "description": "Discovery information for the modules that comprise this application",
            "type": "array",
            "id": "moduleDiscovery",
            "items": {
                "$ref": "moduleDiscovery.json"
            }
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "discovery"
    ]
}
createmodulediscovery(moduleDiscovery, id_)

Creates a discovery for the module referenced by id.

POST /modules/{id}/discovery

Parameters

moduleDiscovery (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#",
    "type": "object",
    "description": "Module discovery information",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "../common/artifact.json"
        }
    ],
    "properties": {
        "location": {
            "description": "A url address of module where its been deployed",
            "type": "string"
        }
    },
    "required": [
        "location"
    ]
}
deletemodulediscovery(id_)

Delete discovery of the module referenced by id.

DELETE /modules/{id}/discovery

Raises

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

deregisterapplicationbyid(id_)

De-register (delete) application by id.

DELETE /applications/{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.

getapplicationbyid(id_, **kwargs)

Retrieve registered application by id.

GET /applications/{id}

Keyword Arguments

full (bool) – Show full information in the response including ModuleDescriptors (default: False)

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#",
    "title": "Application Descriptor Schema",
    "description": "Application Descriptor for Application Manager Installer",
    "type": "object",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "common/artifact.json"
        }
    ],
    "properties": {
        "description": {
            "description": "A description of application manager",
            "type": "string"
        },
        "metadata": {
            "$ref": "common/metadata.json",
            "readonly": true
        },
        "modules": {
            "description": "List of modules which are grouped by the application",
            "type": "array",
            "id": "module",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "uiModules": {
            "description": "List of ui-modules which are grouped by the application",
            "type": "array",
            "id": "uiModule",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "moduleDescriptors": {
            "description": "List of module descriptors which are grouped by the application",
            "type": "array",
            "id": "moduleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "uiModuleDescriptors": {
            "description": "List of ui module descriptors which are grouped by the application",
            "type": "array",
            "id": "uiModuleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "platform": {
            "description": "information about version of a platform",
            "type": "string"
        },
        "dependencies": {
            "description": "List of dependencies to other applications",
            "type": "array",
            "id": "dependency",
            "items": {
                "$ref": "dependency.json"
            }
        },
        "deployment": {
            "$ref": "applicationDeployment.json"
        }
    },
    "additionalProperties": false
}
getapplicationsbyquery(**kwargs)

Retrieve registered application by query.

GET /applications

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)

  • full (bool) – Show full information in the response including ModuleDescriptors (default: False)

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#",
    "type": "object",
    "description": "Collection of application descriptors",
    "properties": {
        "applicationDescriptors": {
            "description": "List of application descriptors",
            "type": "array",
            "id": "applicationDescriptor",
            "items": {
                "$ref": "applicationDescriptor.json"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "required": [
        "applicationDescriptors",
        "totalRecords"
    ]
}
getdiscovery(id_, **kwargs)

Retrieve module discovery info for application referenced by id.

GET /applications/{id}/discovery

Keyword Arguments
  • 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
  • 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#",
    "type": "object",
    "description": "Collection of discovery information for modules that comprise an application",
    "properties": {
        "discovery": {
            "description": "Discovery information for the modules that comprise this application",
            "type": "array",
            "id": "moduleDiscovery",
            "items": {
                "$ref": "moduleDiscovery.json"
            }
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "discovery"
    ]
}
getmodulebootstrap(id_)

Retrieve bootstrap information for module referenced by id

GET /modules/{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#",
    "type": "object",
    "description": "Bootstrap information of the module",
    "properties": {
        "module": {
            "description": "Discovery information of the module",
            "$ref": "moduleBootstrapDiscovery.json"
        },
        "requiredModules": {
            "description": "Discovery information for the required modules",
            "type": "array",
            "items": {
                "$ref": "moduleBootstrapDiscovery.json"
            }
        }
    },
    "required": [
        "module"
    ]
}
getmodulediscovery(id_)

Retrieving discovery for the module referenced by id.

GET /modules/{id}/discovery

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#",
    "type": "object",
    "description": "Module discovery information",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "../common/artifact.json"
        }
    ],
    "properties": {
        "location": {
            "description": "A url address of module where its been deployed",
            "type": "string"
        }
    },
    "required": [
        "location"
    ]
}
registerapplication(applicationDescriptor, **kwargs)

Register a new application.

POST /applications

Args:

applicationDescriptor (dict): See Schema below.

Keyword Args:

check (bool): Whether to run default validation of application descriptor or not

Default validation mode specified in the application properties

(default: True)

Returns:

dict: See Schema below.

Schema:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Application Descriptor Schema",
    "description": "Application Descriptor for Application Manager Installer",
    "type": "object",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "common/artifact.json"
        }
    ],
    "properties": {
        "description": {
            "description": "A description of application manager",
            "type": "string"
        },
        "metadata": {
            "$ref": "common/metadata.json",
            "readonly": true
        },
        "modules": {
            "description": "List of modules which are grouped by the application",
            "type": "array",
            "id": "module",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "uiModules": {
            "description": "List of ui-modules which are grouped by the application",
            "type": "array",
            "id": "uiModule",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "moduleDescriptors": {
            "description": "List of module descriptors which are grouped by the application",
            "type": "array",
            "id": "moduleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "uiModuleDescriptors": {
            "description": "List of ui module descriptors which are grouped by the application",
            "type": "array",
            "id": "uiModuleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "platform": {
            "description": "information about version of a platform",
            "type": "string"
        },
        "dependencies": {
            "description": "List of dependencies to other applications",
            "type": "array",
            "id": "dependency",
            "items": {
                "$ref": "dependency.json"
            }
        },
        "deployment": {
            "$ref": "applicationDeployment.json"
        }
    },
    "additionalProperties": false
}
searchmodulediscovery(**kwargs)

Retrieving module discovery information by CQL query and pagination parameters.

GET /modules/discovery

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
  • 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#",
    "type": "object",
    "description": "Collection of discovery information for modules that comprise an application",
    "properties": {
        "discovery": {
            "description": "Discovery information for the modules that comprise this application",
            "type": "array",
            "id": "moduleDiscovery",
            "items": {
                "$ref": "moduleDiscovery.json"
            }
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "discovery"
    ]
}
updatemodulediscovery(moduleDiscovery, id_)

Update discovery for the module referenced by id.

PUT /modules/{id}/discovery

Parameters

moduleDiscovery (dict) – See Schema below.

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#",
    "type": "object",
    "description": "Module discovery information",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "../common/artifact.json"
        }
    ],
    "properties": {
        "location": {
            "description": "A url address of module where its been deployed",
            "type": "string"
        }
    },
    "required": [
        "location"
    ]
}
validateapplicationdescriptor(applicationDescriptor, **kwargs)

Validate application descriptor.

POST /applications/validate

Parameters

applicationDescriptor (dict) – See Schema below.

Keyword Arguments

mode (str) – Validation mode to be applied

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#",
    "title": "Application Descriptor Schema",
    "description": "Application Descriptor for Application Manager Installer",
    "type": "object",
    "x-implements": [
        "org.folio.am.domain.model.Artifact"
    ],
    "allOf": [
        {
            "$ref": "common/artifact.json"
        }
    ],
    "properties": {
        "description": {
            "description": "A description of application manager",
            "type": "string"
        },
        "metadata": {
            "$ref": "common/metadata.json",
            "readonly": true
        },
        "modules": {
            "description": "List of modules which are grouped by the application",
            "type": "array",
            "id": "module",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "uiModules": {
            "description": "List of ui-modules which are grouped by the application",
            "type": "array",
            "id": "uiModule",
            "items": {
                "$ref": "module/module.json"
            }
        },
        "moduleDescriptors": {
            "description": "List of module descriptors which are grouped by the application",
            "type": "array",
            "id": "moduleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "uiModuleDescriptors": {
            "description": "List of ui module descriptors which are grouped by the application",
            "type": "array",
            "id": "uiModuleDescriptor",
            "items": {
                "$ref": "module/descriptor/moduleDescriptor.json"
            }
        },
        "platform": {
            "description": "information about version of a platform",
            "type": "string"
        },
        "dependencies": {
            "description": "List of dependencies to other applications",
            "type": "array",
            "id": "dependency",
            "items": {
                "$ref": "dependency.json"
            }
        },
        "deployment": {
            "$ref": "applicationDeployment.json"
        }
    },
    "additionalProperties": false
}