プライマリ・コンテンツに移動
Oracle Fusion Middleware Oracle WebLogic Server 12.1.3 RESTful管理インタフェース・リファレンス
12c (12.1.3)
E57542-02
  目次へ移動
目次

前
 
次
 

/management/wls/{version}/datasources

このリソースは、このWLSドメインで実行されるデータ・ソースを管理します。

リソースでは、次のメソッドがサポートされます。

GETメソッド

このリソースのGETメソッドは、このWLSドメイン内のすべてのデータ・ソースのリストを返します。

ロール

管理者、デプロイヤ、オペレータ、モニター

リクエスト問合せパラメータ

このメソッドでは、レスポンスに含められるフィールドの制限に使用できるオプションの問合せパラメータがサポートされます。必要とする情報のみにフィールドを制限すると、大規模なデータ・セットとやりとりする際にレスポンス時間を短縮できます。

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

(オプション)これらの値が必須ではなく、レスポンスで省略可能であることを指定します。

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

(オプション)これらの値が必須であり、レスポンスに含める必要があることを指定します。

包含と除外は相互に排他的であり、いずれも指定しない場合すべての使用可能な情報が含まれます。

レスポンス本文

返されるレスポンス本文には、DataSourceエンティティの集合が含まれます。また、対応するリソースへのリンクも含まれます。

このメソッドは次のリンクを返すことができます。

  • 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

レスポンス・コード

このメソッドは、標準のHTTPステータス・コードのいずれかを返します。

例1   データ・ソースの表示

この例は、GETメソッドを使用して、すべての構成済データ・ソースに関する情報を表示します。

リクエストの例

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

レスポンスの例

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メソッド

このリソースのOPTIONSメソッドは、デフォルト値が事前移入されているテンプレート・エンティティを返します。

データ・ソースを作成する場合、このメソッドを呼び出してテンプレートを取得し、ドライバ・クラス名やデータベースURLなどの値を入力して、POSTメソッドでこれを使用してデータ・ソースを作成します。

ロール

管理者

レスポンス本文

返されるレスポンス本文には、カスタマイズして、新規データ・ソースの作成に使用できるDataSourceテンプレート・エンティティが含まれます。

レスポンス・コード

このメソッドは、標準のHTTPステータス・コードのいずれかを返します。

例1   テンプレート・データ・ソース・エンティティの取得

この例は、OPTIONSメソッドを使用して、データ・ソースのテンプレートを取得します。

リクエストの例

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

レスポンスの例

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メソッド

このリソースのPOSTメソッドは、新規データ・ソースを作成します。

ロール

管理者

リクエスト本文

リクエスト本文には、完全に移入された、新規データ・ソースを記述するDataSourceエンティティが含まれている必要があります。読取り専用パラメータ値は無視されます。

レスポンス本文

レスポンス本文には、データ・ソースが作成されたことを示すメッセージが含まれます。

レスポンス・コード

このメソッドは、標準のHTTPステータス・コードのいずれかを返します。

例1   データ・ソースの作成

この例は、POSTメソッドを使用して、新規データ・ソースを作成します。

リクエストの例

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

レスポンスの例

HTTP/1.1 201 Created

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

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