Creating an update-compliance policy
Use this definition to create an update-compliance policy.
A job is created to complete this request.
Usage
resource "lxco_firmware" "createPolicy" {
policy_action = "createPolicy"
name = string
description = string
compliance_rule = string
rules {
platformidentifier = string
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
}
}
output "createPolicy" {
value = lxco_firmware.createPolicy
}
Example
The following example creates a policy.
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}
provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}
# Create a firmware-compliance policy, and return the results
resource "lxco_firmware" "createPolicy" {
policy_action = "createPolicy"
name = "TestPolicy05"
description = "TestPolicy05"
compliance_rule = "FlagIfNotExactMatch"
rules {
platformidentifier = "lxca"
criteria {
targetcomponentid = "LXPM-7X04"
targetupdatepackageid = "lnvgy_fw_lxpm_pdl132e-2.03_anyos_noarch"
}
criteria {
targetcomponentid = "UEFI-7X04"
targetupdatepackageid = "lnvgy_fw_uefi_tee168j-2.91_anyos_32-64"
}
criteria {
targetcomponentid = "XCC-7X04"
targetupdatepackageid = "lnvgy_fw_xcc_cdi376s-6.60_anyos_noarch"
}
}
}
output "createPolicy" {
value = lxco_firmware.createPolicy
}
Inputs
Name | Required / Optional | Type | Description | ||
---|---|---|---|---|---|
name | Required | String | Policy name | ||
description | Required | String | Policy description | ||
compliance_rule | Required | String | Indicates when to flag a resource as non-compliant. This can be one of the following values.
| ||
rules | Required | String | Information about each rule for this policy | ||
platformidentifier | Required | String | ID of the platform (resource type) that is associated with the target component | ||
criteria | Required | String | Information about the target component and update for this policy You can specify one or more criteria objects, one for each target component. Tip: If the platform does not have components, specify the platform ID. | ||
targetcomponentid | Required | String | Target component ID | ||
targetupdatepackageid | Required | String | Target update package ID |
Outputs
Name | Type | Description | ||
---|---|---|---|---|
id | String | Job ID | ||
status | String | Message about the status of the action |
The following example is returned if the request is successful.
{
"id": "125",
"status": "The job was created successfully. The job was launched in the
orchestrator server and will be run asynchronously. Job ID: 125"
}
Give documentation feedback