foliolib.folio.api.mgrTenantEntitlements.Mgrtenantentitlements

class foliolib.folio.api.mgrTenantEntitlements.Mgrtenantentitlements(tenant: str)

Bases: foliolib.folio.FolioApi

mgr-tenant-entitlements API

Tenant Entitlement Manager API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

create(entitlementRequestBody, **kwargs)

Installs/enables application for tenant.

delete(entitlementRequestBody, **kwargs)

Delete application installation by id, when making request add basic authorization for an admin user (e.g.

findapplicationflows(**kwargs)

Retrieves an application entitlement flows by CQL query

findbyquery(**kwargs)

Retrieves all the entitlement using query tools (CQL query, limit and offset parameters).

findentitledapplicationsbytenantname(...)

List of application descriptors entitled for the tenant

findentitlementsbytenantid(tenantId, **kwargs)

List of tenant entitlements

findentitlementstages(applicationFlowId)

Retrieves entitlement stages by application id

getapplicationflowbyid(applicationFlowId, ...)

Retrieves an entitlement flow per applicationId

getentitlementflowbyid(flowId, **kwargs)

Retrieves a flow by id

getentitlementstagebyname(applicationFlowId, ...)

Retrieves entitlement stages by application id

getmoduleentitlements(moduleId, **kwargs)

Retrieve a list of module entitlements

validate(entitlementRequestBody, **kwargs)

Validates an entitlement request against a set of pre-configured validators that are also applied during the entitlement process or a single validator specified as a parameter.

create(entitlementRequestBody, **kwargs)

Installs/enables application for tenant. Basic authorization is required to perform request (e.g. Authorization=Basic dXNlcjp1c2Vy).

POST /entitlements

Args:

entitlementRequestBody (dict): See Schema below.

Keyword Args:

tenantParameters (str): Parameters for tenant init ignoreErrors (bool): Okapi 4.2.0 and later, it is possible to ignore errors during the

install operation. This is done by supplying parameter ignoreErrors=true. In this case, Okapi will try to upgrade all modules in the modules list, regardless if one of them fails. However, for individual modules, if they fail, their upgrade will not be committed. This is an experimental parameter which was added to be able to inspect all problem(s) with module upgrade(s).

(default: False)

async (bool): Enables asynchronous install operation (default: False) purgeOnRollback (bool): Defines if module data must be purged on rollback. (default: False)

Returns:

dict: See Schema below.

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",
    "id": "installationRequest.json",
    "title": "Tenant Entitlement Request Schema",
    "description": "A collection of application ids to install",
    "properties": {
        "tenantId": {
            "description": "Tenant id",
            "type": "string",
            "format": "uuid"
        },
        "applications": {
            "description": "List of application ids",
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "applications",
        "tenantId"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "installation.json",
    "title": "Tenant Entitlement Result Schema",
    "description": "Tenant entitlement result descriptor",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "flowId": {
            "description": "An entitlement flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "entitlements": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "installation.json",
                "title": "Tenant Entitlement Schema",
                "description": "Tenant entitlement descriptor",
                "type": "object",
                "properties": {
                    "applicationId": {
                        "description": "A Name-Version id of application",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "flowId": {
                        "description": "An application flow identifier",
                        "type": "string",
                        "format": "uuid"
                    }
                }
            }
        }
    }
}
delete(entitlementRequestBody, **kwargs)

Delete application installation by id, when making request add basic authorization for an admin user (e.g. Basic YWRtaW46YWRtaW4=).

DELETE /entitlements

Args:

entitlementRequestBody (dict): See Schema below.

Keyword Args:

tenantParameters (str): Parameters for tenant init ignoreErrors (bool): Okapi 4.2.0 and later, it is possible to ignore errors during the

install operation. This is done by supplying parameter ignoreErrors=true. In this case, Okapi will try to upgrade all modules in the modules list, regardless if one of them fails. However, for individual modules, if they fail, their upgrade will not be committed. This is an experimental parameter which was added to be able to inspect all problem(s) with module upgrade(s).

(default: False)

purge (bool): Disabled modules will also be purged. (default: False)

Returns:

dict: See Schema below.

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",
    "id": "installationRequest.json",
    "title": "Tenant Entitlement Request Schema",
    "description": "A collection of application ids to install",
    "properties": {
        "tenantId": {
            "description": "Tenant id",
            "type": "string",
            "format": "uuid"
        },
        "applications": {
            "description": "List of application ids",
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "applications",
        "tenantId"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "installation.json",
    "title": "Tenant Entitlement Result Schema",
    "description": "Tenant entitlement result descriptor",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "flowId": {
            "description": "An entitlement flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "entitlements": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "installation.json",
                "title": "Tenant Entitlement Schema",
                "description": "Tenant entitlement descriptor",
                "type": "object",
                "properties": {
                    "applicationId": {
                        "description": "A Name-Version id of application",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "flowId": {
                        "description": "An application flow identifier",
                        "type": "string",
                        "format": "uuid"
                    }
                }
            }
        }
    }
}
findapplicationflows(**kwargs)

Retrieves an application entitlement flows by CQL query

GET /application-flows

Keyword Arguments
  • query (str) – A CQL query string with search conditions. (default: cql.allRecords=1)

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

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

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": "entitlementFlows.json",
    "title": "Application Entitlement Flows Schema",
    "description": "List of application entitlement flows (installations)",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "applicationFlows": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "applicationEntitlement.json",
                "title": "Application Entitlement Flow Schema",
                "description": "An entitlement flow result for a single application",
                "type": "object",
                "properties": {
                    "id": {
                        "description": "An application entitlement flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "applicationId": {
                        "description": "An application descriptor identifier",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "flowId": {
                        "description": "An entitlement flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "type": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementType.json",
                        "title": "Tenant Entitlement Type Schema",
                        "description": "A tenant entitlement type",
                        "type": "string",
                        "enum": [
                            "entitle",
                            "revoke"
                        ]
                    },
                    "status": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementFlowStatus.json",
                        "title": "Application/Stage Execution Status Schema",
                        "description": "An application/stage execution status",
                        "type": "string",
                        "enum": [
                            "queued",
                            "in_progress",
                            "cancelled",
                            "cancellation_failed",
                            "failed",
                            "finished"
                        ]
                    },
                    "startedAt": {
                        "description": "An application flow start timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finishedAt": {
                        "description": "An application flow end timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "stages": {
                        "description": "List of stages per application flow",
                        "type": "array",
                        "items": {
                            "schema": "http://json-schema.org/draft-04/schema#",
                            "id": "entitlementStage.json",
                            "title": "Tenant Entitlement Stage Schema",
                            "description": "Tenant entitlement stage descriptor",
                            "type": "object",
                            "properties": {
                                "applicationFlowId": {
                                    "description": "A parent application flow identifier",
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "name": {
                                    "description": "A stage name",
                                    "type": "string"
                                },
                                "status": {
                                    "$schema": "http://json-schema.org/draft-04/schema#",
                                    "id": "types/entitlementFlowStatus.json",
                                    "title": "Application/Stage Execution Status Schema",
                                    "description": "An application/stage execution status",
                                    "type": "string",
                                    "enum": [
                                        "queued",
                                        "in_progress",
                                        "cancelled",
                                        "cancellation_failed",
                                        "failed",
                                        "finished"
                                    ]
                                },
                                "errorType": {
                                    "description": "A relevant error type caused stage failure or cancellation, nullable if stage is finished",
                                    "type": "string"
                                },
                                "errorMessage": {
                                    "description": "A relevant error message caused stage failure or cancellation, nullable if stage is finished",
                                    "type": "string"
                                },
                                "startedAt": {
                                    "description": "Stage execution start timestamp",
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "finishedAt": {
                                    "description": "Stage execution end timestamp",
                                    "type": "string",
                                    "format": "date-time"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
findbyquery(**kwargs)

Retrieves all the entitlement using query tools (CQL query, limit and offset parameters). Basic authorization is required to perform request (e.g. Authorization=Basic dXNlcjp1c2Vy).

GET /entitlements

Keyword Args:

query (str): A CQL query string with search conditions. (default: cql.allRecords=1) includeModules (bool): Indicates if list of modules should be loaded for each entitlement. (default: False) limit (int): Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 10) offset (int): Skip over a number of elements by specifying an offset value for the query. (minimum: 0, default: 0)

Returns:

dict: See Schema below.

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": "installations.json",
    "title": "Tenant Entitlements Schema",
    "description": "List of tenant entitlements (installations)",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "entitlements": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "installation.json",
                "title": "Tenant Entitlement Schema",
                "description": "Tenant entitlement descriptor",
                "type": "object",
                "properties": {
                    "applicationId": {
                        "description": "A Name-Version id of application",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "modules": {
                        "description": "A list of module identifiers",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "description": "A module identifier"
                        }
                    }
                },
                "required": [
                    "applicationId",
                    "tenantId",
                    "complete"
                ]
            }
        }
    }
}
findentitledapplicationsbytenantname(tenantName, **kwargs)

List of application descriptors entitled for the tenant

GET /entitlements/{tenantName}/applications

Parameters

tenantName (str) – Tenant name

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

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

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 application descriptors",
    "properties": {
        "applicationDescriptors": {
            "description": "List of application descriptors",
            "type": "array",
            "id": "applicationDescriptor",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "description": "Application descriptor",
                "type": "object"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "required": [
        "applicationDescriptors",
        "totalRecords"
    ]
}
findentitlementsbytenantid(tenantId, **kwargs)

List of tenant entitlements

GET /entitlements/{tenantId}

Parameters

tenantId (str) – Tenant id

Keyword Arguments
  • includeModules (bool) – Indicates if list of modules should be loaded for each entitlement. (default: False)

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

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

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": "installations.json",
    "title": "Tenant Entitlements Schema",
    "description": "List of tenant entitlements (installations)",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "entitlements": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "installation.json",
                "title": "Tenant Entitlement Schema",
                "description": "Tenant entitlement descriptor",
                "type": "object",
                "properties": {
                    "applicationId": {
                        "description": "A Name-Version id of application",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "modules": {
                        "description": "A list of module identifiers",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "description": "A module identifier"
                        }
                    }
                },
                "required": [
                    "applicationId",
                    "tenantId",
                    "complete"
                ]
            }
        }
    }
}
findentitlementstages(applicationFlowId)

Retrieves entitlement stages by application id

GET /application-flows/{applicationFlowId}/stages

Parameters

applicationFlowId (str) – An application flow identifier (format: uuid)

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": "entitlementStage.json",
    "title": "Tenant Entitlement Stage Schema",
    "description": "Tenant entitlement stage descriptor",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "entitlementStages": {
            "type": "array",
            "items": {
                "schema": "http://json-schema.org/draft-04/schema#",
                "id": "entitlementStage.json",
                "title": "Tenant Entitlement Stage Schema",
                "description": "Tenant entitlement stage descriptor",
                "type": "object",
                "properties": {
                    "applicationFlowId": {
                        "description": "A parent application flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "description": "A stage name",
                        "type": "string"
                    },
                    "status": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementFlowStatus.json",
                        "title": "Application/Stage Execution Status Schema",
                        "description": "An application/stage execution status",
                        "type": "string",
                        "enum": [
                            "queued",
                            "in_progress",
                            "cancelled",
                            "cancellation_failed",
                            "failed",
                            "finished"
                        ]
                    },
                    "errorType": {
                        "description": "A relevant error type caused stage failure or cancellation, nullable if stage is finished",
                        "type": "string"
                    },
                    "errorMessage": {
                        "description": "A relevant error message caused stage failure or cancellation, nullable if stage is finished",
                        "type": "string"
                    },
                    "startedAt": {
                        "description": "Stage execution start timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finishedAt": {
                        "description": "Stage execution end timestamp",
                        "type": "string",
                        "format": "date-time"
                    }
                }
            }
        }
    }
}
getapplicationflowbyid(applicationFlowId, **kwargs)

