8.4. Satellite API を使用したレポートテンプレートのエクスポート
Satellite report_templates
API を使用して、Satellite からレポートテンプレートをエクスポートできます。Satellite API の使用に関する詳細は、API Guide を参照してください。
手順
以下のリクエストを使用して、使用可能なレポートテンプレートの一覧を取得します。
要求例:
$ curl --insecure --user admin:redhat \ --request GET \ --config https://satellite.example.com/api/report_templates \ | json_reformat
この例では、
json_reformat
ツールを使用して JSON 出力をフォーマットしています。応答例:
{ "total": 6, "subtotal": 6, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [ { "created_at": "2019-11-20 17:49:52 UTC", "updated_at": "2019-11-20 17:49:52 UTC", "name": "Applicable errata", "id": 112 }, { "created_at": "2019-11-20 17:49:52 UTC", "updated_at": "2019-11-20 17:49:52 UTC", "name": "Applied Errata", "id": 113 }, { "created_at": "2019-11-30 16:15:24 UTC", "updated_at": "2019-11-30 16:15:24 UTC", "name": "Hosts - complete list", "id": 158 }, { "created_at": "2019-11-20 17:49:52 UTC", "updated_at": "2019-11-20 17:49:52 UTC", "name": "Host statuses", "id": 114 }, { "created_at": "2019-11-20 17:49:52 UTC", "updated_at": "2019-11-20 17:49:52 UTC", "name": "Registered hosts", "id": 115 }, { "created_at": "2019-11-20 17:49:52 UTC", "updated_at": "2019-11-20 17:49:52 UTC", "name": "Subscriptions", "id": 116 } ] }
エクスポートするテンプレートの
id
をメモし、以下のリクエストを使用してテンプレートをエクスポートします。要求例:
$ curl --insecure --output /tmp/_Example_Export_Template.erb_ \ --user admin:password --request GET --config \ https://satellite.example.com/api/report_templates/158/export
158
は、エクスポートするテンプレートの ID の例である点にご留意ください。この例では、エクスポートされたテンプレートは、
host_complete_list.erb
にリダイレクトされます。