Command Central Developer Reference : Using the Command Line Interface : Template Commands : sagcc exec templates snapshot apply
sagcc exec templates snapshot apply
DEPRECATED. Use composite templates to provision installations.
Applies a template registered and available under the specified alias in a managed installation.
Syntax
*Command Central syntax:
*With parameters:
sagcc exec templates snapshot apply alias=template_alias                        
nodeAlias=node_alias          
options=[PRODUCTS,CONFIGURATION,FIXES,FILES,INSTANCES]             
[sharedsecret=text_string]                       
fixesRepo=fixes_repo productsRepo=products_repo                        
replaceConfiguration=true | false   [command options]
*With input file:
sagcc exec templates snapshot apply                         
{--input | i} filename{.xml | .json} [command options]
*Platform Manager syntax:
*With parameters:
sagcc exec templates apply alias=template_alias                        
 options=[PRODUCTS,CONFIGURATION,FIXES,FILES,INSTANCES]          
[sharedsecret=text_string]                    
fixesRepo=fixes_repo productsRepo=products_repo                        
replaceConfiguration=true | false   [command options]
*With input file:
sagcc exec templates apply                         
{--input | i} filename{.xml | .json} [command options]
Arguments and Options
Argument or Option
Description
alias=template_alias
Required. The alias for the template to apply. You can determine the template alias using the sagcc list templates command.
nodeAlias=node_alias
Required. Only for Command Central. The alias of the Platform Manager on which you want to apply the template.

options= [PRODUCTS,CONFIGURATION, FIXES,FILES,INSTANCES]
Required. The type of content to apply from the template. If you want to apply more than one type of content from the template, you must repeat this parameter for each content type that you want to apply.
[sharedsecret=text_string]
Optional. A shared secret that serves as password for decrypting passwords included in a template with configuration.
If you do not specify a shared secret for a template, Platform Manager uses the shared secret specified for the environment to which the target installation belongs.
fixesRepo=fixes_repo
Required when you include the options=FIXES parameter. The ID of the fix repository from which to install fixes.

productsRepo=

products_repo

Required when you include the options=PRODUCTS parameter. The ID of the product repository from which to install products.

replaceConfiguration=
true | false
Required. Whether to replace the configuration on the target node with the configuration from the template. When you set this parameter to true, any existing configurations on the target node that are not part of the applied template get deleted.
*true - replace configuration
*false (default) - do not replace configuration

{--input | -i}
filename{.xml | .json}

Required. An input file that contains the template metadata required for applying the template. For more information, see input.
[command options]
Optional. The command allows all options supported by the Command Line Interface. For a description of the options, see Common Options.
Usage Notes
*The template XML metadata required for the template application should follow the format below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>                                
<templateMetadata>                                
                                     
    <!-- template to create / apply -->                                
    <alias>templateAlias</alias>                                
                                     
    <!-- node alias to create from / apply to -->                                
    <nodeAlias>nodeAlias</nodeAlias>                                
                                 
    <!-- overwrite template, if exists -->                                
    <overwriteTemplate>true</overwriteTemplate>                                
                                     
    <!-- capture / install products -->                                
    <productOption>                                
        <!-- registered product repository Id: See below -->                                
        <repositoryId>productRepositoryId</repositoryId>                                
        <type>PRODUCTS</type>                                
        <!-- install the latest version available in the above                                
             repository -->                                
        <useLatestVersion>false</useLatestVersion>                                
    </productOption>                                
                                     
    <!-- capture / install fixes -->                                
    <fixesOption>                                
        <!-- registered fix repository id: See below -->                                
        <repositoryId>fixRepositoryId</repositoryId>                                
        <!-- install the latest version available in the above                                
             repository -->                                
        <useLatestVersion>true</useLatestVersion>                                
        <type>FIXES</type>                                
    </fixesOption>                                
                                     
    <!-- capture / copy files referenced from configurations -->                                
    <filesOption>                                
        <type>FILES</type>                                
    </filesOption>                                
                                      
    <!-- capture / apply configuration -->                                
    <configurationOption>                                
        <type>CONFIGURATION</type>                                
    <replaceConfiguration>false</replaceConfiguration>                                
</configurationOption>                                
                                  
</templateMetadata>
If replaceConfiguration is set to true, the apply template command replaces the existing configuration on the system on which the template is applied with the configuration included in the template. All configurations on the target system that are not part of the applied template will be removed.
*The apply template command returns the following result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>                                
  <landscapeTemplateOperationResultDTO                                
        xmlns:ns2="http://www.w3.org/2005/Atom">                                
  <jobId>5</jobId>                                
  <ns2:link rel="job" href="http://localhost:8090/cce/jobmanager/jobs/5"/>                                
  <ns2:link rel="log" href="http://localhost:8090/cce/diagnostics/logs/                                
n1/OSGI-SPM/templates.log/full?search=CREATE1380025427852"/>                                
    <logName>CREATE1380025427852</logName>                                
    <nodeAlias>n1</nodeAlias>                                
    </landscapeTemplateOperationResultDTO>
*To monitor the status of the job scheduled to apply the template, specify the job ID returned by the apply templates command in the sagcc list jobmanager jobs command. The apply templates command also provides a reference to the template log that you can use to check the logs, using the sagcc get diagnostics logs command.
*To apply a template that includes products or fixes, register and configure at least one product and fix repository on the target installation. For information about how to register a repository, see the section about repository commands in this help.
Note:  
Platform Manager templates are imported from Command Central as part of the apply template command. When you execute the apply template command on Platform Manager, make sure that the template already exists on this Platform Manager.
Example When Executing on Command Central
*To apply a template, based on the “templateMetadata.xml” file, on the Command Central server with host name “rubicon” and port “8090”:
sagcc exec templates snapshot apply --server http://rubicon:8090/cce                
-p mypassword -i  D:\templateMetadata.xml
*To apply the products and configuration from the template with name “myTemplate” on the Platform Manager node with alias “empty-spm”. Command Central installs the products from the “SAG-SDC” repository and applies the configuration from the template using the default shared secret for the environment.
sagcc exec templates snapshot apply alias=myTemplate nodeAlias=empty-spm                  
options=PRODUCTS options=CONFIGURATION                     
productsRepo=SAG-SDC
*To apply the products and configuration from the template with name “mySecureTemplate” on the Platform Manager node with alias “empty-spm”. Command Central installs the products from the “SAG-SDC” repository and applies the configuration from the template, using the shared secret for the template, “mysecret123”.
sagcc exec templates snapshot apply alias=myTemplate nodeAlias=empty-spm                  
options=PRODUCTS options=CONFIGURATION sharedsecret=mysecret123                    
productsRepo=SAG-SDC
Example When Executing on Platform Manager
To apply a template, based on the “templateMetadata.xml” file, on the Platform Manager server with host name “rubicon” and port “8092”:
sagcc exec templates apply --server http://rubicon:8092/spm -p mypassword                
-i  D:\templateMetadata.xml
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback