Query information about the compliance policy with the specified ID.
/icc/compliancePolicy/{id}
Path parameters | |
---|---|
id | Compliance policy ID.
Long integer type. Required. No default value. |
HTTP/1.1 200 OK
<compliancePolicy> <id>27</id> <name>testPolicyName</name> <description>testPolicyName_Desc</description> <active>1</active> <type>1</type> <creator>admin</creator> <createTime>1507711262463</createTime> <checkRules> <id>226</id> <name>testPolicyName_rule1</name> <severityLevel>4</severityLevel> <checkType>0</checkType> <checkTarget>1</checkTarget> <vendor>All vendors</vendor> <deviceSeriesIds>500,501</deviceSeriesIds> <description>testPolicyName_rule1_desc</description> <recover>0</recover> <jythonName></jythonName> <jythonContent></jythonContent> <ruleType>0</ruleType> <ruleContents> <id>209</id> <matchModeSimple>1</matchModeSimple> <ruleRelation>2</ruleRelation> <matchPatterns>testPolicyName_rule1_ruleContent</matchPatterns> <matchModeAdvance>1</matchModeAdvance> <matchCriteria>0</matchCriteria> <comparisonType>0</comparisonType> <comparisonValue></comparisonValue> </ruleContents> <operation>0</operation> <type>1</type> <creator>admin</creator> <createTime>1507711262463</createTime> </checkRules> <checkRules> <id>227</id> <name>testPolicyName_rule2</name> <severityLevel>4</severityLevel> <checkType>7</checkType> <checkTarget>1</checkTarget> <vendor>All vendors</vendor> <deviceSeriesIds>218,219</deviceSeriesIds> <description>testPolicyName_rule2_desc</description> <recover>0</recover> <jythonName>1507711262641_Loop Protection Status.py</jythonName> <jythonContent>ZnJvbSBqYXZhLnV0aWwgaW1wb3J0ICoNCmZyb20gamF2YS5tYXRoIGltcG9ydCBCaWdJbnRlZ2VyDQpmcm9tIGNvbS5oM2MuaW1jLmJvb3RzdHJhcCBpbXBvcnQgU2VydmVyQ29udGV4dA0KZnJvbSBjb20uaDNjLmltYy5pY2MucmVnZXguZW50aXR5IGltcG9ydCBJY2NSdWxlQ2hlY2tSZXN1bHQNCmZyb20gY29tLmgzYy5pbWMuaWNjLnJlZ2V4LmZ1bmMgaW1wb3J0IEljY0p5dGhvbkNoZWNrDQoNCiMgaWZJbmZvIHR5cGUgPTEgIL3Tv9q21LbLyeixuM6qIFBDDQoNCmNoZWNrUmVzdWx0TWFwID0gSGFzaE1hcCgpDQpvaWQ9IjEuMy42LjEuNC4xLjExLjIuMTQuMTEuNS4xLjEyLjEuNS4yLjEuMS4xIg0KbWdyID0gU2VydmVyQ29udGV4dC5nZXRSb290QXBwQ29udGV4dCgpLmdldEJlYW4oImljY0p5dGhvbkNoZWNrIikNCmZvciBkZXZJZCBpbiBkZXZpY2VJZHM6DQoJIGljY1J1bGVDaGVja1Jlc3VsdCA9ICBtZ3IuZ2V0SWNjUnVsZUNoZWNrUmVzdWx0QnlJZkluZm8oZGV2SWQsb2lkKQ0KCSBjaGVja1Jlc3VsdE1hcC5wdXQoZGV2SWQsaWNjUnVsZUNoZWNrUmVzdWx0KQ0KDQoNCg==</jythonContent> <ruleType>0</ruleType> <operation>0</operation> <type>1</type> <creator>admin</creator> <createTime>1507711262640</createTime> </checkRules> </compliancePolicy>
compliancePolicy sub-elements | |
---|---|
id | Compliance policy ID.
Long integer type. Not needed for adding a compliance policy. |
name | Compliance policy name. String type. |
description | Compliance policy description. String type. |
active | Whether the compliance policy is enabled.
Integer type. 0: Disabled; 1: Enabled. |
type | Type.
Integer type. 0: System-defined. 1: User-defined. Not needed for adding a compliance policy. |
creator | Creator.
String type. Not needed for adding a compliance policy. |
createTime | Time when the compliance policy is created.
String type. Not needed for adding a compliance policy. |
checkRules | Check rule list.
A compliance policy can contain multiple checkRules elements. |
checkRules sub-elements | |
---|---|
id | Rule ID.
Long integer type. Not needed for adding a check rule. |
name | Rule name.
String type. |
severityLevel | Severity level.
Integer type. 4: Info; 5: Warning; 6: Minor; 7: Major; 8: Critical. |
checkType | Check type.
Integer type. 0: Device. 1: Interface; 2: Link; 3: Aggregate link; 6: Configuration segment; 7: Jython script. |
checkTarget | Check target.
Integer type. 1: Latest backup running configuration; 2: Latest backup startup configuration; 3: Display command output. |
vendor | Device vendor.
String type. ALL: All vendors. |
deviceSeriesIds | Device series ID list.
String type. A comma-separated device series ID list. |
description | Rule description. String type. |
recover | Whether to execute the recovery commands.
Integer type. 0: No. 1: Yes. |
jythonName | Jython script name. String type. |
jythonContent | Jython script content.
String type. The Jython script content is encoded by Base64. |
ruleType | Rule type.
Integer type. 0: Basic. 1: Advanced. |
operation | Operation.
Integer type. 0: Check. 1: Check and get. |
type | Type.
Integer type. 0: System-defined. 1: User-defined. Not needed for adding a check rule. |
creator | Creator.
String type. Not needed for adding a check rule. |
createTime | Time when the check rule is created.
String type. Not needed for adding a check rule. |
ruleContents | Check rule content.
A check rule can contain multiple ruleContents elements. |
ruleContents sub-elements | |
---|---|
id | Check rule content ID.
Long integer type. Not needed for adding a check rule content. |
matchModeSimple | Basic match mode.
Integer type. 1: Loose match; 2: Negative loose match; 3: Strict match; 4: Negative strict match. |
ruleRelation | Rule relationship.
Integer type. 0: And. 1: Or. |
matchPatterns | Match patterns.
String type. |
matchModeAdvance | Advanced match mode.
Integer type. 0: Excluded. 1: Included. |
matchCriteria | Match criteria.
Integer type. 0: Contain all; 1: Contain none of them; 2: Contain one of them; 3: Contain all but one. |
comparisonType | Comparison type.
Integer type. 0: All equal to; 1: All not equal to; 2: One of them equal to; 3: One of them not equal to; 4: All identical. |
comparisonValue | Value for comparison.
String type. Enter a string of 1 to 32 characters, which cannot include question marks (?) or spaces. |
Query information about the compliance policy with ID 27.
GET http://host:8080/imcrs/icc/compliancePolicy/27 accept: application/xml ...
HTTP/1.1 200 OK Content-Type: application/xml ... <compliancePolicy> <id>27</id> <name>testPolicyName</name> <description>testPolicyName_Desc</description> <active>1</active> <type>1</type> <creator>admin</creator> <createTime>1507711262463</createTime> <checkRules> <id>226</id> <name>testPolicyName_rule1</name> <severityLevel>4</severityLevel> <checkType>0</checkType> <checkTarget>1</checkTarget> <vendor>All vendors</vendor> <deviceSeriesIds>500,501</deviceSeriesIds> <description>testPolicyName_rule1_desc</description> <recover>0</recover> <jythonName></jythonName> <jythonContent></jythonContent> <ruleType>0</ruleType> <ruleContents> <id>209</id> <matchModeSimple>1</matchModeSimple> <ruleRelation>2</ruleRelation> <matchPatterns>testPolicyName_rule1_ruleContent</matchPatterns> <matchModeAdvance>1</matchModeAdvance> <matchCriteria>0</matchCriteria> <comparisonType>0</comparisonType> <comparisonValue></comparisonValue> </ruleContents> <operation>0</operation> <type>1</type> <creator>admin</creator> <createTime>1507711262463</createTime> </checkRules> <checkRules> <id>227</id> <name>testPolicyName_rule2</name> <severityLevel>4</severityLevel> <checkType>7</checkType> <checkTarget>1</checkTarget> <vendor>All vendors</vendor> <deviceSeriesIds>218,219</deviceSeriesIds> <description>testPolicyName_rule2_desc</description> <recover>0</recover> <jythonName>1507711262641_Loop Protection Status.py</jythonName> <jythonContent>ZnJvbSBqYXZhLnV0aWwgaW1wb3J0ICoNCmZyb20gamF2YS5tYXRoIGltcG9ydCBCaWdJbnRlZ2VyDQpmcm9tIGNvbS5oM2MuaW1jLmJvb3RzdHJhcCBpbXBvcnQgU2VydmVyQ29udGV4dA0KZnJvbSBjb20uaDNjLmltYy5pY2MucmVnZXguZW50aXR5IGltcG9ydCBJY2NSdWxlQ2hlY2tSZXN1bHQNCmZyb20gY29tLmgzYy5pbWMuaWNjLnJlZ2V4LmZ1bmMgaW1wb3J0IEljY0p5dGhvbkNoZWNrDQoNCiMgaWZJbmZvIHR5cGUgPTEgIL3Tv9q21LbLyeixuM6qIFBDDQoNCmNoZWNrUmVzdWx0TWFwID0gSGFzaE1hcCgpDQpvaWQ9IjEuMy42LjEuNC4xLjExLjIuMTQuMTEuNS4xLjEyLjEuNS4yLjEuMS4xIg0KbWdyID0gU2VydmVyQ29udGV4dC5nZXRSb290QXBwQ29udGV4dCgpLmdldEJlYW4oImljY0p5dGhvbkNoZWNrIikNCmZvciBkZXZJZCBpbiBkZXZpY2VJZHM6DQoJIGljY1J1bGVDaGVja1Jlc3VsdCA9ICBtZ3IuZ2V0SWNjUnVsZUNoZWNrUmVzdWx0QnlJZkluZm8oZGV2SWQsb2lkKQ0KCSBjaGVja1Jlc3VsdE1hcC5wdXQoZGV2SWQsaWNjUnVsZUNoZWNrUmVzdWx0KQ0KDQoNCg==</jythonContent> <ruleType>0</ruleType> <operation>0</operation> <type>1</type> <creator>admin</creator> <createTime>1507711262640</createTime> </checkRules> </compliancePolicy>