Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove internal enabled flag from API. Active flag is used from now on.

  • Loading branch information...
commit 4babc5689450ce5676745dfefaf8f8d2b54c9b86 1 parent 0bf5019
Ryan Morgan authored
View
4 hqu/hqapi1/app/AlertdefinitionController.groovy
@@ -55,7 +55,6 @@ public class AlertdefinitionController extends ApiController {
description: d.description,
priority: d.priority,
active: d.active,
- enabled: d.enabled,
frequency: d.frequencyType,
count: d.count,
range: d.range,
@@ -324,7 +323,7 @@ public class AlertdefinitionController extends ApiController {
// Required attributes, basically everything but description
['controlFiltered', 'notifyFiltered', 'willRecover', 'range', 'count',
- 'frequency', 'enabled', 'active', 'priority',
+ 'frequency', 'active', 'priority',
'name'].each { attr ->
if (xmlDef."@${attr}" == null) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
@@ -402,7 +401,6 @@ public class AlertdefinitionController extends ApiController {
adv.appdefType = aeid.type
adv.appdefId = aeid.id
adv.priority = xmlDef.'@priority'?.toInteger()
- adv.enabled = xmlDef.'@enabled'.toBoolean()
adv.active = xmlDef.'@active'.toBoolean()
adv.willRecover = xmlDef.'@willRecover'.toBoolean()
adv.notifyFiltered = xmlDef.'@notifyFiltered'?.toBoolean()
View
10 src/org/hyperic/hq/hqapi1/test/AlertDefinitionSync_test.java
@@ -252,13 +252,13 @@ public void testSyncControlFiltered() throws Exception {
cleanup(response.getAlertDefinition());
}
- public void testSyncEnable() throws Exception {
+ public void testSyncActive() throws Exception {
AlertDefinitionApi api = getApi().getAlertDefinitionApi();
Resource platform = getLocalPlatformResource(false, false);
AlertDefinition d = generateTestDefinition();
- d.setEnabled(false);
+ d.setActive(false);
d.setResource(platform);
d.getAlertCondition().add(AlertDefinitionBuilder.createPropertyCondition(true, "myProp"));
List<AlertDefinition> definitions = new ArrayList<AlertDefinition>();
@@ -270,9 +270,9 @@ public void testSyncEnable() throws Exception {
assertEquals(response.getAlertDefinition().size(), 1);
d = response.getAlertDefinition().get(0);
validateDefinition(d);
- assertTrue("Enabled is not false", !d.isEnabled());
+ assertTrue("Enabled is not false", !d.isActive());
- d.setEnabled(true);
+ d.setActive(true);
definitions.clear();
definitions.add(d);
response = api.syncAlertDefinitions(definitions);
@@ -281,7 +281,7 @@ public void testSyncEnable() throws Exception {
assertEquals(response.getAlertDefinition().size(), 1);
d = response.getAlertDefinition().get(0);
validateDefinition(d);
- assertTrue("Enabled is not true", d.isEnabled());
+ assertTrue("Enabled is not true", d.isActive());
// Cleanup
cleanup(response.getAlertDefinition());
View
2  src/org/hyperic/hq/hqapi1/test/AlertDefinitionTestBase.java
@@ -22,7 +22,7 @@ protected AlertDefinition generateTestDefinition() {
d.setName("Test Alert Definition" + r.nextInt());
d.setDescription("Test Alert Description");
d.setPriority(AlertPriority.MEDIUM.getPriority());
- d.setEnabled(true);
+ d.setActive(true);
return d;
}
View
1  xsd/AlertDefinition.xsd
@@ -51,7 +51,6 @@
<xs:attribute name="parent" type="xs:int" use="optional" />
<xs:attribute name="priority" type="xs:int" use="required" />
<xs:attribute name="active" type="xs:boolean" use="required" />
- <xs:attribute name="enabled" type="xs:boolean" use="required" />
<xs:attribute name="frequency" type="xs:int" use="required" />
<xs:attribute name="count" type="xs:int" use="required" />
<xs:attribute name="range" type="xs:int" use="required" />
Please sign in to comment.
Something went wrong with that request. Please try again.