Retrieves an entitlement flow per applicationId

GET /application-flows/{applicationFlowId}

Parameters

applicationFlowId (str) – An application flow identifier (format: uuid)

Keyword Arguments

includeStages (bool) – Defines if stages must be included in the response for entitlement/application flows (default: False)

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": "applicationEntitlement.json",
    "title": "Application Entitlement Flow Schema",
    "description": "An entitlement flow result for a single application",
    "type": "object",
    "properties": {
        "id": {
            "description": "An application entitlement flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "applicationId": {
            "description": "An application descriptor identifier",
            "type": "string"
        },
        "tenantId": {
            "description": "A tenant identifier",
            "type": "string",
            "format": "uuid"
        },
        "flowId": {
            "description": "An entitlement flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "type": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "types/entitlementType.json",
            "title": "Tenant Entitlement Type Schema",
            "description": "A tenant entitlement type",
            "type": "string",
            "enum": [
                "entitle",
                "revoke"
            ]
        },
        "status": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "types/entitlementFlowStatus.json",
            "title": "Application/Stage Execution Status Schema",
            "description": "An application/stage execution status",
            "type": "string",
            "enum": [
                "queued",
                "in_progress",
                "cancelled",
                "cancellation_failed",
                "failed",
                "finished"
            ]
        },
        "startedAt": {
            "description": "An application flow start timestamp",
            "type": "string",
            "format": "date-time"
        },
        "finishedAt": {
            "description": "An application flow end timestamp",
            "type": "string",
            "format": "date-time"
        },
        "stages": {
            "description": "List of stages per application flow",
            "type": "array",
            "items": {
                "schema": "http://json-schema.org/draft-04/schema#",
                "id": "entitlementStage.json",
                "title": "Tenant Entitlement Stage Schema",
                "description": "Tenant entitlement stage descriptor",
                "type": "object",
                "properties": {
                    "applicationFlowId": {
                        "description": "A parent application flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "description": "A stage name",
                        "type": "string"
                    },
                    "status": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementFlowStatus.json",
                        "title": "Application/Stage Execution Status Schema",
                        "description": "An application/stage execution status",
                        "type": "string",
                        "enum": [
                            "queued",
                            "in_progress",
                            "cancelled",
                            "cancellation_failed",
                            "failed",
                            "finished"
                        ]
                    },
                    "errorType": {
                        "description": "A relevant error type caused stage failure or cancellation, nullable if stage is finished",
                        "type": "string"
                    },
                    "errorMessage": {
                        "description": "A relevant error message caused stage failure or cancellation, nullable if stage is finished",
                        "type": "string"
                    },
                    "startedAt": {
                        "description": "Stage execution start timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finishedAt": {
                        "description": "Stage execution end timestamp",
                        "type": "string",
                        "format": "date-time"
                    }
                }
            }
        }
    }
}
getentitlementflowbyid(flowId, **kwargs)

