Use case: user wants to sync all their registered servers in ADStudio to ADServer. User also wants to be able to schedule this task on a recurring basis. After a sync, the set of registered servers in ADStudio should exactly match the set of registered servers in ADServer.
To accomplish the sync:
User will invoke sync via command line:
java -Djsse.enableCBCProtection=false -Xmx756M -XX:MaxPermSize=192m -cp $CLASSES com.aquafold.sdk.adserver.DeployProject <--deploy_url deploy url> <--username username> <--password password> <--includeAquaScripts: [0|1]> <--includeServers: [0|1]> <--includeUserFiles: [0|1]> <--project_path: fully qualified path to ADStudio Project Folder> <--deploy_or_sync: [deploy|sync]>
Take a look at DeployProject.java. It already has a main method but needs to be modified to accept the above parameters
DeployProjectDialog.java uses DeployProject to do the actual deployment. DeployProjecgtDialog is invoked when user right clicks inside project and chooses 'Deploy' option
The 'sync' functionality of first deleting all existing registered servers in ADServer does not currently exist. It needs to be added as part of this enhancement
CommandLineOptions.java is the command line argument parser implemented by fluid shell. Most of fluid shell commands use CommandLineOptions.java to parse their command line arguments.
There are a few classes that are derived from CommandLineOptions.java for handling some special cases. For example, '\echo -text' command should not treat '-text' as an option even it starts with a '-' character. In your case, we likely want to ignore JVM related options and only parse ADS specific options; if this is true, the option parser used by the \echo command could be the one you could use which is:
CommandLineOptionsAsDefined(String[] valueOptions, String[] pseudoOptions, boolean optionsBeforeArguments)
\echo command creates CommandLineOptionsAsDefined as
new CommandLineOptionsAsDefined(valueOptions, pseudoOptions, true);
(\echo command does not allow option and non-option arguments mixed together).
In your case, we probably should create CommandLineOptionsAsDefined as
new CommandLineOptionsAsDefined(valueOptions, pseudoOptions, false);
so that user is allowed to put ADS options anywhere s/he wants on the command line.
If none of existing parsers fit, we probably should derive a class from CommandLineOptions.java instead of modifying CommandLineOptions.java (if possible).
We have decided to go with a new FluidShell command called projectdeploy. Code changes have been checked in to ADS-13.0.0, ADS-14.0.0, and trunk. You need to have the correct versions of ADS and ADServer in order to use this new command.
- ADS v13: ADS 13.0.4-4 and ADServer 13.0.8
- ADS v14: ADS 14.0.1-2 and ADServer 14.0.0-1
NAME
projectdeploy - deploy a Aqua Data Studio project to Aqua Data Server
SYNOPSIS
projectdeploy --deploy-url <deploy-URL> --project-path <project-path> [OPTION...]
DESCRIPTION
Deploy a Aqua Data Studio project to Aqua Data Server. You can specify whether to import AquaScripts, Servers, and/or User Files. If the -s or --sync option is used, existing AquaScripts, Servers, and/or User Files in Aqua Data Server will be cleaned up before importing the AquaScripts, Servers, and/or User Files from Aqua Data Studio to Aqua Data Server.
OPTIONS
If both short form and long form are specified on the command line, the long form will take precedence.
-url, --deploy-url URL
The URL to deploy to the Aqua Data Server project, example: http://HOSTNAME:PORT/app/home/project/<PROJECT_DESCRIPTOR>/deploy
-u, --username USERNAME
Username of the Aqua Data Server account
-p, --password PASSWORD
Password of the Aqua Data Server account
-pw, --prompt-password
Prompt for the password of the Aqua Data Server account instead of specifying it using the -p or --password option.
-ia, --includeAquaScripts BOOLEAN
Include or exclude AquaScripts, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-is, --includeServers BOOLEAN
Include or exclude Servers, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-iu, --includeUserFiles BOOLEAN
Include or exclude User Files, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-path, --project-path PATH
Fully qualified path of the Aqua Data Studio project folder.
-ac, --accept-certificate BOOLEAN
For a SSL connection to the Aqua Data Server, if the site's certificate has not been accepted yet, this flag indicates whether to accept the certificate, default to 'false'.
-s, --sync
If this option is specified, existing AquaScripts, Servers, and/or User Files in Aqua Data Server will be cleaned up before deploying the project.
BOOLEAN VALUES
The followings are supported BOOLEAN values: 'true', 'false', 'yes', 'no', 'y', 'n', 'on', 'off', '1', '0'.
NOTES
The deploy URL can be obtained by logging in to Aqua Data Server, drilling into the project that you want to deploy to and then going to Settings -> Import Project Package.
The Aqua Data Server account must be a member of the project and have the appropriate permissions to deploy the project. The member must have the 'Import and Deploy Project' permission and appropriate create/edit permissions for AquaScripts, Servers, and/or User Files. If the -s or --sync option is specified, the member must also have delete permissions.
Password in the Servers is not imported.
We have decided to go with a new FluidShell command called projectdeploy. Code changes have been checked in to ADS-13.0.0, ADS-14.0.0, and trunk. You need to have the correct versions of ADS and ADServer in order to use this new command.
- ADS v13: ADS 13.0.4-4 and ADServer 13.0.8
- ADS v14: ADS 14.0.1-2 and ADServer 14.0.0-1
NAME
projectdeploy - deploy a Aqua Data Studio project to Aqua Data Server
SYNOPSIS
projectdeploy --deploy-url <deploy-URL> --project-path <project-path> [OPTION...]
DESCRIPTION
Deploy a Aqua Data Studio project to Aqua Data Server. You can specify whether to import AquaScripts, Servers, and/or User Files. If the -s or --sync option is used, existing AquaScripts, Servers, and/or User Files in Aqua Data Server will be cleaned up before importing the AquaScripts, Servers, and/or User Files from Aqua Data Studio to Aqua Data Server.
OPTIONS
If both short form and long form are specified on the command line, the long form will take precedence.
-url, --deploy-url URL
The URL to deploy to the Aqua Data Server project, example: http://HOSTNAME:PORT/app/home/project/<PROJECT_DESCRIPTOR>/deploy
-u, --username USERNAME
Username of the Aqua Data Server account
-p, --password PASSWORD
Password of the Aqua Data Server account
-pw, --prompt-password
Prompt for the password of the Aqua Data Server account instead of specifying it using the -p or --password option.
-ia, --includeAquaScripts BOOLEAN
Include or exclude AquaScripts, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-is, --includeServers BOOLEAN
Include or exclude Servers, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-iu, --includeUserFiles BOOLEAN
Include or exclude User Files, default to 'true'. See BOOLEAN VALUES section below for supported BOOLEAN values.
-path, --project-path PATH
Fully qualified path of the Aqua Data Studio project folder.
-ac, --accept-certificate BOOLEAN
For a SSL connection to the Aqua Data Server, if the site's certificate has not been accepted yet, this flag indicates whether to accept the certificate, default to 'false'.
-s, --sync
If this option is specified, existing AquaScripts, Servers, and/or User Files in Aqua Data Server will be cleaned up before deploying the project.
BOOLEAN VALUES
The followings are supported BOOLEAN values: 'true', 'false', 'yes', 'no', 'y', 'n', 'on', 'off', '1', '0'.
NOTES
The deploy URL can be obtained by logging in to Aqua Data Server, drilling into the project that you want to deploy to and then going to Settings -> Import Project Package.
The Aqua Data Server account must be a member of the project and have the appropriate permissions to deploy the project. The member must have the 'Import and Deploy Project' permission and appropriate create/edit permissions for AquaScripts, Servers, and/or User Files. If the -s or --sync option is specified, the member must also have delete permissions.
Password in the Servers is not imported.
I was curious what subsection on this page
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/wikibook/Documentation14/page/Shell-Commands/Shell-Commands
it should be listed under... utilities?
I have the page created here:
I was curious what subsection on this page
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/wikibook/Documentation14/page/Shell-Commands/Shell-Commands
it should be listed under... utilities?
I have the page created here:
Yes, I think it should be listed under "utilities".
Yes, I think it should be listed under "utilities".
I've added it to the Utilities section
refresh
I've added it to the Utilities section
refresh
Didn't realize this was for v13 too..
Added to v13 Utilities section here:
new page in v13 docs here:
Didn't realize this was for v13 too..
Added to v13 Utilities section here:
new page in v13 docs here:
Issue #10272 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 13.0.4-4, ADServer 13.0.8 |
No time estimate |
CommandLineOptions.java is the command line argument parser implemented by fluid shell. Most of fluid shell commands use CommandLineOptions.java to parse their command line arguments.
There are a few classes that are derived from CommandLineOptions.java for handling some special cases. For example, '\echo -text' command should not treat '-text' as an option even it starts with a '-' character. In your case, we likely want to ignore JVM related options and only parse ADS specific options; if this is true, the option parser used by the \echo command could be the one you could use which is:
CommandLineOptionsAsDefined(String[] valueOptions, String[] pseudoOptions, boolean optionsBeforeArguments)
\echo command creates CommandLineOptionsAsDefined as
new CommandLineOptionsAsDefined(valueOptions, pseudoOptions, true);
(\echo command does not allow option and non-option arguments mixed together).
In your case, we probably should create CommandLineOptionsAsDefined as
new CommandLineOptionsAsDefined(valueOptions, pseudoOptions, false);
so that user is allowed to put ADS options anywhere s/he wants on the command line.
If none of existing parsers fit, we probably should derive a class from CommandLineOptions.java instead of modifying CommandLineOptions.java (if possible).