Okapi Core API 2.0 Documentation

Endpoints

/_/deployment/modules

Description

Deployment service. This is responsible for starting and stopping modules.

post

Description

Deploy (launch process, start a container, etc) instance of a particular service, according to the deployment descriptor.

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "DeploymentDescriptor",
  "description" : "Module deployment information. There are two modes: deployment managed by Okapi (with nodeId specified) and remote module (with url specified).",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "srvcId": {
      "description": "The Module ID for the instance",
      "type": "string"
    },
    "instId": {
       "description": "Instance ID (at least unique for node)",
       "type": "string"
    },
    "nodeId": {
      "description": "Node ID where module is deployed",
      "type": ["string", "null"]
    },
    "url": {
      "description": "URL where module is deployed (not managed by Okapi)",
      "type": ["string", "null"]
    },
    "descriptor" : {
      "description": "Deployment details",
      "$ref": "LaunchDescriptor.json"
    }
  },
  "required": ["srvcId"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

Location string

URI to the descriptor of the deployed instance

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

get

Description

List all deployed instances

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

/_/deployment/modules/{instance_id}

URI Parameters

instance_id string required

get

Description

Retrieve deployment descriptor for a particular instance

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

delete

Description

shutdown instance

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

/_/discovery/health

Description

Health service for individual instances

get

Description

Get health info for all services

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/discovery/health/{service_id}

URI Parameters

service_id string required

get

Description

Health for all instances for a particular service

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

/_/discovery/health/{service_id}/{instance_id}

URI Parameters

instance_id string required

get

Description

get health for a particular instance

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

/_/discovery/modules

Description

Discovery service. This is responsible for monitoring all instances (deployed) on, possibly many, deployment nodes.

post

Description

Register instance under a specified service id

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "DeploymentDescriptor",
  "description" : "Module deployment information. There are two modes: deployment managed by Okapi (with nodeId specified) and remote module (with url specified).",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "srvcId": {
      "description": "The Module ID for the instance",
      "type": "string"
    },
    "instId": {
       "description": "Instance ID (at least unique for node)",
       "type": "string"
    },
    "nodeId": {
      "description": "Node ID where module is deployed",
      "type": ["string", "null"]
    },
    "url": {
      "description": "URL where module is deployed (not managed by Okapi)",
      "type": ["string", "null"]
    },
    "descriptor" : {
      "description": "Deployment details",
      "$ref": "LaunchDescriptor.json"
    }
  },
  "required": ["srvcId"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

Location string

URI to the registered instance

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

get

Description

Return all instances

Responses

200 OK

Ok

Response Headers

Location string

URI to the registered instance

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

delete

Description

delete all instances

Responses

204 No Content

Ok

Response Headers

X-Okapi-Trace string

Okapi trace and timing

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/discovery/modules/{service_id}

URI Parameters

service_id string required

get

Description

List all instances for a particular service

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

delete

Description

Remove registration for a given instance

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

404 Not Found

Not Found

Response Example (text/plain)

/_/discovery/modules/{service_id}/{instance_id}

URI Parameters

instance_id string required

get

Description

get registration of a specified instance

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

delete

Description

Remove registration for a given instance

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

404 Not Found

Not Found

Response Example (text/plain)

/_/discovery/nodes

Description

Get information about nodes

get

Description

Get list of all nodes

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/discovery/nodes/{node_id}

URI Parameters

node_id string required

put

Description

Update descriptor of a particular node, only the name can be changed

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "NodeDescriptor",
  "description": "Deployment node information",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "nodeId": {
      "description": "Node ID",
      "type": "string"
    },
    "url": {
      "description": "Host:port for for this node",
      "type": "string"
    },
    "nodeName": {
      "description": "Human readable node name",
      "type": "string"
    }
  },
  "required": ["nodeId", "url"]
}

Request Example (application/json)

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

get

Description

Get info for one node

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/env

Description

Environment service. Environment variables are system variables that allows us to configure modules in a uniform way. They can hold fundamental database configuration, etc.

post

Description

