StaticServerGroup - addServerToServerGroup
StaticServerGroup - addServerToServerGroup
Description :
This command adds a server (identified by ID) to a server group (also identified by ID).
Return type : com.bladelogic.om.infra.model.group.Group
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
groupId | Integer | ID of the server group to which the server is to be added. |
serverId | Integer | ID of the server to be added. |
Example
This example shows how to add a server to a group using IDs for the server and the server group:
Script
# Get the ID of the server by server name
SERVER1_NAME="server1"
SERVER1_ID=`blcli Server [getServerIdByName|Server - getServerIdByName] $SERVER1_NAME`
# Get the ID of the server group by server group name
SERVER_GROUP1="/parent/group1"
SERVER_GROUP1_ID=`blcli ServerGroup [groupNameToId|ServerGroup - groupNameToId] $SERVER_GROUP1`
# Now add the server to the server group
RESULT=`blcli StaticServerGroup addServerToServerGroup $SERVER_GROUP1_ID $SERVER1_ID`
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*