1 of 1 people found this helpful
Does the role you are running this as have permissions to modify the group object?
What if you try:
Blcli_execute ServerGroup groupNameToId $group
Blcli_execute Group findById $groupId
blcli_execute Group setDescription “Description”
Blcli_execute Group update
I get the same error on the setDescription command. Here is the ouptut:
appserver% blcli_execute ServerGroup groupNameToId "/List"
2117152appserver% blcli_storeenv GROUPID
appserver% blcli_execute Group findById $GROUPID
appserver% blcli_execute Group setDescription "New Description"
Command execution failed. java.lang.UnsupportedOperationException: immutable
appserver% blcli_execute Group update
I am authenticating as BLAdmins and verified that BLAdmins has the correct permission on the group object. I can change the description manually in the console via the Properties View.
However, I think I figured out my issue. My target object was a SmartServerGroup, not a ServerGroup. Not sure how I missed that earlier. I blame it on being the end of a long week!
I appreciate the help Bill.
it shouldn't matter if it's a smart group, it's still a group - and there is a 'SmartGroup.setDescription' command that fails as well.
That's interesting... I retested and this is what I found:
Against a Smart Server Group:
ServerGroup.setDescription - fails with immutable error
SmartGroup.setDescription - succeeds
SmartServerGroup.setDescription - succeeds
Against a (static) Server Group:
ServerGroup.setDescription - succeeds
SmartGroup.setDescription - fails, exception indicates failure because argument wrong type
SmartServerGroup.setDescription - fails, exception indicates failure because argument wrong type
Based on what you said, it sounds like there is a bug in the ServerGroup.setDescription command. Does that sound right? Also, my testing seems to have opposite results for the SmartGroup.setDescription command, as it is working properly for me against Smart Server Groups.
I could see where one might want the ServerGroup.setDescription to work against both smart and static server groups. I see it as a very likely scenario where a mix of smart and static groups, and it would make it far easier to script if there was a common command to edit descriptions on both types.
For what I was working on, the fact that ServerSmartGroup.setDescription works is sufficient.
interesting.. the 'SmartGroup/SmartServerGroup.setDescription' are doing something different than I would have done. this is the command sequence they are running:
Group.findById $groupId$ group SmartGroup.createSmartGroupBean NAMED_OBJECT=group groupbean SmartGroupBean.setDescription $desc$ - SmartGroup.createSmartGroup NAMED_OBJECT=groupbean nGroup SmartGroup.save NAMED_OBJECT=nGroup - SmartGroup.getGroupId no input -