Add environment entry

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "EnvEntry",
  "description": "Environment Variable",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "name": {
      "description": "Key",
      "type": "string"
    },
    "value": {
      "description": "Value",
      "type": "string"
    },
    "description": {
      "description": "Description",
      "type": "string"
    }
  },
  "required": ["name"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

Location string

URI to the environment entry instance

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

get

Description

Get list of all environment variables

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/env/{id}

URI Parameters

id string required

get

Description

Get info for one environment variable

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

delete

Description

Remove environment variable

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

404 Not Found

Not Found

Response Example (text/plain)

/_/invoke/tenant/{id}

Description

Call module with Tenant ID in path. This service offers support for systems that need to "call-back" Okapi and don't allow setting the Tenant ID in the HTTP header.

URI Parameters

id string required

get

Description

Invoke any service (the rest of the path, any method, any response).

Responses

200 OK

OK

Response Example (text/plain)

/_/proxy/health

Description

Health of modules as seen from proxy

get

Description

Check health of modules

Responses

200 OK

OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

500 Internal Server Error

Server Error

/_/proxy/modules

Description

Proxy modules service

post

Description

Announce new module to the proxy. Once successful a module can be selected for a specific tenant.

Query Parameters

check boolean

Whether to check dependencies

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ModuleDescriptor",
  "description": "A FOLIO Module",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Module ID with format product-semver",
      "type": "string"
    },
    "name": {
      "description": "Short name for module (should not include version)",
      "type": "string"
    },
    "tags" : {
      "description": "Module tags",
      "type" : ["array", "null"],
      "items" : {
        "description": "Module tag",
        "type": "string"
      }
    },
    "requires": {
      "description": "Required interfaces",
      "type": ["array", "null"],
      "items": {
        "$ref": "InterfaceReference.json"
      }
    },
    "provides": {
      "description": "Provided interfaces",
      "type": ["array", "null"],
      "items": {
        "$ref": "InterfaceDescriptor.json"
      }
    },
    "filters": {
      "description": "Provided filters",
      "type": "array",
      "items": {
        "$ref": "RoutingEntry.json"
      }
    },
    "permissionSets": {
      "description": "Module Permission Sets",
      "type": ["array", "null"],
      "items": {
        "$ref": "Permission.json"
      }
    },
    "uiDescriptor": {
      "description": "UI module descriptor",
      "$ref": "UiModuleDescriptor.json"
    },
    "launchDescriptor": {
      "description": "Default deployment for this module",
      "$ref": "LaunchDescriptor.json"
    }
  },
  "required": ["id"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Location string

URI to the created module instance

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

get

Description

List all or subset of modules for proxy

Query Parameters

filter string

Filter by module ID

full boolean

whether full or compact MD should be returned

orderBy string

Order by field

order string

Order

Possible values:
  • desc
  • asc
preRelease boolean

whether to include modules with pre-release info

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/proxy/modules/{module_id}

URI Parameters

module_id string required

get

Description

Retrieve descriptor for a particular module

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

put

Description

Update descriptor of a particular module

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ModuleDescriptor",
  "description": "A FOLIO Module",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Module ID with format product-semver",
      "type": "string"
    },
    "name": {
      "description": "Short name for module (should not include version)",
      "type": "string"
    },
    "tags" : {
      "description": "Module tags",
      "type" : ["array", "null"],
      "items" : {
        "description": "Module tag",
        "type": "string"
      }
    },
    "requires": {
      "description": "Required interfaces",
      "type": ["array", "null"],
      "items": {
        "$ref": "InterfaceReference.json"
      }
    },
    "provides": {
      "description": "Provided interfaces",
      "type": ["array", "null"],
      "items": {
        "$ref": "InterfaceDescriptor.json"
      }
    },
    "filters": {
      "description": "Provided filters",
      "type": "array",
      "items": {
        "$ref": "RoutingEntry.json"
      }
    },
    "permissionSets": {
      "description": "Module Permission Sets",
      "type": ["array", "null"],
      "items": {
        "$ref": "Permission.json"
      }
    },
    "uiDescriptor": {
      "description": "UI module descriptor",
      "$ref": "UiModuleDescriptor.json"
    },
    "launchDescriptor": {
      "description": "Default deployment for this module",
      "$ref": "LaunchDescriptor.json"
    }
  },
  "required": ["id"]
}

Request Example (application/json)

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

delete

Description

Remove module descriptor for a particular module, module will no longer be selectable by tenants

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

/_/proxy/pull/modules

Description

Pull module descriptors from a remote repository

post

Description

Pull modules (i.e. Module Descriptors) from a remote repository. The PullDescriptor includes one or more URLs. And the operation will try all URLs in order until one succeeds. Hence, the URLs should be pointing to identical remote repositories.

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "PullDescriptor",
  "description": "Information controlling the pull facility",
  "type": "object",
  "properties": {
    "urls": {
      "description": "List of URLs from which Okapi attempts pulling",
      "type": "array",
      "items" : {
         "type" : "string"
      }
    }
  }
}

Request Example (application/json)

Responses

200 OK

OK

Response Headers

Location string
X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

/_/proxy/tenants

Description

Tenants service

post

Description

Create a new tenant

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TenantDescriptor",
  "description": "Tenant information",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Tenant ID",
      "type": "string"
    },
    "name": {
      "description": "Tenant name",
      "type": "string"
    },
    "description": {
      "description": "Tenant description",
      "type": "string"
    }
  }
}

Request Example (application/json)

Responses

201 Created

Tenant has been created

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Location string

URI to the created tenant

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

get

Description

List all tenants

Responses

200 OK

List of tenants in a brief format

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

/_/proxy/tenants/{tenant_id}

URI Parameters

tenant_id string required

get

Description

Retrieve a tenant

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

put

Description

Update a tenant

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TenantDescriptor",
  "description": "Tenant information",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Tenant ID",
      "type": "string"
    },
    "name": {
      "description": "Tenant name",
      "type": "string"
    },
    "description": {
      "description": "Tenant description",
      "type": "string"
    }
  }
}

