Installer 10.5 | Complete Installation and Upgrade Information for Software AG Products | Command Central | Using the Command Line Interface | Template Commands | sagcc exec templates composite generate
 
sagcc exec templates composite generate
Based on the input arguments that you include, the command can:
*Generate a run-time micro template from an installed product instance.
*Export the database for the products in an installation to a database micro template.
Command Central imports the generated template automatically and creates a layer type definition for the template in the local Command Central installation. You can use this layer type definition to create a layer for the product instance in an existing product stack. See the sagcc create stacks layers command.
After you run the command, you can monitor the progress of the template generation job from the Jobs view in the Command Central web user interface.
Syntax
*Command Central syntax:
*Export an installed product instance to a run-time micro template
sagcc exec templates composite generate alias=templateAlias nodeAlias=nodeAlias
runtimeComponentId=runtimeComponentId [parameterize={true | false}]
[paramPrefix=paramPrefix] [options=CONFIGURATION] [options=INSTANCES] [options=PRODUCTS]
[options=FIXES] [overwrite={true | false}] [createLayerType={true | false}]
*Export the database for the products in an installation to a database micro template
sagcc exec templates composite generate alias=templateAlias nodeAlias=nodeAlias
options=DATABASE db.url=JDBC_URL db.username=username
db.password=password db.type=type [overwrite={true|false}]
[dbUseComponentsLatestVersion={true|false}] [createLayerType={true|false}]
-s local_CCE_URL
*Not supported on Platform Manager.
Arguments and Options for Exporting an Instance to a Run-time Template
Argument or Option
Description
alias=templateAlias
Required. The alias name of the run-time micro template to generate.
nodeAlias=nodeAlias
Required. The alias name of the installation on which the product instance is installed.
runtimeComponentId=runtimeComponentId
Required. The ID of the product instance for which to generate the template.
[parameterize={true|false}]
Optional. Specifies whether to parameterize the exported configurations. Currently, this feature is experimental. Valid values:
*true - parameterize the configurations
*false - (default) do not parameterize the configurations
[paramPrefix]
Optional. Use only when parameterize=true. Specifies a prefix to be added to the exported parameter names.
[options=CONFIGURATION]
[options=INSTANCES]
[options=PRODUCTS]
[options=FIXES]
Optional. Include one or more of the options arguments to specify what information about the product instance you want to include in the templates: section of the generated template:
*CONFIGURATION - Includes the configuration for the product instance (and its child run-time components)
*INSTANCES - Includes the instance properties
*PRODUCTS - Experimental. Includes a list of product inline templates in the templates:templateAlias:products: section. The command determines which products get included in the list based on the version of the source installation.
*FIXES - Includes a templates:templateAlias:fixes: section. Only with DSL "1.1", if the source product instance has been updated with patches, this option also includes a templates:templateAlias:patches: section. Based on the version of the source installation, the generated template will differ as described in the options=FIXES usage note.
For details about the options arguments, see the Usage Notes.
[overwrite={true|false}]
Required when you execute the command to update a template. Specifies whether to overwrite an existing template with the same alias name. Valid values:
*true - overwrite the template
*false (default) - do not overwrite the template
[createLayerType={true|false}]
Optional. Specifies whether to create a new layer type definition that references the generated template. The alias of the new layer type definition uses the alias of the generated template, for example if the template alias is my-template, the layer definition alias is MY-TEMPLATE.
*true (default) - create a new layer definition
*false - do not create a new layer definition
Arguments and Options for Exporting a Database to a Database Template
Argument or Option
Description
alias=templateAlias
Required. The alias name of the database micro template to generate.
nodeAlias=nodeAlias
Required. The alias name of the installation, from which to export the database.
options=DATABASE
Required. Exports the database for the products in the installation to a database template. For more details about how to use the generated database template, see Managing Database Components Using a Template.
db.url=JDBC_URL
Required. The JDBC URL to use to connect to the database.
db.username=username
Required. The name of a user account that has access to the database.
db.password=password
Required. The password of the user account you specified in db.username.
db.type=type
Required. The type of the database to which you want to connect, such as oracle, sqlserver, or mysql. For a list of supported database types, see System Requirements for Software AG Products.
[overwrite={true|false}]
Required when you execute the command to update a template. Specifies whether to overwrite an existing template with the same alias name. Valid values:
*true - overwrite the template
*false (default) - do not overwrite the template
[dbUseComponentsLatestVersion={true|false}]
Optional. Indicates whether to export the database components and schemas with the latest version. Valid values:
*true (default) - export the database components and schemas with the latest version
*false - export the database components and schemas with the release version of the source installation
[createLayerType={true|false}]
Optional. Specifies whether to create a new layer type definition that references the generated template. The alias of the new layer type definition uses the alias of the generated template, for example if the template alias is my-template, the layer definition alias is MY-TEMPLATE.
*true (default) - create a new layer definition
*false - do not create a new layer definition
-s
Specify the URL of the local Command Central. For details about this option see server.
Usage Notes for Exporting an Instance to a Run-time Template
*If none of the options arguments is included, the generated template includes all the information about the product instance: instance properties, fixes, configurations, and inline templates for the products hosted on the instance and their configurations.
*When using options=CONFIGURATION, the command exports all configurations for the specified product instance, including the configurations for its child run-time components, if any. To select and extract only specific configurations, use the sagcc exec templates composite generate input command.
*When using options=PRODUCTS and options=INSTANCES, the generated template includes the following template snippet:
environments:
default:
repo.product: ${} # Parameter for the product repository from
# which to install products
layers:
product-template-layer:
templates: product-instance-template
productRepo: ${repo.product} # Placeholder parameter for the product repository
templates:
product-instance-template:
products:
product1:
product2:
product3:
instanceProperty1: instancePropertyValue1
instanceProperty2: instancePropertyValue2
*When using options=FIXES, the generated template depends on the version of the source installation.
If the source installation is version 10.5 and higher, the command generates a template with fixes and patches parameters that list the fixes installed on the source installation. When applying the template snippet from the following example, Command Central will install the same fixes (and patches) as the ones installed on the source installation:
dslVersion: "1.1" # Added only when exporting a list of patches.
environments:
default:
fixes: [fix1, fix2, fix3]
patches: [patch1, patch2] # Supported only in DSL "1.1" and higher.
repo.fix: ${} # Parameter for the fix repository from
# which to install fixes.
layers:
product-template-layer:
templates: product-instance-template
fixRepo: ${repo.fix} # Placeholder parameter for the fix repository.
provision:
default:
product-template-layer: ${nodes}
templates:
product-instance-template:
fixes: ${fixes} # А fixes section in the inline template of
# the product instance that refers to the
# "fixes" parameter.
patches: ${patches} # А patches section in the inline template
# of the product instance that refers to the
# "patches" parameter.
If the source installation is version 10.4 and lower, the command generates a template with the fixes: ALL parameter. When applying the template snippet from the following example, Command Central will install all fixes available for the product instance in the fix repository:
environments: 
default:   
prefix.fixes: ALL # Parameter that indicates to install all fixes
# for the product instance.
    repo.fix: ${} # Parameter for the fix repository from which
