http://localhost:8081/{version}
Create tenant job (create, upgrade, delete) An implementation may choose to return 204 if the job is completed by the initial operation; or it may return 201 and start the operation in the background.
POST /_/tenant
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tenantAttributes.schema",
"title": "Tenant job attributes",
"description": "Configuration how to install, upgrade or delete a module for a tenant",
"type": "object",
"properties": {
"module_from": {
"description": "Existing module ID. If omitted, the module is not enabled already",
"type": "string"
},
"module_to": {
"description": "Target module ID. If omitted, the existing module is disabled.",
"type": "string"
},
"purge": {
"description": "On disable should data also be purged",
"type": "boolean"
},
"parameters": {
"description": "Parameters that controls what tenant init (eg reference data)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
Example:
{
"module_to": "mod-sample-1.3.1",
"module_from": "mod-sample-1.0.2",
"parameters": [
{ "key": "loadReference", "value": "true" }
]
}
Tenant job created
URI of the job
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tenantJob.schema",
"title": "Tenant job",
"description": "Tenant job information",
"type": "object",
"properties": {
"id": {
"description": "Job ID",
"type": "string"
},
"tenant": {
"description": "Tenant ID",
"type": "string"
},
"tenantAttributes": {
"description": "Module information - content to initiate operation",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tenantAttributes.schema",
"title": "Tenant job attributes",
"type": "object",
"properties": {
"module_from": {
"description": "Existing module ID. If omitted, the module is not enabled already",
"type": "string"
},
"module_to": {
"description": "Target module ID. If omitted, the existing module is disabled.",
"type": "string"
},
"purge": {
"description": "On disable should data also be purged",
"type": "boolean"
},
"parameters": {
"description": "Parameters that controls what tenant init (eg reference data)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
},
"complete": {
"description": "Whether job is complete (true) or ongoing (false)",
"type": "boolean"
},
"error": {
"description": "Error message if error has occurred",
"type": "string"
},
"messages": {
"description": "Additional messages (warnings, errors)",
"type": "array",
"items": {
"type": "string"
}
}
}
}
Example:
{
"id": "53bd40c8-a420-4ddb-b829-4496ff5e5be4",
"tenant": "diku",
"tenantAttributes" : {
"module_to": "mod-sample-1.3.1",
"module_from": "mod-sample-1.0.2",
"parameters": [
{ "key": "loadReference", "value": "true" }
]
},
"complete": true,
"error": "SQL error",
"messages": [
"first error",
"second error"
]
}
Job completed
Bad user request
Media type: text/plain
Type: any
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal error
Media type: text/plain
Type: any
Example:
Internal server error
Get tenant job
GET /_/tenant/{operation_id}
wait until job change, but no longer than the wait time - in milliseconds. 0 means "no wait" and is behavior if omitted.
Tenant job returned OK
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tenantJob.schema",
"title": "Tenant job",
"description": "Tenant job information",
"type": "object",
"properties": {
"id": {
"description": "Job ID",
"type": "string"
},
"tenant": {
"description": "Tenant ID",
"type": "string"
},
"tenantAttributes": {
"description": "Module information - content to initiate operation",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tenantAttributes.schema",
"title": "Tenant job attributes",
"type": "object",
"properties": {
"module_from": {
"description": "Existing module ID. If omitted, the module is not enabled already",
"type": "string"
},
"module_to": {
"description": "Target module ID. If omitted, the existing module is disabled.",
"type": "string"
},
"purge": {
"description": "On disable should data also be purged",
"type": "boolean"
},
"parameters": {
"description": "Parameters that controls what tenant init (eg reference data)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
},
"complete": {
"description": "Whether job is complete (true) or ongoing (false)",
"type": "boolean"
},
"error": {
"description": "Error message if error has occurred",
"type": "string"
},
"messages": {
"description": "Additional messages (warnings, errors)",
"type": "array",
"items": {
"type": "string"
}
}
}
}
Example:
{
"id": "53bd40c8-a420-4ddb-b829-4496ff5e5be4",
"tenant": "diku",
"tenantAttributes" : {
"module_to": "mod-sample-1.3.1",
"module_from": "mod-sample-1.0.2",
"parameters": [
{ "key": "loadReference", "value": "true" }
]
},
"complete": true,
"error": "SQL error",
"messages": [
"first error",
"second error"
]
}
User error
Media type: text/plain
Type: any
Not found
Media type: text/plain
Type: any
Internal error
Media type: text/plain
Type: any
Example:
Internal server error
Delete job
DELETE /_/tenant/{operation_id}