Changing the Scope of a Resource Template

You can change the scope of a resource template using the Administration GUI. For more information, see Resource Template With Scope.

The scope of a resource template can be changed even if:
  • a resource instances exists.
  • there is a hidden dependency such as inline credentials.
  • resource instances on nodes are not related to the target scope.
For more information, see Resource Template With Scope.

Procedure

  1. Select Shared Objects > Resource Templates.
    You can use the Type and Scope to filter the list of resource templates.
  2. Select a resource template from the list.
  3. Click the Change Scope.
    Change Scope from Resource Templates window displays.
  4. Select Global, Environment, or Application.
    • For a resource template with Global scope, you can change the scope to Environment or Application.
    • For a resource template with Environment scope, you can change the scope to Global or Application.
    • For a resource template with Application scope, you can change the scope to Global or Environment.


    Based on the selection, options are displayed in the Available window.
  5. Select and use the arrow to move your selection to the Selected window.
  6. Click Save.

CLI

You can change the scope of a resource template using the command-line utility. You can specify multiple TargetScope elements for a resource template.

Procedure


    • If changing scope from global to environment, specify environment.
      <TargetScope xsi:type="amxdata_base:Scope" type="Environment" envName="ENVIRONMENT_NAME"/>
    • If changing scope from global to application, specify both environment and application.
      <TargetScope xsi:type="amxdata_base:Scope" type="Application" envName="ENVIRONMENT_NAME" 
      appName="APPLICATION_NAME"/>
    • If changing scope from environment or application to global, specify global.
      <TargetScope xsi:type="amxdata_base:Scope" type="global"/>
    The following example shows, the jdbc_rt resource template's scope is changed from environment to application App1:
    <Environment xsi:type="amxdata:Environment" name="DevEnvironment" >
    		<ResourceTemplate
                xsi:type="amxdata:JdbcResourceTemplate"
                name="jdbc_rt"
                description="Environment jdbc"
                maxConnections="8888">
        
                <TargetScope xsi:type="amxdata_base:Scope" type="Application" envName="DevEnvironment" appName="App1"/>    
        
                <Direct
                    xsi:type="amxdata:Direct"
                    dbUrl="jdbc:hsqldb:hsql://localhost:1234/jdbcRtDb"
                    jdbcDriver="org.hsqldb.jdbcDriver"
                    isTransactional="false"
                    loginTimeOut="2"/>
        
                <InlineCredentials username="envJdbc" password="envJdbc"/>
                
            </ResourceTemplate>
                
        </Environment>
    
  1. In the AMXAdminTask element, set the action attribute to changeScope and the objectSelector attribute to ResourceTemplate|Environment/ResourceTemplate|Environment/Application/ResourceTemplate.
    <AMXAdminTask action="rename" 
    objectSelector="ResourceTemplate|Environment/ResourceTemplate|Environment/ Application/ResourceTemplate"/>