Database Reference
In-Depth Information
The functionality of updateProps() can be as simple or as complex as the situation requires. The examples below
show additional methods of using updateProps() . The functionality of each example is explained using comments.
Including the comments with the commands allows them to be copied with the commands into a script:
# Set multiple properties to be applied.
myinst.props({'LifeCycle Status':'Development', 'Location':'COLO', 'Comment':'Test EM'})
# Show the currently defined properties to be applied.
print(myinst.propdict)
# Include only host or agent targets that start with em12cr3.example.com.
myinst.filt(namefilter='^em12cr3\.example\.com', typefilter='^host|oracle_emd$')
# Include only agent targets.
myinst.filt(typefilter='^oracle_emd$')
# Include only targets managed by the em12cr3.example.com:3872 agent.
myinst.filt(agentfilter='^em12cr3\.example\.com:3872$')
# Include only host targets that start with EM, end with Service
# and have a single word between EM and Service.
myinst.filt(namefilter='^EM\s+\S+\s+Service$')
# Create an instance of the class, define the properties
# to be applied and specify the target list filters in a single command.
myinst = updateProps.updateProps(namefilter='^orcl', typefilter='oracle_dbsys',
agentfilter='em12cr3\.example\.com:3872', propdict={'LifeCycle Status':'Development'})
# Clear all filters which resets the instance to include all targets.
myinst.filt()
# Show the currently defined target list and each target's currently
# defined properties for the myinst instance.
myinst.show()
# Update the currently defined target list to the currently defined
# properties without reprinting the target and target properties list.
myinst.setprops()
# Apply a property update using the class without creating an instance.
updateProps.updateProps(
namefilter='^orcl',
typefilter='oracle_dbsys',
agentfilter='em12cr3\.example\.com:3872',
propdict={
'LifeCycle Status':'Production',
'Location':'DC1'}
).setprops(True)
Search WWH ::




Custom Search