
Db2 REST サービスの詳細のディスカバー
必要な権限を持っている場合、Db2® REST サービス・ディスカバー API を使用して、サービスの詳細をディスカバーできます。
始める前に
- サービスのパッケージの Execute 特権
- サービスの所有権
- SYSADM 権限または SYSCTRL 権限
- システム DBADM 権限
手順
例
サービス simpleSelect1 の詳細をディスカバーするには、以下の URI を入力して HTTPS GET 要求を開始します。
GET https://<host>:<port>/services/simpleSelect1
要求に以下の HTTP ヘッダー・フィールドを指定します。
Accept:application/json
Content-Type:application/json
Db2 は、JSON で以下の応答を返します。
{
"simpleSelect1": {
"serviceName": "simpleSelect1",
"serviceCollectionID": "SYSIBMSERVICE",
"serviceProvider": "db2service-1.0",
"serviceDescription": "Select deptname based on location.",
"serviceURL": "http://<host>:<port>/services/SYSIBMSERVICE/simpleSelect1",
"serviceStatus": "started",
"RequestSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"LOCATION": {
"type": [
"null",
"string"
],
"maxLength": 16,
"description": "Nullable CHAR(16)"
}
},
"required": [
"LOCATION"
],
"description": "Service simpleSelect1 invocation HTTP request body"
},
"ResponseSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"ResultSet Output": {
"type": "array",
"items": {
"type": "object",
"properties": {
"DEPTNAME": {
"type": "string",
"maxLength": 36,
"description": "VARCHAR(36)"
}
},
"required": [
"DEPTNAME"
],
"description": "ResultSet Row"
}
},
"StatusDescription": {
"type": "string",
"description": "Service invocation status description"
},
"StatusCode": {
"type": "integer",
"multipleOf": 1,
"minimum": 100,
"maximum": 600,
"description": "Service invocation HTTP status code"
}
},
"required": [
"StatusDescription",
"StatusCode",
"ResultSet Output"
],
"description": "Service simpleSelect1 invocation HTTP response body"
}
}
}
