REST Commands : REST API Overview : REST Commands in Multi-Tenant Mode

REST Commands in Multi-Tenant Mode
By default, Doradus executes in single-tenant mode, hence all applications are owned by a single default tenant. In this case, REST commands do not need the ?tenant parameter described in the previous section, and tenant credentials are not used. Even when Doradus is configured to operate in multi-tenant mode, REST commands intended for applications belonging to the default tenant omit the ?tenant parameter and authentication credentials. (The default tenant may be disabled in multi-tenant mode—see the Doradus Administration documentation for details.)
When Doradus is configured to operate in multi-tenant mode, REST commands intended for a specific tenant must include the ?tenant parameter. Each command must also include valid credentials for the corresponding tenant. Credentials are provided using basic authorization, which uses the general Authorization header format shown below:
Authorization: Basic xxx
Where xxx is the tenant user ID and password, separated by a colon, and base64-encoded. For example, if the user ID and password are Katniss:Everdeen, the header would look like this:
Authorization: Basic S2F0bmlzczpFdmVyZGVlbgo=
When Doradus receives this header, the base64 value is decoded and validated against the given tenant. Note that curl supports basic authentication by adding the “-u” parameter. Example:
curl -u Katniss:Everdeen http://localhost:1123/HelloKitty/...
If the tenant user ID or password is incorrect for the identified tenant, the REST command returns a 401 Unauthorized response.
The only commands that should not provide the ?tenant parameter in multi-tenant mode are system commands, which are not directed to a specific tenant. These commands are used by administrators to create tenants and perform diagnostic operations. In multi-tenant mode, system commands must use basic authorization and provide super user credentials. See the Doradus Administration documentation for details.
In the remainder of this documentation, all examples are displayed as if Doradus is operating in single-tenant mode or the command is intended for the default tenant in multi-tenant mode.