API Server Startup Options

Before starting API Server, you can add options either as environment variables or as Java system properties to the Java command line for your server. For example, you can install the API Server license by adding the LAC_DEFAULT_LICENSE_FILE option when you start API Server.
lac51
Before starting API Server, you can add options either as environment variables or as Java system properties to the Java command line for your server. For example, you can install the API Server license by adding the 
LAC_DEFAULT_LICENSE_FILE
 option when you start API Server.
In this article:
 
 
Install the API Server License
You can install the API Service license by adding the following option when you start API Server:
LAC_DEFAULT_LICENSE_FILE
Set the value for this option as the complete path to a valid license file.
 
Example:
 
The following example sets the path to the 
LACLicense.txt
 license file and installs the API Server license:
-DLAC_DEFAULT_LICENSE_FILE=/Users/jdoe/LACLicense.txt
After 
CA Live API Creator
 has started the first time, we recommend that you remove this environment variable. 
For more information about how to install the license, see Import the API Server License.
Set the Initial Password for the System Administrator (sa) User
You can set the initial password for the system administrator (
sa
) user by adding the following option when you start API Server:
LAC_INITIAL_SA_PASSWORD
 
Example:
 
The following example sets the password for the system administrator (
sa
) user to 
MySAPassword
:
-DLAC_INITIAL_SA_PASSWORD=MySAPassword
After you have set the initial password for the system administrator (
sa
) user and 
CA Live API Creator
 has started the first time, we recommend that you remove this environment variable.
Set the Password for the Initial API Developer
You can set the password for the initial API developer (a TeamSpace user) for the 
default
 TeamSpace by adding the following option when you start API Server:
LAC_INITIAL_ADMIN_PASSWORD
The value for this option is the default password for the initial API developer (a TeamSpace user). You can change the password for the TeamSpace user at any point.
For more information about how to change passwords for TeamSpace users, see Manage TeamSpace Users.
 
Prerequisite:
 Your admin repository is empty. API Server initializes your admin repository when you start API Server the first time.
 
Example:
 
The following example sets the password for the initial API developer user to 
MyAdminPassword
:
-DLAC_INITIAL_ADMIN_PASSWORD=MyAdminPassword
Set the URL Fragment for the Default TeamSpace
You can set the URL fragment for the 
default
 TeamSpace by adding the following option when you start API Server:
LAC_INITIAL_ACCOUNT_URL_NAME
The value for this option is the default password for the initial API developer (a TeamSpace user). You can change the password for the TeamSpace user at any point.
For more information about how to change passwords for TeamSpace users, see Manage TeamSpace Users.
 
Prerequisite:
 Your admin repository is empty. API Server initializes your admin repository when you start API Server the first time.
 
Example:
 
The following example sets the URL fragment for the 
default
 TeamSpace to 
MyTeamSpaceURLFragment
:
LAC_INITIAL_ACCOUNT_URL_NAME=MyTeamSpaceURLFragment
Set the Name for the Default TeamSpace
You can set the name for the 
default
 TeamSpace by adding the following option when you start API Server:
LAC_INITIAL_ACCOUNT_NAME
The value for this option is the default password for the initial API developer (a TeamSpace user). You can change the password for the TeamSpace user at any point.
For more information about how to change passwords for TeamSpace users, see Manage TeamSpace Users.
 
Prerequisite:
 Your admin repository is empty. API Server initializes your admin repository when you start API Server the first time.
 
Example:
 
The following example sets the name for the 
default
 TeamSpace to 
MyTeamSpaceName
:
LAC_INITIAL_ACCOUNT_NAME=MyTeamSpaceName
Pre-accept the End-User License Agreement
You can bypass the API Creator screen that asks the initial API developer to log in to accept the user license, and pre-accept the end-user license agreement (EULA) by adding the following option when you start API Server:
CA_ACCEPT_LICENSE
 
Example:
 
The following example accepts the EULA for the English language (
ENU
):
CA_ACCEPT_LICENSE=ENU
 For historical reasons, you can use the lowercase form of this option,
ca_accept_license
. For forward compatibility, use uppercase.
Set the Unique Identifier for a Server Instance
You can set the unique identifier for a server instance by adding the following option when you start API Server:
LAC_SERVER_IDENT
In a cluster, each server must have a unique ID, which is by default a UUID. For example, you can name your server instances by adding this option when starting API Server. Enter a unique name for each server in the cluster.
 
Example:
 
