DBからのジョブIDの削除
delete
/r-scripts/v1/jobs/{jobId}
job_idにより表からジョブを削除します
リクエスト
パス・パラメータ
- jobId(必須):
非同期ジョブのID
レスポンス
202レスポンス
ジョブはまだ保留中です。
302レスポンス
401レスポンス
ユーザーにアクションを実行する権限がない場合。
500レスポンス
ブローカへの接続中、ジョブIDの検出中に問題が発生したか、または他の予期しないエラーが発生しました。
例
実行に時間がかかりすぎている関数を中断または削除する場合は、cURLを使用してDELETEリクエストを送信することで実行中の関数呼出しを停止できます。実行中のジョブを削除するには、次のステップに従います:
- 関数の定義: 関数
tmrqfun2
は、完了までにかなりの時間を要します。begin sys.rqScriptCreate('tmrqfun2', 'function() { Sys.sleep(1800) res <- "Hello World!" res }'); end; /
- スクリプトの実行: 次のcURLコマンドは、
'tmrqfun2'
という名前のスクリプトを非同期値で実行します。curl -i -k -X POST --header "Authorization: Bearer ${token}" --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"service":"LOW", "asyncFlag":true, "timeout": 4800}' "https://<server>/oml/api/r-scripts/v1/do-eval/tmrqfun2"
HTTP/1.1 201 Created Server: nginx/1.20.1 Date: Tue, 18 Feb 2025 17:01:05 GMT GMT Content-Length: 0 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1;mode=block Content-Security-Policy: default-src 'none'; connect-src 'self'; font-src 'self' static.oracle.com; img-src 'self' data: static.oracle.com; media-src 'none'; object-src 'none'; script-src 'self' static.oracle.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' static.oracle.com 'unsafe-inline'; frame-ancestors 'none' Set-Cookie: JSESSIONID=node0q111ieg2vqdj1wf7cnlf2ao2k0.node0; Path=/oml; Secure; HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT Location: https://phoenix363074.dev3sub2phx.databasede3phx.oraclevcn.com/oml/api/r-scripts/v1/jobs/ce91e852-8e91-46da-b26c-6314d9d9f267
- ジョブ・ステータスの確認: IDでジョブをチェックして、ジョブが実行中かどうかを確認します。
curl -i -k -X GET --header "Authorization: Bearer ${token}" --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"service":"LOW"}' "https://<server>/oml/api/r-scripts/v1/jobs/ce91e852-8e91-46da-b26c-6314d9d9f267"
HTTP/1.1 202 Accepted Date: Tue, 18 Feb 2025 17:02:01 GMT GMT Content-Type: application/json Content-Length: 93 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1;mode=block Content-Security-Policy: default-src 'none'; connect-src 'self'; font-src 'self' static.oracle.com; img-src 'self' data: static.oracle.com; media-src 'none'; object-src 'none'; script-src 'self' static.oracle.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' static.oracle.com 'unsafe-inline'; frame-ancestors 'none' {"createdDate":" Feb 18,2025 17:01","status":"job is still running","elapsedTime":"00:00:47"}
- ジョブの削除: jobid
ce91e852-8e91-46da-b26c-6314d9d9f267
のジョブを削除します。curl -i -k -X DELETE --header "Authorization: Bearer ${token}" --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"service":"LOW"}' "https://<server>/oml/api/r-scripts/v1/jobs/ce91e852-8e91-46da-b26c-6314d9d9f267"
HTTP/1.1 200 OK Server: nginx/1.20.1 Date: Tue, 18 Feb 2025 17:03:50 GMT GMT Content-Type: application/json Content-Length: 139 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1;mode=block Content-Security-Policy: default-src 'none'; connect-src 'self'; font-src 'self' static.oracle.com; img-src 'self' data: static.oracle.com; media-src 'none'; object-src 'none'; script-src 'self' static.oracle.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' static.oracle.com 'unsafe-inline'; frame-ancestors 'none' {"Message":"Job ce91e852-8e91-46da-b26c-6314d9d9f267 sucessfully deleted container ending : LOW-1732561821973"}
- ジョブの2回目の削除: ジョブIDを再度削除しようとすると、ジョブにアクセスできないため削除は失敗します。
curl -i -k -X DELETE --header "Authorization: Bearer ${token}" --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"service":"LOW"}' "https://<server>/oml/api/r-scripts/v1/jobs/ce91e852-8e91-46da-b26c-6314d9d9f26"
HTTP/1.1 200 OK Date: Tue, 18 Feb 2025 17:04:20 GMT Content-Type: application/json Content-Length: 102 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1;mode=block Content-Security-Policy: default-src 'none'; connect-src 'self'; font-src 'self' static.oracle.com; img-src 'self' data: static.oracle.com; media-src 'none'; object-src 'none'; script-src 'self' static.oracle.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' static.oracle.com 'unsafe-inline'; frame-ancestors 'none' {"Message":"Job ce91e852-8e91-46da-b26c-6314d9d9f267 status is FAILURE and not applicable to delete" }