BlPackage - addAssetActionToEnd

BlPackage - addAssetActionToEnd

Description :

This command adds an asset action to the end of a BLPackage. The command will always use the latest version of an asset class.

To obtain asset details (which you need as input for the current command), you can perform the following actions:

  • Run BLCLI commands from the ConfigurationObjectClass namespace (as described in the example provided for the Template - createConfigurationObjectTemplate command):
    1. Use ConfigurationObjectClass - listAllRootClasses to list all root classes.
    2. Choose one of the root classes and then use ConfigurationObjectClass - listChildClasses to list its child classes.
      For example, you might choose the BMC_UnixUsers root class.
    3. Identify the relevant child class. The name of the child class will be the value of the className argument.
      For example, the child class of BMC_UnixUsers is BMC_UnixUser.
    4. Use ConfigurationObjectClass - describeAssetClass to display information about the child class attributes and actions (including the parameters for each action).
      This gives you the values for the assetAction and actionParameters arguments.
      For example, for the BMC_UnixUser class, you can choose the updatePassword action. This action calls for the newPassword parameter. Note that a newPassword value must be encrypted, and you can use the blenc encryption utility to encrypt it.
  • Use the Live Browse feature in the BMC Server Automation Console to view the asset and its properties.
    For example, when browsing a Unix server, the Unix Users branch lists the various user accounts. Among the various properties of any user account, you can find the Path property — the value for the objectPath argument.

For single-user settings, you can set the singleUserMode argument to one of the following strings:

  • NotRequired: Not Required
  • RevertTo: Use single-user mode without reboot
  • RebootAs: Reboot into single-user mode

For reboot settings, you can set the rebootMode argument to one of the following strings:

  • NotRequired: Not required
  • AfterDeploy: After item deployment
  • AfterDeployWithReconfiguration: After item deployment with reconfiguration (Solaris ONLY)
  • OutOfBand: Out-of-band
  • AtJobEnd: By end of job
  • AtJobEndWithReconfigration: By end of job with reconfiguration (Solaris ONLY)

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

pkgDBKey

DBKey

Handle to the BLPackage.

className

String

Name of the custom object class.

objectPath

String

The path to the custom object that the action will be performed on.

actFailure

String

Action on failure for the asset action (Ignore, Continue, or Abort).

singleUserMode

String

The single-user mode.

rebootMode

String

The reboot mode.

assetAction

String

Name of the asset action to be performed.

actionParameters

String

The comma-separated list of parameters name=value for the asset action. If the parameter is for a specific applicability, then before the = you should list the applicability within parentheses. If the value is a list it must be a comma separated string within quotes.

Example

The following example adds an asset action to the end of the package. The asset class is BMC_UnixUser version 1. The change will affect the test-user user account. The action is an update of the user account's password.

Script

# Depot folder in which the BLPackage is stored. 

PACKAGE_GROUP="/parent/group1" 

# Name of the BLPackage. 

PACKAGE_NAME="blpgk1" 

SINGLE_USER_MODE=NotRequired 

REBOOT_MODE=NotRequired 

PACKAGE_DBKEY=`blcli BlPackage getDBKeyByGroupAndName $PACKAGE_GROUP $PACKAGE_NAME` 

blcli BlPackage addAssetActionToEnd $PACKAGE_DBKEY BMC_UnixUser /test-user "Abort" "$SINGLE_USER_MODE" "$REBOOT_MODE" updatePassword "newPassword=foo" 

Was this page helpful? Yes No Submitting... Thank you

Comments