WAS v8.5 > Reference > Commands (wsadmin scripting)ResourceManagement command group for AdminTask
We can use the Jython or Jacl scripting languages to configure resource providers with wsadmin. The commands and parameters in the ResourceManagement group can be used to define and display properties for resource providers.
The ResourceManagement command group for AdminTask includes the following commands:
setResourceProperty
Use the setResourceProperty command to set the value of a specified property defined on a resource provider such as JDBCProvider or a connection factory such as DataSource or JMSConnectionFactory. If the property with specified key is defined already, then this command overrides the value. If no property with a specified key is defined, this command will add the property with specified key and value.
Target object The configuration object ID of a resource provider or a connection factory.
Required parameters
- -propertyName
- Name of the property. (String, required)
- -propertyValue
- Value of a property. (String, required)
Optional parameters
- -propertyType
- Type of the property. Default is java.lang.String. (String, optional)
- -propertyDescription
- Description of the defined property. (String, optional)
Sample output The command does not return output.
Examples
Batch mode example usage:
- Jacl:
$AdminTask setResourceProperty {-propertyName test.property -propertyValue testValue}
- Jython string:
AdminTask.setResourceProperty('[-propertyName test.property -propertyValue testValue]')
- Jython list:
AdminTask.setResourceProperty(['-propertyName', 'test.property', '-propertyValue', 'testValue'])
Interactive mode example usage:
- Jacl:
$AdminTask setResourceProperty {-interactive}
- Using Jython:
AdminTask.setResourceProperty('-interactive')
showResourceProperties
Use the showResourceProperties command to list all of the property values that are defined on a resource provider such as JDBC provider or a connection factory such as data source or JMS connection factory.
Target object The configuration object ID of a resource provider or a connection factory.
Required parameters None.
Optional parameters
- -propertyName
- Name of the property. If we specify the property name, the value of the specified property name is returned. If we do not specify the property name, all property values will be listed. Each element in the list is a property name value pair. (String, optional)
Sample output The command returns the property values that are defined on the resource provider or the connection factory that you specified.
Examples
:
- Jacl:
$AdminTask showResourceProperties {-propertyName test.property}
- Jython string:
print AdminTask.showResourceProperties('[-propertyName test.property]')
- Jython list:
print AdminTask.showResourceProperties(['-propertyName', 'test.property'])
Interactive mode example usage:
- Jacl:
$AdminTask showResourceProperties {-interactive}
- Using Jython:
print AdminTask.showResourceProperties('-interactive')
Related
Use the wsadmin scripting AdminTask object for scripted administration
Reference:
Commands for AdminTask using wsadmin.sh