

def create_datasource(jboss_config, name, datasource_properties, profile=None):
    '\n    Create datasource in running jboss instance\n\n    jboss_config\n        Configuration dictionary with properties specified above.\n    name\n        Datasource name\n    datasource_properties\n        A dictionary of datasource properties to be created:\n          - driver-name: mysql\n          - connection-url: \'jdbc:mysql://localhost:3306/sampleDatabase\'\n          - jndi-name: \'java:jboss/datasources/sampleDS\'\n          - user-name: sampleuser\n          - password: secret\n          - min-pool-size: 3\n          - use-java-context: True\n    profile\n        The profile name (JBoss domain mode only)\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt \'*\' jboss7.create_datasource \'{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}\' \'my_datasource\' \'{"driver-name": "mysql", "connection-url": "jdbc:mysql://localhost:3306/sampleDatabase", "jndi-name": "java:jboss/datasources/sampleDS", "user-name": "sampleuser", "password": "secret", "min-pool-size": 3, "use-java-context": True}\'\n    '
    log.debug('======================== MODULE FUNCTION: jboss7.create_datasource, name=%s, profile=%s', name, profile)
    ds_resource_description = __get_datasource_resource_description(jboss_config, name, profile)
    operation = '/subsystem=datasources/data-source="{name}":add({properties})'.format(name=name, properties=__get_properties_assignment_string(datasource_properties, ds_resource_description))
    if (profile is not None):
        operation = ('/profile="{profile}"'.format(profile=profile) + operation)
    return __salt__['jboss7_cli.run_operation'](jboss_config, operation, fail_on_error=False)

dataset/ETHPy150Open saltstack/salt/salt/modules/jboss7.py create_datasource/original