/management/wls/{version}/datasources

This resource manages the data sources that run in this WLS domain.

The resource supports the following methods:

GET Method

The GET method on this resource returns a listing of all the data sources in this WLS domain.

Roles

Administrator, Deployer, Operator, Monitor

Request Query Parameters

This method supports optional query parameters which can be used to constrain the fields included in the response. Constraining the fields to only the information that you require may yield faster response times when interacting with large data sets.

?_excludeFields=field1[,field2, ...]

(Optional) Specifies that these values are not required and may be omitted in a response.

?_includeFields=field1[,field2, ...]

(Optional) Specifies that these values are required and must be included in the response.

Include and exclude are mutually exclusive, and if neither is specified all available information is included.

Response Body

The response body returned includes a collection of DataSource entities. It also contains links to their corresponding resources.

This method can return the following links:

  • uri=/management/wls/{version}/datasources/drivers rel=drivers

  • uri=/management/wls/{version}/datasources/test rel=test

  • uri=/management/wls/{version} rel=parent

  • uri=/management/wls/{version}/datasources/id/{data-source-name} rel=items.name title=name

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Viewing Data Sources

This example uses the GET method to display information about all configured data sources.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-X GET http://localhost:7001/management/wls/latest/datasources

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "links": [
        {
            "rel": "parent",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest"
        },
        {
            "rel": "vendors",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/vendors"
        },
        {
            "rel": "test",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/test"
        },
        {
            "rel": "items.name",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource",
            "title": "TestDataSource"
        }
    ],
    "items": [{
        "name": "TestDataSource",
        "targets": [
            "myserver",
            "Cluster-0"
        ],
        "jdbcDataSourceParams": {
            "scope": "global",
            "dataSourceList": null,
            "globalTransactionsProtocol": "one phase commit",
            "rowPrefetchSize": 48,
            "streamChunkSize": 256,
            "algorithmType": "failover",
            "connectionPoolFailoverCallbackHandler": null,
            "failoverRequestIfBusy": false,
            "rowPrefetch": false,
            "jndiNames": [
                "jndiName1",
                "jndiName2"
            ],
            "keepConnAfterLocalTx": true,
            "keepConnAfterGlobalTx": false
        },
        "jdbcConnectionPoolParams": {
            "driverInterceptor": "",
            "connectionHarvestMaxCount": 1,
            "connectionHarvestTriggerCount": -1,
            "minCapacity": 1,
            "profileType": 0,
            "connectionLabelingCallback": "",
            "maxCapacity": 15,
            "highestNumWaiters": 2147483647,
            "loginDelaySeconds": 0,
            "secondsToTrustAnIdlePoolConnection": 10,
            "initialCapacity": 1,
            "shrinkFrequencySeconds": 900,
            "testFrequencySeconds": 120,
            "testTableName": "SQL SELECT 1 FROM SYS.SYSTABLES",
            "testConnectionsOnReserve": false,
            "connectionReserveTimeoutSeconds": 10,
            "connectionCreationRetryFrequencySeconds": 0,
            "inactiveConnectionTimeoutSeconds": 0,
            "statementCacheSize": 10,
            "statementCacheType": "least recently used",
            "statementTimeout": -1,
            "countOfTestFailuresTillFlush": 2,
            "countOfRefreshFailuresTillDisable": 2,
            "profileHarvestFrequencySeconds": 300,
            "initSql": "",
            "fatalErrorCodes": "",
            "removeInfectedConnections": true,
            "jdbcXaDebugLevel": 10,
            "ignoreInUseConnectionsEnabled": true,
            "credentialMappingEnabled": false,
            "pinnedToThread": false,
            "identityBasedConnectionPoolingEnabled": false,
            "wrapTypes": true,
            "wrapJdbc": true
        },
        "jdbcDriverParams": {
            "properties": [
                {
                    "name": "portNumber",
                    "value": "1527"
                },
                {
                    "name": "databaseName",
                    "value": "demo;create=true"
                },
                {
                    "name": "serverName",
                    "value": "localhost"
                }
            ],
            "driverName": "org.apache.derby.jdbc.ClientXADataSource",
            "systemProperties": [],
            "url": "jdbc:derby:\/\/localhost:1527\/demo",
            "useXaDataSourceInterface": true,
            "usePasswordIndirection": false
        },
        "aggregateMetrics": {
            "reserveRequestCount": 0,
            "failedReserveRequestCount": 0,
            "waitingForConnectionTotal": 0,
            "waitingForConnectionSuccessTotal": 0,
            "waitingForConnectionFailureTotal": 0,
            "currCapacityHighCount": 3,
            "state": "Running",
            "prepStmtCacheAccessCount": 0,
            "prepStmtCacheAddCount": 0,
            "prepStmtCacheDeleteCount": 0,
            "prepStmtCacheCurrentSize": 0,
            "prepStmtCacheHitCount": 0,
            "prepStmtCacheMissCount": 0,
            "currCapacity": 3,
            "numAvailable": 3,
            "highestNumAvailable": 3,
            "numUnavailable": 0,
            "highestNumUnavailable": 0,
            "leakedConnectionCount": 0,
            "failuresToReconnectCount": 0,
            "connectionDelayTime": 238,
            "activeConnectionsCurrentCount": 0,
            "waitingForConnectionCurrentCount": 0,
            "activeConnectionsHighCount": 0,
            "waitingForConnectionHighCount": 0,
            "waitSecondsHighCount": 0,
            "connectionsTotalCount": 3,
            "activeConnectionsAverageCount": 0
        },
        "dataSourceMetrics": [
            {
                "reserveRequestCount": 0,
                "failedReserveRequestCount": 0,
                "waitingForConnectionTotal": 0,
                "waitingForConnectionSuccessTotal": 0,
                "waitingForConnectionFailureTotal": 0,
                "currCapacityHighCount": 1,
                "state": "Running",
                "prepStmtCacheAccessCount": 0,
                "prepStmtCacheAddCount": 0,
                "prepStmtCacheDeleteCount": 0,
                "prepStmtCacheCurrentSize": 0,
                "prepStmtCacheHitCount": 0,
                "prepStmtCacheMissCount": 0,
                "currCapacity": 1,
                "numAvailable": 1,
                "highestNumAvailable": 1,
                "numUnavailable": 0,
                "highestNumUnavailable": 0,
                "leakedConnectionCount": 0,
                "failuresToReconnectCount": 0,
                "connectionDelayTime": 238,
                "activeConnectionsCurrentCount": 0,
                "waitingForConnectionCurrentCount": 0,
                "activeConnectionsHighCount": 0,
                "waitingForConnectionHighCount": 0,
                "waitSecondsHighCount": 0,
                "connectionsTotalCount": 1,
                "activeConnectionsAverageCount": 0,
                "serverName": "Cluster-0-Server-2"
            },
            {
                "reserveRequestCount": 0,
                "failedReserveRequestCount": 0,
                "waitingForConnectionTotal": 0,
                "waitingForConnectionSuccessTotal": 0,
                "waitingForConnectionFailureTotal": 0,
                "currCapacityHighCount": 1,
                "state": "Running",
                "prepStmtCacheAccessCount": 0,
                "prepStmtCacheAddCount": 0,
                "prepStmtCacheDeleteCount": 0,
                "prepStmtCacheCurrentSize": 0,
                "prepStmtCacheHitCount": 0,
                "prepStmtCacheMissCount": 0,
                "currCapacity": 1,
                "numAvailable": 1,
                "highestNumAvailable": 1,
                "numUnavailable": 0,
                "highestNumUnavailable": 0,
                "leakedConnectionCount": 0,
                "failuresToReconnectCount": 0,
                "connectionDelayTime": 238,
                "activeConnectionsCurrentCount": 0,
                "waitingForConnectionCurrentCount": 0,
                "activeConnectionsHighCount": 0,
                "waitingForConnectionHighCount": 0,
                "waitSecondsHighCount": 0,
                "connectionsTotalCount": 1,
                "activeConnectionsAverageCount": 0,
                "serverName": "Cluster-0-Server-1"
            },
            {
                "reserveRequestCount": 0,
                "failedReserveRequestCount": 0,
                "waitingForConnectionTotal": 0,
                "waitingForConnectionSuccessTotal": 0,
                "waitingForConnectionFailureTotal": 0,
                "currCapacityHighCount": 1,
                "state": "Running",
                "prepStmtCacheAccessCount": 0,
                "prepStmtCacheAddCount": 0,
                "prepStmtCacheDeleteCount": 0,
                "prepStmtCacheCurrentSize": 0,
                "prepStmtCacheHitCount": 0,
                "prepStmtCacheMissCount": 0,
                "currCapacity": 1,
                "numAvailable": 1,
                "highestNumAvailable": 1,
                "numUnavailable": 0,
                "highestNumUnavailable": 0,
                "leakedConnectionCount": 0,
                "failuresToReconnectCount": 0,
                "connectionDelayTime": 4,
                "activeConnectionsCurrentCount": 0,
                "waitingForConnectionCurrentCount": 0,
                "activeConnectionsHighCount": 0,
                "waitingForConnectionHighCount": 0,
                "waitSecondsHighCount": 0,
                "connectionsTotalCount": 1,
                "activeConnectionsAverageCount": 0,
                "serverName": "myserver"
            }
        ]
    }]
}

