Create the API Portal Tenant

These instructions pertain to creating an API Portal tenant in a Docker Swarm deployment. For information on how to create tenant on Kubernetes, see Create Tenant for Kubernetes Deployment.
This topic explains how to create API Portal Tenants. Administrators can create multiple tenants. For more information, see Portal Multi-Tenancy.
Use the 
create-tenant.sh
 script to create an external API Portal tenant. The script prompts you for input values that create a simple tenant record in the API Portal database. 
Alternatively, you can run the script and provide tenant data in a prepared JSON file. This option allows you to provide additional details and explicitly set log levels for the tenant. 
After creating the API Portal Tenant, Enroll your Gateway with the Portal.
When registering your new Portal tenant with your Gateway, you must perform a manual routing. Follow the instructions in Create Tenant for Kubernetes Deployment.
Before You Begin
The following prerequisites are required to create a tenant:
  • API Portal is installed
  • cURL 7.29.0 or later is installed
Optional: A JSON file with pre-configured values for tenant creation.
How to Check Your cURL Version
Use the 
--version
 argument to check the cURL version.
The following sample displays the cURL version:
[root@apim util]# curl --version curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.21 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
Create a Tenant
The 
create-tenant.sh
 script is located in the 
util
 directory.
Create a standard tenant by typing values when prompted by the script. For more advanced configuration, specify the 
-d
 argument and provide data in a prepared JSON file.
For more information on available tenant configuration, see Tenant Parameters.
To create the tenant:
  1. Run the 
    create-tenant.sh
     script:
    [root@apim util]# ./create-tenant.sh
    Optionally, use the 
    -d
     argument and specify a prepared JSON file that you have uploaded to the 
    util
     directory:
    [root@apim util]# ./create-tenant.sh -d
    tenantconf.json
    where 
    tenantconf.json
     is the name of your json file. For more information, see Preparing a JSON File.
  2. Did you specify a JSON file? If so, go to the next step.
    Otherwise, follow the prompts for the standard parameters:
    • Tenant ID
    • Portal name
    • Admin email
    • No Reply email
    • Terms of use (EULA)
  3. Provide the
     path to your key
    . The default key file and path is 
    ../certs/apim.pem
    .
The tenant is created and the tenant record is added to the database.
To verify, open the 
tenant_info
 file in the current directory.
Preparing a JSON File with Tenant Data
A JSON file containing tenant values can be specified when running the 
create-tenant.sh
 script with the 
-d
 argument. The file allows you to set more advanced parameters for your tenant. 
To prepare the JSON file:
  1. Create the file in JSON format using any of the tenant parameters. The file must be a valid JSON file, otherwise an error occurs. 
  2. Upload the file to the Portal server util directory.
The following code displays an example of a prepared JSON file for tenant creation:
{ "adminEmail": "admin@domain.com", "noReplyEmail": "noreply@domain.com", "portalName": "Portal TSSG2", "subdomain": "mycompany.com", "tenantId": "mytenant", "auditLogLevel": "ERROR", "multiclusterEnabled": true, "performanceLogLevel": "ERROR", "portalLogLevel": "ERROR", "tenantType": "ON-PREM", "termOfUse": "EULA" }
 Tenant Parameters 
Tenant Parameters 
Standard
Notes
adminEmail
*
The Admin email of the tenant
noReplyEmail
*
The tenant no-reply-email
portalName
*
Name of the portal.
Restrictions:
  • Lowercase letters (a-z) and numbers (0-9) only
  • 255 characters maximum
subdomain
The portal subdomain
tenantId
*
The Tenant ID you create
Restrictions:
  • Lowercase letters (a-z) and numbers (0-9) only
  • 255 characters maximum
auditLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
multiclusterEnabled
Either 
true
 or 
false
.
Set to 
true
 for a tenant with an API Portal integrated with on-premise API proxy clusters.
Set to 
false
 for a SAAS Portal.
performanceLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
portalLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
tenantType
One of the following values:
  • SAAS
  • ON-PREM
termOfUse
*
Your tenant term of use. 
One of the following:
  • A string, such as "EULA"
  •  
    null