The command line tool offers much the of the same functionality as the Configuration Utility.
Access and Use
The command line tool is here:
[Installation path]\Smart3D\WebApi\ConfigUtility\ Smart3DWebApiConfigurationUtility.exe
Anytime you use the tool, you must include the start command with the /wait argument:
start /wait Smart3DWebApiConfigurationUtility.exe <arguments>
Otherwise, the command window immediately prompts for the next line to be entered, which might cause issues with future user input.
Arguments Overview
Command |
Argument |
Description |
---|---|---|
Help |
/? |
Used to request usage information about the available commands |
Import |
/i |
Used to import a saved configuration |
Export |
/x |
Used to export the current configuration |
Database |
/w |
Used to create a configuration database |
Validate |
/v |
Used to validate the current setup through a series of tests |
Metadata |
/m |
Used to regenerate the metadata for the enabled plants |
You cannot combine commands. For example, /i (Import) cannot be combined with /w
(Database) or /m (Metadata).
Qualifiers |
Argument |
Description |
---|---|---|
Encrypt |
/e |
Used to encrypt a file |
Decrypt |
/d |
Used to decrypt a file |
Password |
/p |
Used to supply a password for a command |
File |
/f |
Used to supply the file path for a command |
Name |
/n |
Used to supply the name of an item for a command |
UserName |
/u |
Used to supply the username for a command |
Server |
/s |
Used to supply the server name for the database |
Type |
/t |
Database type (MSSQL or Oracle) |
Migrate Database |
/migrate |
Used to migrate the API configuration database if it is out-of-date |
Site Alias Name |
/a |
Used to supply the site alias name for a command |
Restart Website |
/r |
Used to restart the website after a successful configuration |
Help Command
Use /? to bring up a quick reference guide to the commands, arguments, and needed parameters for different actions.
Example
start /wait <ConfigToolExe> /?
Encrypt Command
Use /e to encrypt a file.
Parameters
-
File, /f [file path], required, file path is the path to the file to encrypt.
-
Password, /p [password], optional; password is the encryption key to use.
-
If not given, then the password will be prompted in a character hidden input.
-
Remember this key for later to use as the password for decrypting the file.
-
Examples
-
start /wait <ConfigToolExe> /e /f C:\MyConfig.json
-
start /wait <ConfigToolExe> /e /f C:\MyConfig.json /p MyPassword
Decrypt Command
Use /d to decrypt a file. The resulting decrypted file overwrites the encrypted file.
Parameters
-
File, /f [file path], required; file path is the path to the encrypted file to decrypt.
-
Password, /p [password], optional; password is the key that was used to encrypt. If not given, then the password will be prompted in a character hidden input.
Examples
-
start /wait <ConfigToolExe> /d /f C:\MyConfig.json
-
start /wait <ConfigToolExe> /d /f C:\MyConfig.json /p MyPassword
Database Command
Use /w to create or set up the web API configuration database.
Parameters
-
Type, /t, the type of database to use (DB Provider).
-
Server, /s, the server where the database exists. For Microsoft SQL Server, enter the instance name. For Oracle, enter the full datasource string using this format:
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=SERVERNAME)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SERVICENAME)))"
-
Name, /n, name of the database to use.
-
User, /u, optional; use to provide admin credentials. If not given, then integrated Windows Authentication is used.
-
Password, "/p", optional, password corresponding to user. Migrate Database, /migrate, optional, used to migrate an out-of-date API configuration database. If not given, you are prompted to press Y to migrate or N to abort.
Examples
-
start /wait <ConfigToolExe> /w /t MSSQL /s MyServer /n DbName
-
start /wait <ConfigToolExe> /w /t MSSQL /s MyServer /n DbName /u UserName /p Password
-
start /wait <ConfigToolExe> /w /t MSSQL /s MyServer /n DbName /migrate
Import Command
Use /i to import a saved configuration from file to replace the current setup. Run this command on the computer that will act as the web server. If the configuration database referenced in the file does not exist or does not have the API tables, run the Database command and try again.
Parameters
-
File, /f [file path], required, file path is the path to the saved configuration.
-
Password, /p [password], optional, password is the key that was used to encrypt. If not given and encrypted, then the password will be prompted in a character hidden input.
-
Migrate Database, /migrate, optional, used to migrate out-of-date API configuration databases. If not given, you are prompted to press Y to migrate or N to abort.
-
Restart Website, /r, optional, used to restart website after a successful configuration
If you are using Oracle and the configuration file does not have the full datasource
string, you are prompted to enter the details of Oracle server. Enter host name, service
name, protocol, and port.
Examples
-
start /wait <ConfigToolExe> /i /f C:\MyConfig.json
-
start /wait <ConfigToolExe> /i /f C:\MyConfig.json /p MyPassword
-
start /wait <ConfigToolExe> /i /f C:\MyConfig.json /migrate
-
start /wait <ConfigToolExe> /i /f C:\MyConfig.json /r
Export Command
Use /x to export the current configuration to a file. Run this command on the computer that acts as the web server to have access to the configuration file:
-
For the Smart 3D Web API - Web.config
-
For the Smart 3D Admin Web API - appsettings.json
Parameters
-
File, /f [file path], required; file path is the path to the saved configuration.
-
Decrypt, /d, optional; used to indicate that the exported configuration file should be unencrypted.
-
Password, /p [password], optional; password is the key that was used to encrypt. If not given and decrypt argument is not given, then the password will be prompted in a character hidden input.
Examples
-
start /wait <ConfigToolExe> /x /f C:\MyConfig.json
-
start /wait <ConfigToolExe> /x /f C:\MyConfig.json /p MyPassword
-
start /wait <ConfigToolExe> /x /f C:\MyConfig.json /d
Metadata Command
Use /m to regenerate the metadata for enabled plants.
Parameters
-
Name, /n [name of plant], optional; used to restrict regeneration of metadata to a given plant. If not given, then the metadata for all currently enabled plants is regenerated.
-
Site Alias Name, /a [name of site], optional; used in coordination with the Name option to specify a plant under a given site to regenerate metadata for.
Examples
-
start /wait Smart3DWebApiConfigurationUtility.exe /m
-
start /wait Smart3DWebApiConfigurationUtility.exe /m /n MyPlant
-
start /wait Smart3DWebApiConfigurationUtility.exe /m /n MyPlant /a MySite