The following example sets the server name to 
Server42
:
LAC_SERVER_IDENT=Server42
For more information about the location of the file that contains the unique identifier for a server instance, see View your API Definition.
Set the Absolute Path of the Logging Configuration File
You can set the absolute path of the logging configuration file by adding the following option when you start API Server:
LAC_LOGGING_CONFIG_FILE
 
Example:
 
The following example sets the absolute path to 
/<path_to_your_logging_configuration_file>/<configuration_file_name>
:
-DLAC_LOGGING_CONFIG_FILE=/<path_to_your_logging_configuration_file>/<configuration_file_name>
For more information about the syntax for this option, see External Logging.
Prevent Log Injection
By default, API Server does not require log encoding. You can prevent log injection by setting API Server to require log encoding. Prevent log injection by adding the following option when you start API Server:
LAC_LOG_ENCODING_REQUIRED
 
Values:
 
  •  
    true
    : API Server requires log encoding.
  •  
    false
    : API Server does not require log encoding.
 
Default value:
 
false
 
 
 
Example:
 
The following example sets API Server to require log encoding and, therefore, prevent log injection:
-DLAC_LOG_ENCODING_REQUIRED=true
Set the Location of your Admin Repository
You can set the location of your admin repository by adding the following option when you start API Server:
LAC_REPOSITORY_ROOT
Set the value for this option as the complete path to your admin repository.
 
 
Default value:
 ~
/CALIveAPICreator.repository
 
 
Example:
 
The following example sets the location for your admin repository:
-DLAC_REPOSITORY_ROOT=${HOME}/CALiveAPICreator.repository
For more information about the admin repository, see View your API Definition.
Set the Location From Which 
CA Live API Creator
 Pulls your Admin Repository
By default, when you first start API Server, 
CA Live API Creator
 pulls your admin repository from the location that you set using the 
LAC_REPOSITORY_ROOT
 option. You can set or change this location (URL or Git) from which 
CA Live API Creator
 pulls your admin repository by adding the following option when you start API Server:
LAC_REPOSITORY_CONFIGURATION_URL
Set the value for this option as the complete path to the location.
 
Default value:
 ~
/CALIveAPICreator.repository
 
 
Example:
 
The following example sets the location to 
https://s3-us-west-1.amazonaws.com/mybucket/myRepository.zip
:
-DLAC_REPOSITORY_CONFIGURATION_URL= https://s3-us-west-1.amazonaws.com/mybucket/myRepository.zip
For more information about the admin repository, see View your API Definition.
Set API Server to Back Up What is in Memory
Each time a TeamSpace user changes API metadata, API Server saves a backup of the changes to your API definitions to the 
backups/timeline
 directory. By default, API Server does not back up what is in memory. If you have set API Server to back up what is in memory, it retains these backups for ten days of development activities. You can have API Server back up what is in memory by adding the following option when you start API Server:
LAC_REPOSITORY_BACKUP
 
Values:
 
  •  
    true
    : API Server backs up what is in memory.
  •  
    false
    : API Server does not back up what is in memory.
 
Default value:
 
false
 
 
Example:
 
The following example sets API Server to back up what is in memory when you start your server:
-DLAC_REPOSITORY_BACKUP=true
 
CA Live API Creator
 does not require backups of your admin repository when you start API Server or if you change your API during runtime. Consider excluding this option in your test and production environments.
For more information about this directory in the admin repository, see View your API Definition.
Set the Number of Days API Server Retains Backups
By default, API Server retains a backup of what is in memory for ten days. You can set the number of days in which you have changed API metadata and you want API Server to retain a backup of what is in memory by adding the following option when you start API Server:
LAC_REPOSITORY_BACKUP_DAYS_TO_KEEP
 
Default value:
 
10
 
 
Example:
 
The following example sets API Server to retain the backup that is in memory for 30 days:
-DLAC_REPOSITORY_BACKUP_DAYS_TO_KEEP=30
Set API Server to Write to Disk The Changes That you Make to the Admin Repository
By default, API Server does not write to disk the changes that you make to the admin repository. In production environments, you can prevent API Server from writing to disk the changes that you make to the admin repository by adding the following option when you start API Server:
LAC_REPOSITORY_DISABLE
Setting the value for this option directs API Server to bootstrap the server instance to the admin repository (the location that you set using the 
LAC_REPOSITORY_CONFIGURATION_URL
 option).
 
Values:
 
  •  
    true
    : API Server writes to disk the changes that you make to the admin repository. 
  •  
    false
    : API Server does not write to disk the changes that you make to the admin repository.
 
Default: 
 
false
 
 
Example:
 
