{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"非同期操作"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"非同期操作","__idx":0},"children":["非同期操作"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["一部の MoreLogin 操作は、基盤となるブラウザー、クラウドフォン、ファイル、アプリ、または RPA の実行が最終状態に達する前に処理を受け付けます。送信成功のレスポンスはリクエストが受理されたことを意味し、要求した状態にすでに到達したことを常に意味するわけではありません。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クライアントの状態モデル","__idx":1},"children":["クライアントの状態モデル"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"状態"},"children":["状態"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"意味"},"children":["意味"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"クライアントの対応"},"children":["クライアントの対応"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["送信済み"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API がコマンドを受理、またはタスクを作成した"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["返された ID と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}," を保存する。同じ書き込みをすぐに再送しない"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["待機中または実行中"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["下流の処理がまだ進行している"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["文書化された状態/結果エンドポイントを間隔を広げながらポーリングする"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["成功"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["対象のリソースまたはタスクが成功の終了状態に達した"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ポーリングを止めて次の処理に進む"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["失敗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["状態/結果エンドポイントが失敗または終了状態のビジネスエラーを報告した"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["自動リトライを停止し、ID、失敗内容、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}," を保持する"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["結果不明"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["書き込みがタイムアウトした、または使用可能なレスポンスなしに接続が閉じた"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["再試行するかを判断する前に、リソース/タスクの現在状態を照会する"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ポーリングの原則","__idx":2},"children":["ポーリングの原則"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["約 1 秒から始め、2、4、8 秒と間隔を広げ、上限は 15〜30 秒とします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ジッターを加え、複数のクライアントが同時にポーリングしないようにします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["文書化された終了状態に達したら停止し、無期限にポーリングしないでください。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: null"]}," を待機中と解釈するのは、そのエンドポイントが明示的にそう記載している場合のみです。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["書き込みの通信タイムアウトは失敗の証拠にはなりません。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"文書化されたワークフロー","__idx":3},"children":["文書化されたワークフロー"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"ワークフロー"},"children":["ワークフロー"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"送信する操作"},"children":["送信する操作"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"観測する操作"},"children":["観測する操作"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"終了状態"},"children":["終了状態"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クラウドブラウザーの開始/停止"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudbrowser/start"]}," または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudbrowser/stop"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudbrowser/page"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ランタイムが目的の状態になる、または停止後に消える"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クラウドフォンの電源"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/powerOn"]}," または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudphone/powerOff"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/page"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["envStatus=4"]}," は起動済み、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["envStatus=2"]}," は停止済み。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," は作成失敗"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クラウドフォンのファイルアップロード"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["署名付き URL にアップロードし、その後 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFile"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFileResult"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=1"]}," は成功、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=2"]}," は失敗。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: null"]}," と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=0"]}," は待機中"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クラウドフォンのダウンロード"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/download"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/download/result"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=20"]}," 成功、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["30"]}," 失敗、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40"]}," キャンセル。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10"]}," は実行中"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["アプリのインストール"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/app/install"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/app/installedList"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["対象パッケージがインストール済みアプリ一覧に現れる"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RPA のスケジュール/実行"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/rpa/task/save"]}," または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/onceTask/save"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/rpa/task/page"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/subTask/page"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/subTask/detail/{id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["taskState=2"]}," 完了または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}," キャンセル。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["handleResult"]}," を確認（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," 失敗、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," 成功）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ライブ配信"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/live/start"]}," または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/live/end"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/live/status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["配信の開始または停止が状態で確認できる"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クラウドストレージのアップロード"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudstorage/upload/init"]}," の後にオブジェクトストアへ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["必要な PUT がすべて成功した後に ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudstorage/upload/complete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["完了リクエストが成功する。オブジェクトのアップロード成功前に complete を呼ばないこと"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Local API の対応する操作は、文書化されている箇所で ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api"]}," プレフィックスを使います。操作ごとの指針は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/api-reference/getting-started/endpoint-behavior"},"children":["エンドポイントの再試行と完了マトリクス"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"タイムアウト復旧の例","__idx":4},"children":["タイムアウト復旧の例"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"try:\n    submit_operation()\nexcept TimeoutError:\n    # The write may already have succeeded.\n    current = query_current_state()\n    if current.is_terminal_success:\n        pass\n    elif current.is_pending:\n        poll_until_terminal()\n    else:\n        decide_whether_retry_is_safe(current)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["公開 API には現在、汎用の冪等キーヘッダーは定義されていません。したがってリソース ID、タスク ID、状態照会、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}," が安全な復旧に不可欠です。"]}]},"headings":[{"value":"非同期操作","id":"非同期操作","depth":1},{"value":"クライアントの状態モデル","id":"クライアントの状態モデル","depth":2},{"value":"ポーリングの原則","id":"ポーリングの原則","depth":2},{"value":"文書化されたワークフロー","id":"文書化されたワークフロー","depth":2},{"value":"タイムアウト復旧の例","id":"タイムアウト復旧の例","depth":2}],"frontmatter":{"seo":{"title":"非同期操作"}},"lastModified":"2026-09-03T05:46:01.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/api-reference/getting-started/async-operations","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}