OPTIONS Method

The OPTIONS method on this resource returns a template entity that has been pre-populated with default values.

If you want to create a data source, call this method to get the template, fill in values, such as the driver class name and database URL, then use it in the POST method to create the data source.

Roles

Administrator

Response Body

The response body returned includes a DataSource template entity that can be customized and then used to create a new data source.

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Getting a Template Data Source Entity

This example uses the OPTIONS method to obtain a template for a data source.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-X OPTIONS http://localhost:7001/management/wls/latest/datasources

Example Response

HTTP/1.1 200 OK

Response Body:
{"item": {
    "name": "DataSource-0",
    "targets": [],
    "jdbcDataSourceParams": {
        "scope": "global",
        "dataSourceList": null,
        "globalTransactionsProtocol": "one phase commit",
        "rowPrefetchSize": 48,
        "streamChunkSize": 256,
        "algorithmType": "failover",
        "connectionPoolFailoverCallbackHandler": null,
        "failoverRequestIfBusy": false,
        "rowPrefetch": false,
        "jndiNames": [],
        "keepConnAfterLocalTx": true,
        "keepConnAfterGlobalTx": false
    },
    "jdbcConnectionPoolParams": {
        "driverInterceptor": "",
        "connectionHarvestMaxCount": 1,
        "connectionHarvestTriggerCount": -1,
        "minCapacity": 1,
        "profileType": 0,
        "connectionLabelingCallback": "",
        "maxCapacity": 15,
        "highestNumWaiters": 2147483647,
        "loginDelaySeconds": 0,
        "secondsToTrustAnIdlePoolConnection": 10,
        "initialCapacity": 1,
        "shrinkFrequencySeconds": 900,
        "testFrequencySeconds": 120,
        "testTableName": null,
        "testConnectionsOnReserve": false,
        "connectionReserveTimeoutSeconds": 10,
        "connectionCreationRetryFrequencySeconds": 0,
        "inactiveConnectionTimeoutSeconds": 0,
        "statementCacheSize": 10,
        "statementCacheType": "least recently used",
        "statementTimeout": -1,
        "countOfTestFailuresTillFlush": 2,
        "countOfRefreshFailuresTillDisable": 2,
        "profileHarvestFrequencySeconds": 300,
        "initSql": "",
        "fatalErrorCodes": "",
        "removeInfectedConnections": true,
        "jdbcXaDebugLevel": 10,
        "ignoreInUseConnectionsEnabled": true,
        "credentialMappingEnabled": false,
        "pinnedToThread": false,
        "identityBasedConnectionPoolingEnabled": false,
        "wrapTypes": true,
        "wrapJdbc": true
    },
    "jdbcDriverParams": {
        "properties": [],
        "password": null,
        "driverName": null,
        "systemProperties": [],
        "url": null,
        "useXaDataSourceInterface": true,
        "usePasswordIndirection": false
    },
    "aggregateMetrics": {
        "reserveRequestCount": 0,
        "failedReserveRequestCount": 0,
        "waitingForConnectionTotal": 0,
        "waitingForConnectionSuccessTotal": 0,
        "waitingForConnectionFailureTotal": 0,
        "currCapacityHighCount": 0,
        "state": null,
        "prepStmtCacheAccessCount": 0,
        "prepStmtCacheAddCount": 0,
        "prepStmtCacheDeleteCount": 0,
        "prepStmtCacheCurrentSize": 0,
        "prepStmtCacheHitCount": 0,
        "prepStmtCacheMissCount": 0,
        "currCapacity": 0,
        "numAvailable": 0,
        "highestNumAvailable": 0,
        "numUnavailable": 0,
        "highestNumUnavailable": 0,
        "leakedConnectionCount": 0,
        "failuresToReconnectCount": 0,
        "connectionDelayTime": 0,
        "activeConnectionsCurrentCount": 0,
        "waitingForConnectionCurrentCount": 0,
        "activeConnectionsHighCount": 0,
        "waitingForConnectionHighCount": 0,
        "waitSecondsHighCount": 0,
        "connectionsTotalCount": 0,
        "activeConnectionsAverageCount": 0,
        "serverName": null
    },
    "dataSourceMetrics": []
}}

