Manage Tenant

A Tenant is a dedicated environment that is totally isolated from other tenants.

Data model

A Tenant is just an String id and a description.

{
  "key": "string",
  "description": "string"
}

Security

Additionnal security header is added to manage the creation and deletion of a tenant.

Please refer to the documentation.

API

Tenant expose a classic REST API :

List all

curl --include -X GET http://localhost:9000/api/tenants \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Nio-Client-Id: xxx' \
    -H 'Nio-Client-Secret: xxx'

Will respond with a 200 status code :

[
  {
    "key": "sandbox",
    "description": "Default tenant from config file"
  }
]

Create a tenant

curl --include -X POST http://localhost:9000/api/tenants \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Nio-Client-Id: xxx' \
    -H 'Nio-Client-Secret: xxx' \
    -H 'tenant-admin-secret: xxx' \
    -d '{"key": "aNewTenant", "description" : "my new tenant"}'

Will respond with a 201 status code :

{
  "key": "aNewTenant",
  "description": "my new tenant"
}

Delete a tenant

curl --include -X POST http://localhost:9000/api/tenants/aNewTenant \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Nio-Client-Id: xxx' \
    -H 'Nio-Client-Secret: xxx' \
    -H 'tenant-admin-secret: xxx'

Will respond with a 200 status code.