両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン |
ja:documentation:08_technical_reference:02_annex_externalapi [2022/11/25 22:27] – [get tags] junichi | ja:documentation:08_technical_reference:02_annex_externalapi [2023/01/31 05:26] – [API チェッカー] junichi |
---|
| |
==== API チェッカー ==== | ==== API チェッカー ==== |
| |
| Access from the Administration menu: **Admin tools** → **API checker**. |
| |
| 管理メニューの **管理ツール(Admin tools)** → **API チェッカー(API checker)** からアクセスします。 |
| |
{{ :wiki:pfms-admin_tools-api_checker.png }} | {{ :wiki:pfms-admin_tools-api_checker.png }} |
| |
{{ :wiki:pfms-admin_tools-api_checker-credentials.png }} | {{ :wiki:pfms-admin_tools-api_checker-credentials.png }} |
| |
| <WRAP center round info 60%> |
| |
| **Version 768 or later**: You can authenticate with **API Token** by sending in the [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP headers]] a [[https://www.rfc-editor.org/rfc/rfc6750#page-3|bearer token]] generated by each user and for their own private and particular use. See "[[:en:documentation:04_using:11_managing_and_administration#user_edition_by_the_user_itself|Edit my user]]" for more details. |
| |
| </WRAP>\\ |
| |
| <WRAP center round info 60%> |
| |
| **バージョン 768 以降**: [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP ヘッダー] で各ユーザによって個別に生成され [[https://www.rfc-editor.org/rfc/rfc6750#page-3|無記名トークン]] を送信することにより、**API トークン** で認証することができます。 |
| |
| </WRAP> |
| |
{{ :wiki:pfms-admin_tools-api_checker-call_parameters.png }} | {{ :wiki:pfms-admin_tools-api_checker-call_parameters.png }} |
| |
{{ :wiki:pfms-admin_tools-api_checker-custom_url.png }} | {{ :wiki:pfms-admin_tools-api_checker-custom_url.png }} |
| |
| |
==== セキュリティ処理の流れ ==== | ==== セキュリティ処理の流れ ==== |
=== get tags === | === get tags === |
| |
書式: | [[:en:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_external_api|Call syntax]]: |
| |
| [[:ja:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_外部_api|書式]]: |
| |
* ''op=get'' (required) | * ''op=get'' (required) |
* ''other=''< field separator > if you request in CSV format you must specify separator, otherwise it will return the fields together. | * ''other=''< field separator > if you request in CSV format you must specify separator, otherwise it will return the fields together. |
| |
* op=get (必須) | * ''op=get'' (必須) |
* op2=tags (必須) | * ''op2=tags'' (必須) |
* return_type=csv (必須) | * ''return_type=csv'' または、''return_type=json'' (必須) |
| * ''other=''< フィールドセパレータ > CSV フォーマットを指定した場合はフィールドセパレータは必須です。指定しないと各フィールドが一緒に返されます。 |
| |
**例** | Example (see [[:en:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_external_api|call syntax]]): |
| |
この例では、システムの全てのタグを返します。 | **例** ([[:ja:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_外部_api|書式]]を参照): |
| |
<code> | This example will return all tags in the system in CSV format with semicolon separator. |
http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv | |
| この例では、システムの全てのタグをセミコロンで区切った CSV フォーマットで返します。 |
| |
| <code bash> |
| …/include/api.php?op=get&op2=tags&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora |
| |
</code> | </code> |
モジュールを削除します。 | モジュールを削除します。 |
| |
書式: | <WRAP center round info 75%> |
| |
* op=set (必須) | From version 768 onwards, if the module to be deleted (e.g. //[[:en:documentation:03_monitoring:03_remote_monitoring#example_of_host_alive_module_creation|Host Alive]]// ) is the //parent// of another module ("[[:en:documentation:03_monitoring:01_intro_monitoring#advanced_options|Cascading Protection Services]]" functionality), the //child// modules will also be deleted. |
* op2=delete_module (必須) | |
* id=<エージェント名> (必須) | |
* id2=<モジュール名> (必須) | |
* other=simulate (オプション) | |
* <エージェントの別名の利用> (値は 0 または 1 です) | |
| |
**例** | </WRAP> |
<code> | |
| |
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&other=simulate | <WRAP center round info 75%> |
| |
</code> | バージョン 768 以降、削除するモジュール (例: //[[:ja:documentation:03_monitoring:03_remote_monitoring#host_alive_モジュール作成の例|Host Alive]]// ) が別のモジュールの //親// ("[[:ja:documentation:03_monitoring:01_intro_monitoring#高度なオプション|関連障害検知抑制]]" が有効)である場合、 //子// モジュールも削除されます。 |
| |
| </WRAP> |
| |
| [[:en:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_external_api|Call syntax]]: |
| |
| [[:ja:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_外部_api|書式]]: |
| |
| * ''op=set'' (required). |
| * ''op2=delete_module'' (obligatorio) |
| * ''id=''< agent name > (obligatorio). |
| * ''id2=''< module name > (obligatorio). |
| |
| * ''op=set'' (必須) |
| * ''op2=delete_module'' (必須) |
| * ''id=''<エージェント名> (必須) |
| * ''id2=''<モジュール名> (必須) |
| |
| **Example (see ** [[:en:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_external_api|call syntax]]**):** |
| |
| **例 (**[[:ja:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_外部_api|書式]]**を参照):** |
| |
| <code bash> |
| .../include/api.php?op=set&op2=delete_module&id=example&id2=example2&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_| |
| |
<code> | |
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito | |
| |
</code> | </code> |