The following example sets API Server to write to disk the changes that you make to the admin repository:
-DLAC_REPOSITORY_DISABLE=true
Configure Hazelcast for Cluster Synchronization Strategy
You can configure Hazelcast for cluster synchronization strategy by adding the following option when you start API Server:
LAC_CLUSTER_SYNC_STRATEGY
If you plan to use timers or MQTT listeners that rely on cluster synchronization, you must add this option each time you start API Server.
 
Values:
 
  •  
    in_memory
    : Nodes assign themselves identification numbers that are based on the order in which the Hazelcast cluster initializes the nodes. Hazelcast decides using these ID numbers.
  •  
    in_memory_with_locking
    CA Live API Creator
     uses a shared map to hold a mutex that the active nodes refer to before deciding.
 
Example:
 
The following example sets API Server to write to disk the changes that you make to the admin repository:
-DLAC_CLUSTER_SYNC_STRATEGY=in_memory_with_locking
For more information about how to configure Hazelcast for cluster configuration strategy, see Configure to Run as a Cluster.
Assign the Path of the Hazelcast Configuration XML File
You can assign the path of the Hazelcast configuration XML file when determining how nodes discover each other in a cluster by adding the following option when you start API Server:
hazelcast.config
Set the value for this option as the complete path to the file.
 
Example:
 
The following example sets the path to
/foo/bar/hazelcast.xml
:
hazelcast.config=/foo/bar/hazelcast.xml
For more information about how to determine how nodes discover each other in a cluster, see Configure to Run as a Cluster.
Access the In-Memory Derby Database
This option is only for advanced users. Add this option only if you are performing advanced troubleshooting and you require access to the in-memory Derby database from a database client tool.
By default, API users cannot access the in-memory Derby database. You can set the port number on which API users access the database by adding the following option when you start API Server:
LAC_DERBY_SERVER_PORT
Set the value for this option as the port number on which you access the database. This option requires that you also add the option to set the network on which to start API Server (the 
LAC_DERBY_SERVER_HOST
 option).
 
Example:
 
The following example sets the value for the port number on which API users access the database to 
1527
:
-DLAC_DERBY_SERVER_PORT=1527
Then API users can access the database using the following URL:
jdbc:derby://localhost:1527/memory:AdminDB
 A username and password are required to access the in-memory Derby database. Any username and password combination works.
Set the Network on Which to Start API Server
This option is only for advanced users. Add this option only if you are performing advanced troubleshooting and you require access to the in-memory Derby database from a database client tool.
You can set the network on which API users access the database by adding the following option when you start API Server:
LAC_DERBY_SERVER_HOST
Set the value for this option as the port number on which you access the database. If you have added the option to access the in-memory Derby database (the 
LAC_DERBY_SERVER_PORT
 option), you must also add this option.
 
Default:
 
localhost
 
Example:
 
The following example sets the value for the network to 
localhost
:
-DLAC_DERBY_SERVER_HOST=localhost
Set API Server to Optimize JavaScript
In JDK 9 or later, the Nashorn JavaScript engine attempts to optimize its compilation of JavaScript code. This optimization is expensive at first, which means that the first minute or two of execution can be sluggish. By default, API Server does not optimize JavaScript in JDK 9 and later. In this case, you might not get all the possible performance. If you do not mind your service being a bit slow to rev up, you can set API Server to optimize JavaScript. This can give you some extra performance after it completes compilation.
You can set API Server to optimize JavaScript by adding the following option when you start API Server:
LAC_ENABLE_NASHORN_OPT_TYPES
 
Values:
 
  •  
    true
    : API Server optimizes JavaScript. 
  •  
    false
    : API Server does not optimize JavaScript.
 
Default
false
 
 
Example:
 
The following example sets API Server to optimize JavaScript:
-DLAC_ENABLE_NASHORN_OPT_TYPES=true
Disable API Server from Running Timers
By default, API Server runs the background thread for the timer scheduler. You can disable API Server from running this background thread by adding the following option when you start API Server:
LAC_SCHEDULING_DISABLE
If your APIs do not require or use timers, disable API Server from running timers by setting this option to 
true
. In production environments, consider optimizing performance by setting this option to 
true
.
 
Values:
 
  •  
    true
    : API Server does not run the background thread for the timer scheduler. 
  •  
    false
    : API Server runs the background thread for the timer scheduler.
 
Default
false
 
 
Example:
 
The following example disables API Server from running the background thread for the timer scheduler:
-DLAC_SCHEDULING_DISABLE=true