Tenant API (v1)

http://localhost:8081/{version}

Table of contents

/_/tenant

POST /_/tenant

Provision a new / update an existing tenant

POST /_/tenant
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title":  "Tenant Init Information",
  "description": "This is the structure that's POSTed when a module is told about a tenant using it",
  "type": "object",
  "properties": {
    "module_from": {
      "description": "The module ID that is being upgraded or disabled",
      "type": "string"
    },
    "module_to": {
      "description": "The module ID that is being upgraded or enabled",
      "type": "string"
    },
    "parameters": {
      "description": "Parameters that controls what tenant init (eg reference data)",
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "module_to"
  ]
}

Example:

{
  "module_to": "module-1.1",
  "module_from": "module-1.0",
  "parameters": [
    "ref" : "core,
  ]
}

Response 200

tenant id upgraded successfully, returns a list of commands that have failed while initializing the tenant

Body

Media type: application/json

Type: any

Response 201

tenant id added successfully, returns a list of commands that have failed while initializing the tenant

Body

Media type: application/json

Type: any

Response 204

tenant id exists, nothing will be added

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /_/tenant

Does tenant id already exist

GET /_/tenant

Response 200

true or false indicator

Body

Media type: text/plain

Type: any

Example:

Text.....

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

DELETE /_/tenant

drop tenant id

DELETE /_/tenant

Response 204

Delete succeeded

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator