/management/wls/{version}/datasources/id/{data-source-name}

This resource manages the data source identified by the resource URL.

The resource supports the following methods:

DELETE Method

The DELETE method deletes the data source identified by the resource URL.

Roles

Administrator

Response Body

The response body returned contains a message stating that the data source's configuration was deleted.

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Deleting a Data Source

This example uses the DELETE method to remove a data source configuration.

Example Request

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

Example Response

HTTP/1.1 200 OK

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

GET Method

The GET method on this resource returns information about the data source identified by the resource URL.

Roles

Administrator, Deployer, Operator, Monitor

Response Body

The response body returned includes a DataSource entity that contains information about the specified data source.

This method can return the following links:

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

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

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

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

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

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

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

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

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

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Viewing a Data Source

This example uses the GET method to find information about a specific data source.

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/id/TestDataSource

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "links": [
        {
            "rel": "parent",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/start",
            "title": "start"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/shutdown",
            "title": "shutdown"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/test",
            "title": "test"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/clearStatementCache",
            "title": "clearStatementCache"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/reset",
            "title": "reset"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/shrink",
            "title": "shrink"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/suspend",
            "title": "suspend"
        },
        {
            "rel": "action",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/datasources\/id\/TestDataSource\/resume",
            "title": "resume"
        }
    ],
    "item": {
        "name": "TestDataSource",
        "targets": [
            "myserver",
            "Cluster-0"
        ],
        "jdbcDataSourceParams": {
            "scope": "global",
            "dataSourceList": null,
            "globalTransactionsProtocol": "one phase commit",
            "rowPrefetchSize": 96,
            "streamChunkSize": 256,
            "algorithmType": "failover",
            "connectionPoolFailoverCallbackHandler": null,
            "failoverRequestIfBusy": false,
            "rowPrefetch": true,
            "jndiNames": [
                "jndiName1",
                "jndiName2",
                "jndiName3"
            ],
            "keepConnAfterLocalTx": true,
            "keepConnAfterGlobalTx": false
        },
        "jdbcConnectionPoolParams": {
            "driverInterceptor": "",
            "connectionHarvestMaxCount": 1,
            "connectionHarvestTriggerCount": -1,
            "minCapacity": 1,
            "profileType": 0,
            "connectionLabelingCallback": "",
            "maxCapacity": 30,
            "highestNumWaiters": 2147483647,
            "loginDelaySeconds": 0,
            "secondsToTrustAnIdlePoolConnection": 10,
            "initialCapacity": 2,
            "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": 3,
            "failedReserveRequestCount": 0,
            "waitingForConnectionTotal": 0,
            "waitingForConnectionSuccessTotal": 0,
            "waitingForConnectionFailureTotal": 0,
            "currCapacityHighCount": 3,
            "state": "Shutdown",
            "prepStmtCacheAccessCount": 0,
            "prepStmtCacheAddCount": 0,
            "prepStmtCacheDeleteCount": 0,
            "prepStmtCacheCurrentSize": 0,
            "prepStmtCacheHitCount": 0,
            "prepStmtCacheMissCount": 0,
            "currCapacity": 0,
            "numAvailable": 0,
            "highestNumAvailable": 3,
            "numUnavailable": 0,
            "highestNumUnavailable": 3,
            "leakedConnectionCount": 0,
            "failuresToReconnectCount": 0,
            "connectionDelayTime": 238,
            "activeConnectionsCurrentCount": 0,
            "waitingForConnectionCurrentCount": 0,
            "activeConnectionsHighCount": 3,
            "waitingForConnectionHighCount": 0,
            "waitSecondsHighCount": 0,
            "connectionsTotalCount": 3,
            "activeConnectionsAverageCount": 0
        },
        "dataSourceMetrics": [
            {
                "reserveRequestCount": 1,
                "failedReserveRequestCount": 0,
                "waitingForConnectionTotal": 0,
                "waitingForConnectionSuccessTotal": 0,
                "waitingForConnectionFailureTotal": 0,
                "currCapacityHighCount": 1,
                "state": "Shutdown",
                "prepStmtCacheAccessCount": 0,
                "prepStmtCacheAddCount": 0,
                "prepStmtCacheDeleteCount": 0,
                "prepStmtCacheCurrentSize": 0,
                "prepStmtCacheHitCount": 0,
                "prepStmtCacheMissCount": 0,
                "currCapacity": 0,
                "numAvailable": 0,
                "highestNumAvailable": 1,
                "numUnavailable": 0,
                "highestNumUnavailable": 1,
                "leakedConnectionCount": 0,
                "failuresToReconnectCount": 0,
                "connectionDelayTime": 4,
                "activeConnectionsCurrentCount": 0,
                "waitingForConnectionCurrentCount": 0,
                "activeConnectionsHighCount": 1,
                "waitingForConnectionHighCount": 0,
                "waitSecondsHighCount": 0,
                "connectionsTotalCount": 1,
                "activeConnectionsAverageCount": 0,
                "serverName": "myserver"
            }
        ]
    }
}

POST Method

The POST method on this resource reconfigures the data source identified by the resource URL.

Roles

Administrator

Request Body

The POST request body must include a fully populated DataSource entity that contains the desired data source configuration. Read only parameter values are ignored.

Response Body

The response body returned contains a message stating that the data source's configuration was updated.

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Editing a Data Source

This example uses the POST method to update a data source configuration.

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': 96,
        'streamChunkSize': 256,
        'rowPrefetch': true,
        'keepConnAfterLocalTx': true,
        'keepConnAfterGlobalTx': false,
        'jndiNames': [ 'jndiName1', 'jndiName2', 'jndiName3' ]
    },
    'jdbcConnectionPoolParams': {
        'profileHarvestFrequencySeconds': 300,
        'driverInterceptor': '',
        'connectionHarvestMaxCount': 1,
        'connectionHarvestTriggerCount': -1,
        'minCapacity': 1,
        'profileType': 0,
        'connectionLabelingCallback': '',
        'maxCapacity': 30,
        'highestNumWaiters': 2147483647,
        'loginDelaySeconds': 0,
        'secondsToTrustAnIdlePoolConnection': 10,
        'initialCapacity': 2,
        '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/id/TestDataSource

Example Response

HTTP/1.1 200 OK

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