共有ルールセットを使用すると、複数の異なるコンピュータ間でルールを適用および管理できます。通常、次の手順を使用して共有ルールセットを作成します。
手順
- ルールセットの基にしたいコンピュータのために
SoftwareInventory
オブジェクトを作成および構成します。 SoftwareInventoryApi
オブジェクトを使用してWorkload Securityでソフトウェアインベントリを作成します。作成されると、指定されたコンピュータでインベントリのビルドが開始されます。SoftwareInventoryApi
オブジェクトを使用して、インベントリのビルドが正常に完了したことを確認します。Ruleset
オブジェクトを作成します。RulesetApi
オブジェクトを使用して、Workload Securityでルールセットを作成します。ComputerApi
オブジェクトまたはPolicyApi
オブジェクトを使用して、共有ルールセットをコンピュータに割り当てます。
次に進む前に
共有ルールセットの詳細については、APIを使用して共有およびグローバルルールセットを作成するを参照してください。
次の例では、ソフトウェアインベントリを作成し、そのソフトウェアインベントリを使用して共有ルールセットを作成します。
software_inventory = api.SoftwareInventory() software_inventory.computer_id = computer_id # Build software_inventory software_inventories_api = api.SoftwareInventoriesApi(api.ApiClient(configuration)) new_inventory = software_inventories_api.create_software_inventory(software_inventory, api_version) while new_inventory.state != "complete": # check status every 30 seconds time.sleep(30) new_inventory = software_inventories_api.describe_software_inventory(new_inventory.id, api_version) # Create ruleset ruleset = api.Ruleset() ruleset.name = ruleset_name rulesets_api = api.RulesetsApi(api.ApiClient(configuration)) return rulesets_api.create_ruleset(ruleset, new_inventory.id, api_version)
APIレファレンスの共有ルールセットの作成操作も参照してください。