2.11 RESTを介したOracle Autonomous Health Framework Complianceの使用
Oracle ORAchkおよびOracle EXAchkには、HTTPSを介した呼出しおよび問合せを可能にする完全なRESTサポートが含まれています。
- check
GETリクエストを使用して、指定されたチェックIDの状態チェック実行を実行します。 - checktfafaileduploads
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスのアップロードが失敗したかどうかを報告します。 - checktfaupload
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスにアップロードするための接続を確立できるかどうかを報告します。 - download
GETリクエストを使用して、指定されたジョブIDの収集結果をダウンロードします。 - getinfo
GETリクエストを使用して、指定されたジョブIDのステータスを報告します。 - listcollections
GETリクエストを使用して、RESTを介して生成されたOracle ORAchk収集のリストを取得します。 - gettfaupload
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスのアップロード設定を報告します。 - profile
GETリクエストを使用して、指定されたプロファイルの状態チェック実行を実行します。 - showrepair
GETリクエストを使用して、指定されたチェックのshowrepairコマンドを報告します。 - start_client
GETリクエストを使用して、通常の状態チェック実行を実行します。 - start_client
POSTおよびGETリクエストを使用し、特定の引数を使用して、通常の状態チェック実行を実行します。 - start_client
POSTリクエストを使用して、指定された収集結果の差分を実行します。 - status
GETリクエストを使用して、指定されたジョブIDのステータスを報告します。 - unsettfaupload
GETリクエストを使用して、すべてのOracle Autonomous Health Frameworkサービスのアップロード設定または特定の設定を解除します。 - uploadtfafailed
GETリクエストを使用して、以前に失敗したすべてのアップロードをOracle Autonomous Health Frameworkサービスに再度アップロードすることを試行します。 - version
GETリクエストを使用して、versionコマンドを実行します。
親トピック: リスクの分析とベスト・プラクティスへの準拠
2.11.1 check
GETリクエストを使用して、指定されたチェックIDの状態チェック実行を実行します。
構文
/check/{check_id1,check_id2}
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"B2PKK9RR9M7MYJPRN8", "Status":"SUBMITTED" }]
使用上の注意
プロファイル、またはチェックIDのカンマ区切りリストを指定します。
例2-2 check
-bash-4.2$ curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/check/E94589BC1AC24CFBE04312C0E50A3849
[{"ID":"B2PKK9RR9M7MYJPRN8","Status":"SUBMITTED"}]
2.11.2 checktfafaileduploads
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスのアップロードが失敗したかどうかを報告します。
構文
/checktfafaileduploads
戻り値
アップロードに失敗した収集がない場合は、次のような内容が返されます。
[{ "Msg":"There are no Failed collections under ORDS directory." }]
または、アップロードに失敗した収集のリストを出力します。
使用上の注意
このAPIを使用するための入力はありません。
例2-3 checktfafaileduploads
bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/checktfafaileduploads
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:04:58 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
[{"Msg":"There are no Failed collections under ORDS directory."}]
2.11.3 checktfaupload
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスにアップロードするための接続を確立できるかどうかを報告します。
構文
/checktfaupload
戻り値
次のようなJSONを返します。
[{ "ID":"ZFZLH06WOLE3L92PQI", "Status":"SUBMITTED" }]
使用上の注意
status
APIを使用して、発行されたジョブのステータスを問い合せます。
発行されたAPIのステータスがCOMPLETED
になった後、getinfo
APIを使用して、Oracle Autonomous Health Frameworkのアップロード・ステータスを表示します。
例2-4 getinfo
getinfo
を使用すると、次のような内容が返されます。
[{"Msg":"Environment is not set for uploading results to TFA."}]
2.11.4 download
GETリクエストを使用して、指定されたジョブIDの収集結果をダウンロードします。
構文
/download/{job_id}
戻り値
収集結果のzipバイナリを返します。
使用上の注意
収集結果をダウンロードするジョブIDを指定します。
消去されたIDまたは無効なIDを指定すると、ダウンロードされるファイルにエラー・メッセージが書き込まれます。
例2-5 download
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/download/0K5Y5MAX2SD5CPP6SH -O
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 54854 0 54854 0 0 220k 0 --:--:-- --:--:-- --:--:-- 221k
# unzip -qo 0K5Y5MAX2SD5CPP6SH
# ls -l
-rw-r--r--. 1 root root 54854 Sep 3 03:30 0K5Y5MAX2SD5CPP6SH
drwxr-xr-x. 1 root root 288 Sep 3 03:30 orachk_node1_orcl2_test_090319_032952_0K5Y5MAX2SD5CPP6SH
2.11.5 getinfo
GETリクエストを使用して、指定されたジョブIDのステータスを報告します。
構文
/getinfo/{job_id}
戻り値
IDが存在しない場合は、次のようなJSONを返します。
[{ "Status":"Either the ID entered is invalid or the wallet has been purged." }]
または、IDが存在する場合、修復コマンドを返します。
使用上の注意
ステータスを確認するジョブIDを指定します。
例2-6 getinfo
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/getinfo/FJELUT7XYM3AKOE1R4 HTTP/1.1 200 OK Date: Thu, 19 Jul 2018 10:15:34 GMT
Content-Type: text/html X-Frame-Options: SAMEORIGIN Transfer-Encoding: chunked
修復コマンド
alter database datafile '+DATAC1/RAC12C/DATAFILE/sysaux.314.936528199' autoextend on maxsize unlimited;
2.11.6 listcollections
GETリクエストを使用して、RESTを介して生成されたOracle ORAchk収集のリストを取得します。
構文
/tfactl/orachk/listcollections
戻り値
RESTを介して生成されたOracle ORAchk収集のリストを返します。
例2-7 listcollections
# curl -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/listcollections | sed s/\<BR\>/\\n/g
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 581 0 581 0 0 3906 0 --:--:-- --:--:-- --:--:-- 3925
List of collections:
/u02/test-user/oracle.ahf/data/node1/tfa/rest/ords/orachk_node1_orcl2_bill_test_090319_034049_BTGP96ZYH45P5LHB86.zip
/u02/test-user/oracle.ahf/data/node1/tfa/rest/ords/orachk_node1_orcl2_bill_test_090319_032952_0K5Y5MAX2SD5CPP6SH.zip
/u02/test-user/oracle.ahf/data/node1/tfa/rest/ords/orachk_node1_orcl2_bill_test_090319_034245_WH9UWZRN9PKPDNKZCL.zip
/u02/test-user/oracle.ahf/data/node1/tfa/rest/ords/orachk_node1_orcl2_bill_test_090319_033349_L05Y28DSOTZ9N73HO0.zip
2.11.7 gettfaupload
GETリクエストを使用して、Oracle Autonomous Health Frameworkサービスのアップロード設定を報告します。
構文
/gettfaupload
戻り値
RAT_TFA_URL
、RAT_TFA_USER
およびRAT_TFA_PASSWORD
の3つの環境変数の値をリストします。
使用上の注意
このAPIを使用するための入力はありません。
例2-8 gettfaupload
bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/gettfaupload
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:07:24 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
RAT_TFA_URL = https://tfa.example.com/tfa/ws/orachk/
RAT_TFA_USER = orachkadmin
RAT_TFA_PASSWORD = ********
unsettfaupload
APIの後に、gettfaupload
APIを使用して値を再チェックします。
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/gettfaupload
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:10:10 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
RAT_TFA_URL is not set in the wallet
RAT_TFA_USER is not set in the wallet
RAT_TFA_PASSWORD is not set in the wallet
2.11.8 profile
GETリクエストを使用して、指定されたプロファイルの状態チェック実行を実行します。
構文
/profile/{profile1},{profile2}
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"DMBLMBTB2M2H1QCQIS", "Status":"SUBMITTED" }]
使用上の注意
プロファイル、またはスラッシュ(/)で区切られたプロファイルのリストを指定します。
例2-9 profile
-bash-4.2$ curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/profile/asm
HTTP/1.1 200 OK Date: Thu, 05 Apr 2018 10:50:00 GMT Content-Type: text/html X-Frame-Options:
SAMEORIGIN Transfer-Encoding: chunked Server: Jetty(9.2.z-SNAPSHOT)
[{"ID":"DMBLMBTB2M2H1QCQIS","Status":"SUBMITTED"}]
2.11.9 showrepair
GETリクエストを使用して、指定されたチェックのshowrepairコマンドを報告します。
構文
/showrepair/{check_id}
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"ZFZLH06WOLE3L92PQI", "Status":"SUBMITTED" }]
使用上の注意
showrepairコマンドの報告対象となるチェックIDを指定します。
例2-10 showrepair
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/showrepair/9ECBA2152E92F6B1E040E50A1EC00DFB
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:13:54 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
[{"ID":"FJELUT7XYM3AKOE1R4","Status":"SUBMITTED"}]
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/status/FJELUT7XYM3AKOE1R4
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:15:00 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
[{"Msg":"Status of FJELUT7XYM3AKOE1R4 is COMPLETED"}]
2.11.10 start_client
GETリクエストを使用して、通常の状態チェック実行を実行します。
構文
/start_client
戻り値
次のようにジョブIDを示すJSONを返します。
[{
"ID":"UCTW5MLN7O1V1HPG8U",
"Status":"SUBMITTED"
}]
使用上の注意
このAPIを使用するための入力はありません。
例2-11 start_client
-bash-4.2$ curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/start_client
HTTP/1.1 200 OK Date: Thu, 05 Apr 2018 11:53:14 GMT Content-Type: text/html X-Frame-Options:
SAMEORIGIN Transfer-Encoding: chunked Server: Jetty(9.2.z-SNAPSHOT)
[{"ID":"UCTW5MLN7O1V1HPG8U","Status":"SUBMITTED"}]
2.11.11 start_client
POSTおよびGETリクエストを使用し、特定の引数を使用して、通常の状態チェック実行を実行します。
構文
/start_client
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"UCTW5MLN7O1V1HPG8U", "Status":"SUBMITTED" }]
使用上の注意
Oracle ORAchkまたはOracle EXAchkの引数と対応する値を指定します。
例2-12 JSONの入力
[{
"-clusternodes":"busm1c1,busm1c2",
"-ibswitches":"busm1sw-ibs0,busm1sw-iba0,busm1sw-ibb0"
}]
例2-13 start_client
# curl -i -X POST -H "Content-Type: application/json" -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/start_client -d '[{"-clusternodes":"busm1c1,busm1c2","-ibswitches":"busm1sw-ibs0,busm1sw-iba0,busm1sw-ibb0"}]
# curl -X POST -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/start_client -d '{"-check": "81586F6DEC0DB43CE053D398EB0AF1EA", "-showpass", ""}'
[{"ID":"0K5Y5MAX2SD5CPP6SH","Status":"SUBMITTED"}]
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/check/81586F6DEC0DB43CE053D398EB0AF1EA
[{"ID":"BTGP96ZYH45P5LHB86","Status":"SUBMITTED"}]
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/profile/asm
[{"ID":"WH9UWZRN9PKPDNKZCL","Status":"SUBMITTED"}]
2.11.12 start_client
POSTリクエストを使用して、指定された収集結果の差分を実行します。
構文
/start_client
戻り値
次のようなJSONを返します。
[{ "ID":"ZFZLH06WOLE3L92PQI", "Status":"SUBMITTED" }]
status APIを使用すると、送信されたジョブIDのステータスを問い合せることができます。次に、download APIを使用し、同じジョブIDを使用して差分レポートをダウンロードできます。
使用上の注意
JSONの入力
[{ "-diff":"collection_zip_1 collection_zip_2" }]
例2-14 start_client
-bash-4.2$ curl -i -X POST -H "Content-Type: application/json" -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/start_client -d '[{"-diff":"orachk_myhost69_apxcmupg_062118_025029_N1O498NX877LYO5FE3.zip
orachk_myhost69_apxcmupg_062118_030527_ICMOWECU1UKF0R0VTO.zip"}]'
2.11.13 status
GETリクエストを使用して、指定されたジョブIDのステータスを報告します。
構文
/status/{job_id}
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "Status of DMBLMBTB2M2H1QCQIS is SUBMITTED" }]
ステータスは、SUBMITTED
からRUNNING
、COMPLETED
に遷移します。
使用上の注意
ステータスを検索するジョブIDを指定します。
例2-15 status
# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/status/DMBLMBTB2M2H1QCQIS
HTTP/1.1 200 OK Date: Thu, 05 Apr 2018 10:51:16 GMT Content-Type: text/html X-Frame-Options:
SAMEORIGIN Transfer-Encoding: chunked Server: Jetty(9.2.z-SNAPSHOT)
[{"Status of DMBLMBTB2M2H1QCQIS is SUBMITTED"}]
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/status/0K5Y5MAX2SD5CPP6SH
[{"Msg":"Status of 0K5Y5MAX2SD5CPP6SH is RUNNING"}]
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/status/0K5Y5MAX2SD5CPP6SH
[{"Msg":"Status of 0K5Y5MAX2SD5CPP6SH is COMPLETED"}]
# curl -X GET -k --user tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/status/0K5Y5MAX2SD5CPP6SH
[{"Msg":"Status of 0K5Y5MAX2SD5CPP6SH is COMPLETED"}]
2.11.14 unsettfaupload
GETリクエストを使用して、すべてのOracle Autonomous Health Frameworkサービスのアップロード設定または特定の設定を解除します。
構文
/unsettfaupload/all
/unsettfaupload/RAT_TFA_USER
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"ZFZLH06WOLE3L92PQI", "Status":"SUBMITTED" }]
使用上の注意
all
を指定して3つの環境変数(RAT_TFA_URL
、RAT_TFA_USER
およびRAT_TFA_PASSWORD
)をすべて設定解除するか、環境変数を指定してその設定を解除します。
例2-16 unsettfaupload
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/unsettfaupload/all
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:08:30 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
[{"ID":"Z8P9DHA8VV3PUOVQTV","Status":"SUBMITTED"}]
2.11.15 uploadtfafailed
GETリクエストを使用して、以前に失敗したすべてのアップロードをOracle Autonomous Health Frameworkサービスに再度アップロードすることを試行します。
構文
/uploadtfafailed/all
戻り値
次のようにジョブIDを示すJSONを返します。
[{ "ID":"ZFZLH06WOLE3L92PQI", "Status":"SUBMITTED" }]
使用上の注意
このAPIを使用するための入力はありません。
例2-17 uploadtfafailed
-bash-4.1# curl -i -X GET -k -u tfarest:password
https://node1.example.com:9090/ords/tfactl/orachk/uploadtfafailed/all
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 10:09:18 GMT
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
[{"ID":"0B9O04CKSYZNUZCYZD","Status":"SUBMITTED"}]