8.6. Satellite API を使用したレポートテンプレートのインポート
Satellite API を使用して、レポートテンプレートを Satellite にインポートできます。Satellite API を使用してレポートテンプレートをインポートすると、レポートテンプレートのメタデータが自動的に解析され、組織とロケーションが割り当てられます。Satellite API の使用に関する詳細は、API Guide を参照してください。
前提条件
.erb構文を使用してテンプレートを作成するか、別の Satellite からテンプレートをエクスポートしておく。テンプレートの作成に関する詳細は、付録A テンプレート作成の参照を参照してください。
Satellite からのテンプレートのエクスポートに関する詳細は、「Satellite API を使用したレポートテンプレートのエクスポート」 を参照してください。
手順
以下の例を使用して、
.jsonファイルにインポートするテンプレートをフォーマットします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ERB テンプレートを含む JSON ファイルの例:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 以下のリクエストを使用して、テンプレートをインポートします。
curl --insecure --user admin:redhat \ --data @Example_Template.json --header "Content-Type:application/json" \ --request POST --config https://satellite.example.com/api/report_templates/import
$ curl --insecure --user admin:redhat \ --data @Example_Template.json --header "Content-Type:application/json" \ --request POST --config https://satellite.example.com/api/report_templates/importCopy to Clipboard Copied! Toggle word wrap Toggle overflow 以下のリクエストを使用して、レポートテンプレートの一覧を取得し、Satellite でテンプレートを表示できることを確認します。
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