8.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_reformat
Copy 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/158/export
$ curl --insecure --output /tmp/_Example_Export_Template.erb_ \ --user admin:password --request GET --config \ https://satellite.example.com/api/report_templates/158/export
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 请注意,
158
是要导出的模板的示例 ID。在本例中,导出的模板被重定向到
host_complete_list.erb
。