Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@

import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* An alert action.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("Action")
@JsonSubTypes({
@JsonSubTypes.Type(name = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", value = AlertingAction.class)
})
public class Action {
/**
* the id of the action group to use.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.monitor;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for AlertSeverity.
*/
public final class AlertSeverity extends ExpandableStringEnum<AlertSeverity> {
/** Static value 0 for AlertSeverity. */
public static final AlertSeverity ZERO = fromString("0");

/** Static value 1 for AlertSeverity. */
public static final AlertSeverity ONE = fromString("1");

/** Static value 2 for AlertSeverity. */
public static final AlertSeverity TWO = fromString("2");

/** Static value 3 for AlertSeverity. */
public static final AlertSeverity THREE = fromString("3");

/** Static value 4 for AlertSeverity. */
public static final AlertSeverity FOUR = fromString("4");

/**
* Creates or finds a AlertSeverity from its string representation.
* @param name a name to look for
* @return the corresponding AlertSeverity
*/
@JsonCreator
public static AlertSeverity fromString(String name) {
return fromString(name, AlertSeverity.class);
}

/**
* @return known AlertSeverity values
*/
public static Collection<AlertSeverity> values() {
return values(AlertSeverity.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,34 @@

package com.microsoft.azure.management.monitor;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* An alert status.
* Defines values for AlertStatus.
*/
public class AlertStatus {
/**
* status value.
*/
@JsonProperty(value = "value")
private String value;
public final class AlertStatus extends ExpandableStringEnum<AlertStatus> {
/** Static value Active for AlertStatus. */
public static final AlertStatus ACTIVE = fromString("Active");

/**
* UTC time when the status was checked.
*/
@JsonProperty(value = "timestamp")
private String timestamp;
/** Static value Inactive for AlertStatus. */
public static final AlertStatus INACTIVE = fromString("Inactive");

/**
* Get the value value.
*
* @return the value value
* Creates or finds a AlertStatus from its string representation.
* @param name a name to look for
* @return the corresponding AlertStatus
*/
public String value() {
return this.value;
@JsonCreator
public static AlertStatus fromString(String name) {
return fromString(name, AlertStatus.class);
}

/**
* Set the value value.
*
* @param value the value value to set
* @return the AlertStatus object itself.
* @return known AlertStatus values
*/
public AlertStatus withValue(String value) {
this.value = value;
return this;
public static Collection<AlertStatus> values() {
return values(AlertStatus.class);
}

/**
* Get the timestamp value.
*
* @return the timestamp value
*/
public String timestamp() {
return this.timestamp;
}

/**
* Set the timestamp value.
*
* @param timestamp the timestamp value to set
* @return the AlertStatus object itself.
*/
public AlertStatus withTimestamp(String timestamp) {
this.timestamp = timestamp;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.monitor;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* Specifiy action need to be taken when rule type is Alert.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction")
public class AlertingAction extends Action {
/**
* Severity of the alert. Possible values include: '0', '1', '2', '3', '4'.
*/
@JsonProperty(value = "severity", required = true)
private AlertSeverity severity;

/**
* azns notification group reference.
*/
@JsonProperty(value = "aznsAction", required = true)
private AzNsActionGroup aznsAction;

/**
* time (in minutes) for which Alerts should be throttled.
*/
@JsonProperty(value = "throttlingInMin")
private Integer throttlingInMin;

/**
* The trigger condition that results in the alert rule being.
*/
@JsonProperty(value = "trigger", required = true)
private TriggerCondition trigger;

/**
* Get the severity value.
*
* @return the severity value
*/
public AlertSeverity severity() {
return this.severity;
}

/**
* Set the severity value.
*
* @param severity the severity value to set
* @return the AlertingAction object itself.
*/
public AlertingAction withSeverity(AlertSeverity severity) {
this.severity = severity;
return this;
}

/**
* Get the aznsAction value.
*
* @return the aznsAction value
*/
public AzNsActionGroup aznsAction() {
return this.aznsAction;
}

/**
* Set the aznsAction value.
*
* @param aznsAction the aznsAction value to set
* @return the AlertingAction object itself.
*/
public AlertingAction withAznsAction(AzNsActionGroup aznsAction) {
this.aznsAction = aznsAction;
return this;
}

/**
* Get the throttlingInMin value.
*
* @return the throttlingInMin value
*/
public Integer throttlingInMin() {
return this.throttlingInMin;
}

/**
* Set the throttlingInMin value.
*
* @param throttlingInMin the throttlingInMin value to set
* @return the AlertingAction object itself.
*/
public AlertingAction withThrottlingInMin(Integer throttlingInMin) {
this.throttlingInMin = throttlingInMin;
return this;
}

/**
* Get the trigger value.
*
* @return the trigger value
*/
public TriggerCondition trigger() {
return this.trigger;
}

/**
* Set the trigger value.
*
* @param trigger the trigger value to set
* @return the AlertingAction object itself.
*/
public AlertingAction withTrigger(TriggerCondition trigger) {
this.trigger = trigger;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.monitor;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* azns notification group.
*/
public class AzNsActionGroup {
/**
* Azure Group reference.
*/
@JsonProperty(value = "actionGroup")
private List<String> actionGroup;

/**
* Custom subject for Azns email.
*/
@JsonProperty(value = "emailSubject")
private String emailSubject;

/**
* Custom webhook payload to be send to azns action group.
*/
@JsonProperty(value = "customWebhookPayload")
private String customWebhookPayload;

/**
* Get the actionGroup value.
*
* @return the actionGroup value
*/
public List<String> actionGroup() {
return this.actionGroup;
}

/**
* Set the actionGroup value.
*
* @param actionGroup the actionGroup value to set
* @return the AzNsActionGroup object itself.
*/
public AzNsActionGroup withActionGroup(List<String> actionGroup) {
this.actionGroup = actionGroup;
return this;
}

/**
* Get the emailSubject value.
*
* @return the emailSubject value
*/
public String emailSubject() {
return this.emailSubject;
}

/**
* Set the emailSubject value.
*
* @param emailSubject the emailSubject value to set
* @return the AzNsActionGroup object itself.
*/
public AzNsActionGroup withEmailSubject(String emailSubject) {
this.emailSubject = emailSubject;
return this;
}

/**
* Get the customWebhookPayload value.
*
* @return the customWebhookPayload value
*/
public String customWebhookPayload() {
return this.customWebhookPayload;
}

/**
* Set the customWebhookPayload value.
*
* @param customWebhookPayload the customWebhookPayload value to set
* @return the AzNsActionGroup object itself.
*/
public AzNsActionGroup withCustomWebhookPayload(String customWebhookPayload) {
this.customWebhookPayload = customWebhookPayload;
return this;
}

}
Loading