Creating a Resource Template
You can create a resource template from the GUI or by using the CLI.
GUI
-
Navigate to a resource templates list. Choose a starting point.
Starting Point Procedure Shared Objects -
Click Shared Objects > Resource Templates.
-
Click New.
Hosts -
Click Infrastructure > Hosts > hostName > Resource Instances.
-
Click New.
You can use the Type and Scope to filter the list of resource templates.
-
In the New Resource Instances window click new resource template.
Nodes -
Click Infrastructure > Nodes > nodeName > Resource Instances.
-
Click New.
You can use the Type and Scope to filter the list of resource templates.
-
In the New Resource Instances window click new resource template.
Application -
Click Application > appName > Resource Templates.
-
Click Resource Template link.
-
Click New.
Resource template created from the Application tab has a scope to the application
Dashboard -
Select Dashboards > Welcome Page.
-
Click New Resource Template.
-
-
In the Add Resource Template dialog, select a resource type from the Type drop-down list.
The dialog redraws with type-specific fields.
Note: Ensure there is no resource template with the same name at the specified scope level. -
Use the slide bar to select a scope for the resource template.
- When the slide bar is above Global, the resource template is created at global level to share across environments and applications.
- When the slide bar is above Environment the resource template is created for a selected environment.
- When the slide bar is above Application, the resource template is created for a selected application.
Note: Select an environment to filter the list of applications in an environment.
-
Edit the template configuration fields.
The name of the resource template must not contain the colon (:) or ampersand (&) characters.
Note: Ensure there is no resource template with the same name at the specified scope level. -
Click Save.
CLI
You can either manually specify the scope of a resource template or import while creating an application.
-
Manual
In the data file, specify the type of the resource template in the xsi:type attribute. The resource templates can be nested under Enterprise, or Environment, or Application to create them in the corresponding scope:
<amxdata_base:Enterprise <ResourceTemplate xsi:type="amxdata:JdbcResourceTemplate" name="appJDBC1" ... </ResourceTemplate> <Environment xsi:type="amxdata:Environment" name="DevEnvironment" > ... <ResourceTemplate xsi:type="amxdata:JdbcResourceTemplate" name="appJDBC1" ... </ResourceTemplate> <Application xsi:type="amxdata:Application" name="nestedTestApp" resourceTemplatesScope="Application"> ... <ResourceTemplate xsi:type="amxdata:JdbcResourceTemplate" name="appJDBC1" ... </ResourceTemplate> </Application> </Environment> </amxdata_base:Enterprise>
In the AMXAdminTask element, set the action attribute to add and the objectSelector attribute to ResourceTemplate or Environment/ResoureceTemplate or Environment/Applicaiton/ ResoureceTemplate:
<AMXAdminTask action="add" objectSelector="ResourceTemplate|Environment/ResourceTemplate|
Environment/Application/ResourceTemplate"/>For more information, see Understanding AMXAdminTask
-
Import
When you create an application, it can import the resource templates from the DAA file.
- Set the attribute ImportResourceTemplateNames="true"to import all resource templates from the application template.
- To import select resource templates from the application template, specify each resource template separately in <ImportResourceTemplateName>
- You can specify a scope to the resource template in resourceTemplatesScope. If no scope is mentioned, default scope is global.
<Application xsi:type="amxdata:Application" name="app" importResourceTemplates="true" resourceTemplatesScope="Global/Environment/Application"> <ApplicationTemplate xsi:type="amxdata_reference:ApplicationTemplate_reference" name="appTemplate"/> <ImportResourceTemplateName>Httpclient_RT</ImportResourceTemplateNames> <ImportResourceTemplateName>JDBC_RT</ImportResourceTemplateNames> </Application>
In the AMXAdminTask element, set the action attribute to add and the objectSelector attribute to ResourceTemplate|Environment/ResourceTemplate|Environment/Application/ ResourceTemplate.