POST Method

The POST method on this resource creates a new data source.

Roles

Administrator

Request Body

The request body must include a fully populated DataSource entity that describes the new data source. Read only parameter values are ignored.

Response Body

The response body contains a message that states that the data source was created.

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Creating a Data Source

This example uses the POST method to create a new data source.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:application/json \
-d "{
    'name': 'TestDataSource',
    'targets': [ 'myserver', 'Cluster-0' ],
    'jdbcDriverParams': {
        'properties': [
             { name: 'portNumber', value: '1527' }, 
             { name: 'databaseName', value: 'demo;create=true' }, 
             { name: 'serverName', value: 'localhost' }
        ],
        'password': 'password1',
        'driverName': 'org.apache.derby.jdbc.ClientXADataSource',
        'url': 'jdbc:derby://localhost:1527/demo',
        'systemProperties': [],
        'usePasswordIndirection': false,
        'useXaDataSourceInterface': true
    },
    'jdbcDataSourceParams': {
        'scope': 'global',
        'algorithmType': 'failover',
        'connectionPoolFailoverCallbackHandler': null,
        'failoverRequestIfBusy': false,
        'dataSourceList': null,
        'globalTransactionsProtocol': 'one phase commit',
        'rowPrefetchSize': 48,
        'streamChunkSize': 256,
        'rowPrefetch': false,
        'keepConnAfterLocalTx': true,
        'keepConnAfterGlobalTx': false,
        'jndiNames': [ 'jndiName1', 'jndiName2' ]
    },
    'jdbcConnectionPoolParams': {
        'profileHarvestFrequencySeconds': 300,
        'driverInterceptor': '',
        'connectionHarvestMaxCount': 1,
        'connectionHarvestTriggerCount': -1,
        'minCapacity': 1,
        'profileType': 0,
        'connectionLabelingCallback': '',
        'maxCapacity': 15,
        'highestNumWaiters': 2147483647,
        'loginDelaySeconds': 0,
        'secondsToTrustAnIdlePoolConnection': 10,
        'initialCapacity': 1,
        'shrinkFrequencySeconds': 900,
        'testFrequencySeconds': 120,
        'testTableName': 'SQL SELECT 1 FROM SYS.SYSTABLES',
        'testConnectionsOnReserve': false,
        'connectionReserveTimeoutSeconds': 10,
        'connectionCreationRetryFrequencySeconds': 0,
        'inactiveConnectionTimeoutSeconds': 0,
        'statementCacheSize': 10,
        'statementCacheType': 'least recently used',
        'statementTimeout': -1,
        'countOfTestFailuresTillFlush': 2,
        'countOfRefreshFailuresTillDisable': 2,
        'fatalErrorCodes': '',
        'initSql': '',
        'ignoreInUseConnectionsEnabled': true,
        'removeInfectedConnections': true,
        'credentialMappingEnabled': false,
        'pinnedToThread': false,
        'identityBasedConnectionPoolingEnabled': false,
        'wrapTypes': true,
        'wrapJdbc': true,
        'jdbcXaDebugLevel': 10
    }
}" \
-X POST http://localhost:7001/management/wls/latest/datasources

Example Response

HTTP/1.1 201 Created

Location: http://localhost:7001/management/wls/latest/datasources/id/TestDataSource

Response Body:
{"messages": [{
    "message": "Successfully created 'TestDataSource'.",
    "severity": "SUCCESS"
}]}