10.4. Satellite API を使用したレポートテンプレートのエクスポート
Satellite report_templates API を使用して、Satellite からレポートテンプレートをエクスポートできます。Satellite API の使用に関する詳細は、API ガイド を参照してください。
手順
以下のリクエストを使用して、使用可能なレポートテンプレートのリストを取得します。
要求例:
curl --insecure --user admin:redhat \ --request GET \ --config https://satellite.example.com/api/report_templates \ | json_reformat
$ curl --insecure --user admin:redhat \ --request GET \ --config https://satellite.example.com/api/report_templates \ | json_reformatCopy to Clipboard Copied! Toggle word wrap Toggle overflow この例では、
json_reformatツールを使用して JSON 出力をフォーマットしています。応答例:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow エクスポートするテンプレートの
idをメモし、以下のリクエストを使用してテンプレートをエクスポートします。要求例:
curl --insecure --output /tmp/_Example_Export_Template.erb_ \ --user admin:password --request GET --config \ https://satellite.example.com/api/report_templates/My_Template_ID/export
$ curl --insecure --output /tmp/_Example_Export_Template.erb_ \ --user admin:password --request GET --config \ https://satellite.example.com/api/report_templates/My_Template_ID/exportCopy to Clipboard Copied! Toggle word wrap Toggle overflow 158は、エクスポートするテンプレートの ID の例である点にご留意ください。この例では、エクスポートされたテンプレートは、
host_complete_list.erbにリダイレクトされます。