# to install fixes.
layers:
product-template-layer:   
templates: product-instance-template   
fixRepo: ${repo.fix} # Placeholder parameter for the fix repository.
provision:  
default:   
product-template-layer: ${nodes}
templates: 
product-instance-template:   
fixes: ${prefix.fixes} # А fixes section in the inline template of the product
# instance that refers to the "prefix.fixes" parameter.
*Command Central always extracts license keys and paths to file locations, which cannot be resolved from the Software AG installation directory, as parameters with required values, for example:
environments:
default: 
instance.license.key: ${}
instance.data.dir: ${}
You must provide the required values for such parameters when creating a layer using the layer definition of the generated template. If you apply the generated template with the apply composite templates command, specify the values in a properties file or as parameters in the apply composite templates command.
*All exported passwords are encrypted. For details about encrypting passwords, see Encrypting Passwords in Templates.
*When using options=PRODUCTS, the list of product inline templates in the generated template depends on the version of the source installation:
*For installations version 10.4 or higher, the command adds inline templates only for the products hosted on the product instance.
*For installations version 10.3 or lower, the command adds inline templates for all products from the source installation (not only the products hosted on the product instance).
*The command allows all common options supported by the Command Line Interface. For a description of the options, see Common Options.
*When generating the run-time micro template, Command Central does not extract files that the product instance uses.
Usage Note for Exporting a Database to a Database Template
Note that the generated database template does not include the database storage component. Before you apply the database template in an installation or use it to create a database layer in a product stack, you must ensure that the database storage component for the database is already created.
Examples of Exporting an Instance to a Run-time Micro Template
To extract all configurations for the "OSGI-IS_default" run-time component, installed in the "local" installation, to a template with alias "is-config" and use the "is" prefix for the parameters in the generated template. If a template with the specified alias exists, the generated template will overwrite it.
sagcc exec templates composite generate alias=is-config nodeAlias=local parameterize=true
paramPrefix=is options=CONFIGURATION runtimeComponentId=OSGI-IS_default overwrite=true
To extract all instance properties and configurations for the "OSGI-IS_default" product instance, installed in the "local" installation, to a template with alias "is-config".
sagcc exec templates composite generate alias=is-config nodeAlias=local options=INSTANCES
options=CONFIGURATION runtimeComponentId=OSGI-IS_default
To generate a template with all the information about the "OSGI-IS_default" product instance, installed in the "local" installation, to a template with alias "is-config".
sagcc exec templates composite generate alias=is-config nodeAlias=local
runtimeComponentId=OSGI-IS_default
Example of Exporting a Database to a Database Template
To export the database components and schemas for the products in the installation with alias "sag1" to a database template with alias "db-template1", using the database connection details for the database with name "myDatabase" and type "sqlserver":
sagcc exec templates composite generate alias=db-template1 nodeAlias=sag1 options=DATABASE
db.url="jdbc:wm:Sqlserver://rubicon:1433;databaseName=myDatabase"
db.username=myDbUser db.password=myDbUser_password db.type=sqlserver overwrite=true
dbUseComponentsLatestVersion=false -s http://localhost:8090
The generated database template is automatically imported into the local Command Central installation and will overwrite any imported template with the same template alias. The database components and schemas will get exported with the version of the source installation.