12.6. デバッグ補助
12.6.1. 一般情報
モジュール名 | debug |
APIバージョン | 2 |
12.6.2. エラーシミュレーション
エラーシミュレーション関連の WebAPI のパラメーターおよびレスポンスに含まれる API 名は、 ライブラリ内部で使用する名前となるため、アプリケーションから呼び出す API とは異なります。 ライブラリ内部で使用する API とアプリケーションから呼び出す API の対応については 「 10.4. API名対応表 」を参照してください。
12.6.2.1. 登録済みのエラーシミュレーション設定の取得
登録済みのエラーシミュレーションの設定を取得します。
エラーシミュレーションの設定の有効期限が切れている場合は、ゲームサーバー上から そのシミュレーションの設定は削除されているため、本 WebAPI の結果には含まれません。
-
GET
/nex/debug/v2/simulations/
(principal_id)/
(rmc_name) 指定されたプリンシパル ID 、API に対して登録されたエラーシミュレーションの設定を取得します。
パラメーター:
名前 内容 principal_ id プリンシパル ID。 必須 rmc_ name ライブラリ内部の API 名。 必須 リクエスト例:
GET /nex/debug/v2/simulations/1001/DataStoreProtocol%3A%3ASearchObject HTTP/1.1
レスポンスボディ:
要素名 親要素 内容 simulations ルート要素。 simulation simulations エラーシミュレーションの設定。 rmc_ name simulation ライブラリ内部の API 名。 count simulation エラーシミュレーションの設定の残り適用回数。 exec_ order simulation エラーシミュレーションの設定の適用順。同じ API に対して複数のシミュレーションの設定が登録されている場合は、適用順の小さいものから適用される。 return_ code simulation リターンコード。 facility simulation ファシリティ。 error_ code simulation エラーコード名。 network_ error_ code simulation ネットワークエラーコード。 レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <simulations length="2"> <simulation> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <count>1</count> <exec_order>0</exec_order> <return_code>2154364932</return_code> <facility>DataStore</facility> <error_code>NotFound</error_code> <network_error_code>1204</network_error_code> </simulation> <simulation> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <count>2</count> <exec_order>1</exec_order> <return_code>2154364930</return_code> <facility>DataStore</facility> <error_code>InvalidArgument</error_code> <network_error_code>1202</network_error_code> </simulation> </simulations> </debug> </nex>
-
GET
/nex/debug/v2/simulations/
(principal_id) 指定されたプリンシパル ID に対して登録された全てのエラーシミュレーションの設定を取得します。
パラメーター:
名前 内容 principal_ id プリンシパル ID。 必須 リクエスト例:
GET /nex/debug/v2/simulations/1001 HTTP/1.1
レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <simulations length="3"> <simulation> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <count>1</count> <exec_order>0</exec_order> <return_code>2154364932</return_code> <facility>DataStore</facility> <error_code>NotFound</error_code> <network_error_code>1204</network_error_code> </simulation> <simulation> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <count>2</count> <exec_order>1</exec_order> <return_code>2154364930</return_code> <facility>DataStore</facility> <error_code>InvalidArgument</error_code> <network_error_code>1202</network_error_code> </simulation> <simulation> <rmc_name>MatchmakeExtensionProtocol::BrowseMatchmakeSession</rmc_name> <count>1</count> <exec_order>0</exec_order> <return_code>2147549194</return_code> <facility>Core</facility> <error_code>InvalidArgument</error_code> <network_error_code>111</network_error_code> </simulation> </simulations> </debug> </nex>
12.6.2.2. エラーシミュレーションの設定が登録されているプリンシパル ID の取得
エラーシミュレーションの設定が登録されているプリンシパル ID を取得します。
-
GET
/nex/debug/v2/simulation_pids
エラーシミュレーションの設定が登録されている全てのプリンシパル ID を取得します。
リクエスト例:
GET /nex/debug/v2/simulation_pids HTTP/1.1
レスポンスボディ:
要素名 親要素 内容 principal_ ids ルート要素。 principal_ id principal_ ids プリンシパル ID 。 レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <principal_ids length="2"> <principal_id>1001</principal_id> <principal_id>1002</principal_id> </principal_ids> </debug> </nex>
12.6.2.3. エラーシミュレーションの設定の登録
エラーシミュレーションの設定を登録します。
-
PUT
/nex/debug/v2/simulations
-
POST
/nex/debug/v2/simulations/put
リクエストボディ:
要素名 親要素 内容 change ルート要素。 必須 principal_ id change プリンシパル ID。 必須 rmc_ name change ライブラリ内部の API 名。 必須 timeout change エラーシミュレーションの設定の有効期限(秒数)。デフォルトは 1 時間。 param change シミュレーション設定の登録内容の親要素。複数指定可。 必須 return_ code param リターンコード。 facility param ファシリティ。facility を指定した際は success_ code か error_ code を指定する必要がある。 success_ code param サクセスコード名(“Success” など)。 error_ code param エラーコード名(“InvalidArgument” など)。 network_ error_ code param ネットワークエラーコード。 count param エラーシミュレーションの設定を適用する回数。子要素で設定。 必須 param を複数指定すると、API を呼び出した回数によってクライアントに返すエラーを変えることができます。
return_code, facility, network_error_code はいずれか 1 つのみを指定する必要があります。
return_code, facility, network_error_code のいずれも指定しなかった場合は、通常通り API が実行されます。 例えば、DataStoreClient::SearchObject() を実行した際に、1 回めの呼び出しでは QERROR(DataStore, InvalidArgument) の エラーを発生させ、2 回目の呼び出しでは通常どおり実行し、3 回目の呼び出しでは QERROR(DataStore, Unknown) のエラーを 発生させる、というように途中で通常の実行を挟んでエラーを発生させたい場合は、通常実行のところではエラーを 指定しないでエラーシミュレーションの設定を登録してください。
リクエスト例:
以下のシミュレーション設定の登録例では、プリンシパル ID が 1001 の端末が DataStoreClient::SearchObject() (ライブラリ内部の API 名は DataStoreProtocol::SearchObject() ) を呼び出した際、以下のようにエラーが返ります。
- 1 回目: リターンコード 2154364932 (QERROR(DataStore, NotFound) に相当) のエラーを返す。
- 2 回目: QERROR(DataStore, Unknown) のエラーを返す。
- 3 回目: ネットワークエラーコード 006-1201 (QERROR(DataStore, Unknown) に相当) のエラーを返す。
- 4 回目: ネットワークエラーコード 006-1202 (QERROR(DataStore, InvalidArgument) に相当) のエラーを返す。
PUT /nex/debug/v2/simulations/ HTTP/1.1 <change> <principal_id>1001</principal_id> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <param> <count>1</count> <return_code>2154364932</return_code> </param> <param> <count>1</count> <facility>DataStore</facility> <error_code>Unknown</error_code> </param> <param> <count>1</count> <network_error_code>006-1201</network_error_code> </param> <param> <count>1</count> <network_error_code>61202</network_error_code> </param> </change>
レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <nex> <debug> <simulations> <changed length="4"/> </simulations> </debug> </nex>
length は登録したエラーシミュレーションの設定の数。
12.6.2.4. エラーシミュレーションの設定の削除
登録済みのエラーシミュレーションの設定を削除します。
-
POST
/nex/debug/v2/simulations/delete
リクエストボディ:
要素名 親要素 内容 delete ルート要素。 必須 principal_ id delete プリンシパル ID。 必須 rmc_ name delete ライブラリ内部の API 名。 プリンシパル ID と API 名の両方を指定した場合は、対象のプリンシパル ID と API に 登録されたシミュレーション設定のみを削除します。
プリンシパル ID のみを指定した場合は、対象のプリンシパル ID に登録された シミュレーション設定すべてを削除します。
リクエスト例:
POST /nex/debug/v2/simulations/delete HTTP/1.1 <delete> <principal_id>1001</principal_id> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> </delete>
レスポンス例:
HTTP/1.1 200 OK
12.6.2.5. エラーシミュレーションの実行ログの取得
エラーシミュレーションの設定を適用した際のログを取得します。
実行ログの有効期限が切れている場合は、ゲームサーバー上から そのログはは削除されているため、本 WebAPI の結果には含まれません。
-
GET
/nex/debug/v2/simulation_logs/
(principal_id) 指定されたプリンシパル ID に適用されたエラーシミュレーションの実行ログを取得します。
パラメーター:
名前 内容 principal_ id プリンシパル ID。 必須 リクエスト例:
GET /nex/debug/v2/simulation_logs/1001 HTTP/1.1
レスポンスボディ:
要素名 親要素 内容 simulation_ logs ルート要素。 simulation_ log simulation_ logs エラーシミュレーションの設定の実行ログ。 rmc_ name simulation_ log ライブラリ内部の API 名。 return_ code simulation_ log クライアントに返したリターンコード。 datetime simulation_ log エラーシミュレーションの設定の適用日時 facility simulation_ log ファシリティ。 error_ code simulation_ log エラーコード名。 network_ error_ code simulation_ log ネットワークエラーコード。 レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <simulation_logs length="2"> <simulation_log> <rmc_name>MatchmakeExtensionProtocol::BrowseMatchmakeSession</rmc_name> <return_code>2147549194</return_code> <datetime>2015-01-09T12:24:03Z</datetime> <facility>Core</facility> <error_code>InvalidArgument</error_code> <network_error_code>1202</network_error_code> </simulation_log> <simulation_log> <rmc_name>DataStoreProtocol::SearchObject</rmc_name> <return_code>2154364932</return_code> <datetime>2015-01-09T12:24:03Z</datetime> <facility>DataStore</facility> <error_code>NotFound</error_code> <network_error_code>1204</network_error_code> </simulation_log> </simulation_logs> </debug> </nex>
12.6.2.6. エラーシミュレーションの実行ログが保存されているプリンシパル ID の取得
エラーシミュレーションの実行ログが保存されているプリンシパル ID を取得します。
-
GET
/nex/debug/v2/simulation_log_pids
エラーシミュレーションの実行ログが保存されている全てのプリンシパル ID を取得します。
リクエスト例:
GET /nex/debug/v2/simulation_log_pids HTTP/1.1
レスポンスボディ:
要素名 親要素 内容 principal_ ids ルート要素。 principal_ id principal_ ids プリンシパル ID 。 レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <principal_ids length="2"> <principal_id>1001</principal_id> <principal_id>1002</principal_id> </principal_ids> </debug> </nex>
12.6.2.7. リザルトコード関連の情報の取得
NEX の API が返すリザルトコード関連の情報を取得します。 リザルトコード関連の情報には以下が含まれます。
- ファシリティ
- サクセスコード名、エラーコード名
- リターンコード
- ネットワークエラーコードの下 4 桁
ただし以下のエラーについては本 WebAPI の結果には含まれません。
- SystemError が返るエラー
- ファシリティが DOCore のエラー
-
GET
/nex/debug/v2/result_codes
NEX の API が返すリザルトコード関連の情報を取得します。
リクエスト例:
GET /nex/debug/v2/result_codes HTTP/1.1
レスポンスボディ:
要素名 親要素 内容 result_ codes ルート要素。 result_ code result_ codes リザルトコード関連の情報。 network_ error_ code result_ code ネットワークエラーコード。 return_ code result_ code リターンコード。 facility result_ code ファシリティ。 success_ code result_ code サクセスコード名。 error_ code result_ code エラーコード名。 レスポンス例:
HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <nex> <debug> <result_codes length="203"> <result_code> <network_error_code>801</network_error_code> <error_code>NASAuthenticateError</error_code> <return_code>2154299393</return_code> <facility>Authentication</facility> </result_code> <result_code> <network_error_code>802</network_error_code> <error_code>TokenParseError</error_code> <return_code>2154299394</return_code> <facility>Authentication</facility> </result_code> (数が多いため省略) </result_codes> </debug> </nex>