Retrieves a flow by id

GET /entitlement-flows/{flowId}

Parameters

flowId (str) – A flow identifier (format: uuid)

Keyword Arguments

includeStages (bool) – Defines if stages must be included in the response for entitlement/application flows (default: False)

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": "entitlementFlow.json",
    "title": "Tenant Entitlement Flow Schema",
    "description": "A tenant entitlement flow result, may contain multiple tenant application entitlements",
    "type": "object",
    "properties": {
        "id": {
            "description": "An entitlement flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "status": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "types/entitlementFlowStatus.json",
            "title": "Application/Stage Execution Status Schema",
            "description": "An application/stage execution status",
            "type": "string",
            "enum": [
                "queued",
                "in_progress",
                "cancelled",
                "cancellation_failed",
                "failed",
                "finished"
            ]
        },
        "entitlementType": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "types/entitlementType.json",
            "title": "Tenant Entitlement Type Schema",
            "description": "A tenant entitlement type",
            "type": "string",
            "enum": [
                "entitle",
                "revoke"
            ]
        },
        "startedAt": {
            "description": "A tenant entitlement flow start timestamp",
            "type": "string",
            "format": "date-time"
        },
        "finishedAt": {
            "description": "A tenant entitlement flow end timestamp",
            "type": "string",
            "format": "date-time"
        },
        "applicationFlows": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "applicationEntitlement.json",
                "title": "Application Entitlement Flow Schema",
                "description": "An entitlement flow result for a single application",
                "type": "object",
                "properties": {
                    "id": {
                        "description": "An application entitlement flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "applicationId": {
                        "description": "An application descriptor identifier",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "flowId": {
                        "description": "An entitlement flow identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "type": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementType.json",
                        "title": "Tenant Entitlement Type Schema",
                        "description": "A tenant entitlement type",
                        "type": "string",
                        "enum": [
                            "entitle",
                            "revoke"
                        ]
                    },
                    "status": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "id": "types/entitlementFlowStatus.json",
                        "title": "Application/Stage Execution Status Schema",
                        "description": "An application/stage execution status",
                        "type": "string",
                        "enum": [
                            "queued",
                            "in_progress",
                            "cancelled",
                            "cancellation_failed",
                            "failed",
                            "finished"
                        ]
                    },
                    "startedAt": {
                        "description": "An application flow start timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finishedAt": {
                        "description": "An application flow end timestamp",
                        "type": "string",
                        "format": "date-time"
                    },
                    "stages": {
                        "description": "List of stages per application flow",
                        "type": "array",
                        "items": {
                            "schema": "http://json-schema.org/draft-04/schema#",
                            "id": "entitlementStage.json",
                            "title": "Tenant Entitlement Stage Schema",
                            "description": "Tenant entitlement stage descriptor",
                            "type": "object",
                            "properties": {
                                "applicationFlowId": {
                                    "description": "A parent application flow identifier",
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "name": {
                                    "description": "A stage name",
                                    "type": "string"
                                },
                                "status": {
                                    "$schema": "http://json-schema.org/draft-04/schema#",
                                    "id": "types/entitlementFlowStatus.json",
                                    "title": "Application/Stage Execution Status Schema",
                                    "description": "An application/stage execution status",
                                    "type": "string",
                                    "enum": [
                                        "queued",
                                        "in_progress",
                                        "cancelled",
                                        "cancellation_failed",
                                        "failed",
                                        "finished"
                                    ]
                                },
                                "errorType": {
                                    "description": "A relevant error type caused stage failure or cancellation, nullable if stage is finished",
                                    "type": "string"
                                },
                                "errorMessage": {
                                    "description": "A relevant error message caused stage failure or cancellation, nullable if stage is finished",
                                    "type": "string"
                                },
                                "startedAt": {
                                    "description": "Stage execution start timestamp",
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "finishedAt": {
                                    "description": "Stage execution end timestamp",
                                    "type": "string",
                                    "format": "date-time"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
getentitlementstagebyname(applicationFlowId, stageName)

Retrieves entitlement stages by application id

GET /application-flows/{applicationFlowId}/stages/{stageName}

Parameters
  • applicationFlowId (str) – An application flow identifier (format: uuid)

  • stageName (str) – An application stage name

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": "entitlementStage.json",
    "title": "Tenant Entitlement Stage Schema",
    "description": "Tenant entitlement stage descriptor",
    "type": "object",
    "properties": {
        "applicationFlowId": {
            "description": "A parent application flow identifier",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A stage name",
            "type": "string"
        },
        "status": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "types/entitlementFlowStatus.json",
            "title": "Application/Stage Execution Status Schema",
            "description": "An application/stage execution status",
            "type": "string",
            "enum": [
                "queued",
                "in_progress",
                "cancelled",
                "cancellation_failed",
                "failed",
                "finished"
            ]
        },
        "errorType": {
            "description": "A relevant error type caused stage failure or cancellation, nullable if stage is finished",
            "type": "string"
        },
        "errorMessage": {
            "description": "A relevant error message caused stage failure or cancellation, nullable if stage is finished",
            "type": "string"
        },
        "startedAt": {
            "description": "Stage execution start timestamp",
            "type": "string",
            "format": "date-time"
        },
        "finishedAt": {
            "description": "Stage execution end timestamp",
            "type": "string",
            "format": "date-time"
        }
    }
}
getmoduleentitlements(moduleId, **kwargs)

Retrieve a list of module entitlements

GET /entitlements/modules/{moduleId}

Parameters

moduleId (str) – Module id

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

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

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": "installations.json",
    "title": "Tenant Entitlements Schema",
    "description": "List of tenant entitlements (installations)",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "A total number of records"
        },
        "entitlements": {
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "id": "installation.json",
                "title": "Tenant Entitlement Schema",
                "description": "Tenant entitlement descriptor",
                "type": "object",
                "properties": {
                    "applicationId": {
                        "description": "A Name-Version id of application",
                        "type": "string"
                    },
                    "tenantId": {
                        "description": "A tenant identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "modules": {
                        "description": "A list of module identifiers",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "description": "A module identifier"
                        }
                    }
                },
                "required": [
                    "applicationId",
                    "tenantId",
                    "complete"
                ]
            }
        }
    }
}
validate(entitlementRequestBody, **kwargs)

Validates an entitlement request against a set of pre-configured validators that are also applied during the entitlement process or a single validator specified as a parameter.

POST /entitlements/validate

Args:

entitlementRequestBody (dict): See Schema below.

Keyword Args:

entitlementType (str): Entitlement type validator (str): Name of entitlement validator to be applied.

All existing validators will be applied if none specified

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",
    "id": "installationRequest.json",
    "title": "Tenant Entitlement Request Schema",
    "description": "A collection of application ids to install",
    "properties": {
        "tenantId": {
            "description": "Tenant id",
            "type": "string",
            "format": "uuid"
        },
        "applications": {
            "description": "List of application ids",
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "applications",
        "tenantId"
    ]
}