Request Example (application/json)

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

delete

Description

Remove a tenant

Responses

204 No Content

Response Headers

X-Okapi-Trace string

Okapi trace and timing

400 Bad Request

Bad Request

Response Example (text/plain)

403 Forbidden

Forbidden

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/install

post

Description

Enable, disable or upgrade one or more modules for tenant. The request body and response body is of the same type TenantModuleDescriptorList. This list includes one or more modules to be enabled, disabled or upgraded. The request is the initial desired changes and the response is the list of changes that must be fulfilled to satisfy dependencies. This service will eventually partially replace /_/proxy/tenants/{tenant}/modules . It also allows enabling multiple modules in in one transaction. For simulate=true, the response, can be viewed as a recipe for what must be deployed (optionally) and enabled/disabled by the existing tenants-modules CRUD service.

Query Parameters

deploy boolean

whether to deploy (or undeploy if disabling)

simulate boolean

Whether the installation is simulated

preRelease boolean

Whether pre-releases should be considered for installation.

purge boolean

Disabled modules will also be purged.

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TenantModuleDescriptorList",
  "description": "List of module transitions",
  "type": "array",
  "items": {
    "$ref": "TenantModuleDescriptor.json"
  }
}

Request Example (application/json)

Responses

200 OK

OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/interfaces

get

Description

Get all interfaces for tenant

Query Parameters

full boolean

whether brief or full interface list

type string

limit by interfaceType

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Client Error

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/interfaces/{interface_id}

URI Parameters

interface_id string required

get

Description

Get all modules that provide the specified interface ID

Query Parameters

type string

limit by interfaceType

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Client Error

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/modules

post

Description

Enable a module for tenant. Only the member 'id' from TenantModuleDescriptor is used in this operation. This call will eventually be replaced by the 'install' service.

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TenantModuleDescriptor",
  "description": "Module transitions",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Module ID (or just product part)",
      "type": "string"
    },
    "from": {
      "description": "Original Module ID when transitioning from one module to another",
      "type": "string"
    },
    "action" : {
      "description": "Module action",
      "type" : "string",
      "enum" : [ "enable", "disable", "uptodate", "suggest", "conflict" ]
    },
    "message": {
      "description": "Diagnostic Message",
      "type": "string"
    }
  },
  "required" : ["id"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Location string

URI to the enabled module

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

get

Description

Get enabled modules for tenant

Query Parameters

full boolean

whether full or compact MD should be returned

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/modules/{module_id}

Description

CRUD service for getting module and upgrading module for a tenant.

URI Parameters

module_id string required

get

Description

Look up particular module selection

Responses

200 OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

404 Not Found

Not Found

Response Example (text/plain)

post

Description

Upgrade a module for a tenant. Enable new module and disable current module with new module ID in body and existing ID in path. This call will eventually be replaced by the 'install' service.

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TenantModuleDescriptor",
  "description": "Module transitions",
  "type": "object",
  "additionalProperties" : false,
  "properties": {
    "id": {
      "description": "Module ID (or just product part)",
      "type": "string"
    },
    "from": {
      "description": "Original Module ID when transitioning from one module to another",
      "type": "string"
    },
    "action" : {
      "description": "Module action",
      "type" : "string",
      "enum" : [ "enable", "disable", "uptodate", "suggest", "conflict" ]
    },
    "message": {
      "description": "Diagnostic Message",
      "type": "string"
    }
  },
  "required" : ["id"]
}

Request Example (application/json)

Responses

201 Created

Created

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Location string

URI to the enabled module

Response Example (application/json)

400 Bad Request

Client Error

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)

delete

Description

Disable a module for a tenant. This call will eventually be replaced by the 'install' service.

Responses

204 No Content

Gone

Response Headers

X-Okapi-Trace string

Okapi trace and timing

400 Bad Request

Client Error

Response Example (text/plain)

/_/proxy/tenants/{tenant_id}/upgrade

post

Description

Check if newer modules of exist and upgrade for tenant. The response is a list of modules that should be enabled, disabled or upgraded to perform the upgrade.

Query Parameters

deploy boolean

whether to deploy (or undeploy if disabling)

simulate boolean

whether the upgrade is simulated

preRelease boolean

Whether pre-releases should be considered for installation.

purge boolean

Disabled modules will also be purged.

Responses

200 OK

OK

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (application/json)

400 Bad Request

Bad Request

Response Example (text/plain)

404 Not Found

Not Found

Response Example (text/plain)

500 Internal Server Error

Server error

Response Example (text/plain)

/_/version

Description

Service for getting information about Okapi

get

Description

get Okapi version

Responses

200 OK

OK, with version in body

Response Headers

X-Okapi-Trace string

Okapi trace and timing

Response Example (text/plain)

400 Bad Request

Bad Request

Response Example (text/plain)

500 Internal Server Error

Server Error

Response Example (text/plain)