Component - createComponent
Component - createComponent
Description :
This command creates a new component based on an existing component template and a specific server. This command returns a handle to the component. This handle can be used in any other command that needs a handle to a component.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
name | String | The name of the component. |
templateKey | DBKey | A handle to the template on which the component should be based. |
deviceId | Integer | A handle to the device/server where the template should be applied to create a new component. |
Example
The following example gets the handle of a template and the ID of a server, and uses them to create a new component based on the template and server:
Script
SERVER="Server_Name"
COMP_NAME="Comnponent_Name"
TEMPLATE_GROUP="/Template_Group"
TEMPLATE="Template_Name"
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`
SERVER_ID=`blcli Server getServerIdByName $SERVER`
COMPONENT_KEY=`blcli Component createComponent $COMP_NAME $TEMPLATE_KEY $SERVER_ID`
COMP_NAME="Comnponent_Name"
TEMPLATE_GROUP="/Template_Group"
TEMPLATE="Template_Name"
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`
SERVER_ID=`blcli Server getServerIdByName $SERVER`
COMPONENT_KEY=`blcli Component createComponent $COMP_NAME $TEMPLATE_KEY $SERVER_ID`
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*