Skip to content

Commit

Permalink
Regenerate client from commit 57b75ade of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Aug 17, 2022
1 parent 23773af commit 0266432
Show file tree
Hide file tree
Showing 41 changed files with 459 additions and 115 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-08-17 14:32:13.203861",
"spec_repo_commit": "a957cd49"
"regenerated": "2022-08-17 17:26:24.674756",
"spec_repo_commit": "57b75ade"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-08-17 14:32:13.215885",
"spec_repo_commit": "a957cd49"
"regenerated": "2022-08-17 17:26:24.687659",
"spec_repo_commit": "57b75ade"
}
}
}
39 changes: 39 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6133,6 +6133,17 @@ components:
format: int64
nullable: true
type: integer
group_retention_duration:
description: 'The time span after which groups with missing data are dropped
from the monitor state.

The minimum value is one hour, and the maximum value is 72 hours.

Example values are: "60m", "1h", and "2d".

This option is only available for APM Trace Analytics, Audit Trail, CI,
Error Tracking, Event, Logs, and RUM monitors.'
type: string
groupby_simple_monitor:
description: Whether the log alert monitor triggers a single alert or multiple
alerts when any group breaches a threshold.
Expand Down Expand Up @@ -6223,6 +6234,8 @@ components:
description: A Boolean indicating whether this monitor notifies when data
stops reporting.
type: boolean
on_missing_data:
$ref: '#/components/schemas/OnMissingDataOption'
renotify_interval:
default: null
description: "The number of minutes after the last notification before a
Expand Down Expand Up @@ -7928,6 +7941,32 @@ components:
format: int64
type: integer
type: object
OnMissingDataOption:
description: 'Controls how groups or monitors are treated if an evaluation does
not return any data points.

The default option results in different behavior depending on the monitor
query type.

For monitors using Count queries, an empty monitor evaluation is treated as
0 and is compared to the threshold conditions.

For monitor using any query type other than Count, for example Gauge or Rate,
the monitor shows the last known status.

This option is only available for APM Trace Analytics, Audit Trail, CI, Error
Tracking, Event, Logs, and RUM monitors.'
enum:
- default
- show_no_data
- show_and_notify_no_data
- resolve
type: string
x-enum-varnames:
- DEFAULT
- SHOW_NO_DATA
- SHOW_AND_NOTIFY_NO_DATA
- RESOLVE
OrgDowngradedResponse:
description: Status of downgrade
properties:
Expand Down
2 changes: 2 additions & 0 deletions examples/v1/monitors/ValidateExistingMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.datadog.api.client.v1.model.MonitorOptions;
import com.datadog.api.client.v1.model.MonitorThresholds;
import com.datadog.api.client.v1.model.MonitorType;
import com.datadog.api.client.v1.model.OnMissingDataOption;
import java.util.Arrays;

public class Example {
Expand Down Expand Up @@ -40,6 +41,7 @@ public static void main(String[] args) {
.noDataTimeframe(null)
.notifyAudit(false)
.notifyNoData(false)
.onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA)
.renotifyInterval(60L)
.requireFullWindow(true)
.timeoutH(24L)
Expand Down
2 changes: 2 additions & 0 deletions examples/v1/monitors/ValidateMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.datadog.api.client.v1.model.MonitorOptions;
import com.datadog.api.client.v1.model.MonitorThresholds;
import com.datadog.api.client.v1.model.MonitorType;
import com.datadog.api.client.v1.model.OnMissingDataOption;
import java.util.Arrays;

public class Example {
Expand Down Expand Up @@ -37,6 +38,7 @@ public static void main(String[] args) {
.noDataTimeframe(null)
.notifyAudit(false)
.notifyNoData(false)
.onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA)
.renotifyInterval(60L)
.requireFullWindow(true)
.timeoutH(24L)
Expand Down
59 changes: 59 additions & 0 deletions examples/v1/monitors/ValidateMonitor_4247196452.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Validate a multi-alert monitor returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.MonitorsApi;
import com.datadog.api.client.v1.model.Monitor;
import com.datadog.api.client.v1.model.MonitorOptions;
import com.datadog.api.client.v1.model.MonitorThresholds;
import com.datadog.api.client.v1.model.MonitorType;
import com.datadog.api.client.v1.model.OnMissingDataOption;
import java.util.Arrays;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
MonitorsApi apiInstance = new MonitorsApi(defaultClient);

Monitor body =
new Monitor()
.name("Example-Validate_a_multi_alert_monitor_returns_OK_response")
.type(MonitorType.LOG_ALERT)
.query(
"""
logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2
""")
.message("some message Notify: @hipchat-channel")
.tags(
Arrays.asList("test:examplevalidateamultialertmonitorreturnsokresponse", "env:ci"))
.priority(3L)
.options(
new MonitorOptions()
.enableLogsSample(true)
.escalationMessage("the situation has escalated")
.evaluationDelay(700L)
.groupRetentionDuration("2d")
.groupbySimpleMonitor(false)
.includeTags(true)
.locked(false)
.newHostDelay(600L)
.noDataTimeframe(null)
.notifyAudit(false)
.notifyNoData(false)
.onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA)
.renotifyInterval(60L)
.requireFullWindow(true)
.timeoutH(24L)
.thresholds(new MonitorThresholds().critical(2.0).warning(1.0)));

try {
apiInstance.validateMonitor(body);
} catch (ApiException e) {
System.err.println("Exception when calling MonitorsApi#validateMonitor");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
70 changes: 70 additions & 0 deletions src/main/java/com/datadog/api/client/v1/model/MonitorOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
MonitorOptions.JSON_PROPERTY_ENABLE_LOGS_SAMPLE,
MonitorOptions.JSON_PROPERTY_ESCALATION_MESSAGE,
MonitorOptions.JSON_PROPERTY_EVALUATION_DELAY,
MonitorOptions.JSON_PROPERTY_GROUP_RETENTION_DURATION,
MonitorOptions.JSON_PROPERTY_GROUPBY_SIMPLE_MONITOR,
MonitorOptions.JSON_PROPERTY_INCLUDE_TAGS,
MonitorOptions.JSON_PROPERTY_LOCKED,
Expand All @@ -34,6 +35,7 @@
MonitorOptions.JSON_PROPERTY_NO_DATA_TIMEFRAME,
MonitorOptions.JSON_PROPERTY_NOTIFY_AUDIT,
MonitorOptions.JSON_PROPERTY_NOTIFY_NO_DATA,
MonitorOptions.JSON_PROPERTY_ON_MISSING_DATA,
MonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL,
MonitorOptions.JSON_PROPERTY_RENOTIFY_OCCURRENCES,
MonitorOptions.JSON_PROPERTY_RENOTIFY_STATUSES,
Expand Down Expand Up @@ -64,6 +66,9 @@ public class MonitorOptions {
public static final String JSON_PROPERTY_EVALUATION_DELAY = "evaluation_delay";
private JsonNullable<Long> evaluationDelay = JsonNullable.<Long>undefined();

public static final String JSON_PROPERTY_GROUP_RETENTION_DURATION = "group_retention_duration";
private String groupRetentionDuration;

public static final String JSON_PROPERTY_GROUPBY_SIMPLE_MONITOR = "groupby_simple_monitor";
private Boolean groupbySimpleMonitor;

Expand Down Expand Up @@ -94,6 +99,9 @@ public class MonitorOptions {
public static final String JSON_PROPERTY_NOTIFY_NO_DATA = "notify_no_data";
private Boolean notifyNoData = false;

public static final String JSON_PROPERTY_ON_MISSING_DATA = "on_missing_data";
private OnMissingDataOption onMissingData;

public static final String JSON_PROPERTY_RENOTIFY_INTERVAL = "renotify_interval";
private JsonNullable<Long> renotifyInterval = JsonNullable.<Long>undefined();

Expand Down Expand Up @@ -231,6 +239,30 @@ public void setEvaluationDelay(Long evaluationDelay) {
this.evaluationDelay = JsonNullable.<Long>of(evaluationDelay);
}

public MonitorOptions groupRetentionDuration(String groupRetentionDuration) {
this.groupRetentionDuration = groupRetentionDuration;
return this;
}

/**
* The time span after which groups with missing data are dropped from the monitor state. The
* minimum value is one hour, and the maximum value is 72 hours. Example values are: "60m", "1h",
* and "2d". This option is only available for APM Trace Analytics, Audit Trail, CI, Error
* Tracking, Event, Logs, and RUM monitors.
*
* @return groupRetentionDuration
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_GROUP_RETENTION_DURATION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getGroupRetentionDuration() {
return groupRetentionDuration;
}

public void setGroupRetentionDuration(String groupRetentionDuration) {
this.groupRetentionDuration = groupRetentionDuration;
}

public MonitorOptions groupbySimpleMonitor(Boolean groupbySimpleMonitor) {
this.groupbySimpleMonitor = groupbySimpleMonitor;
return this;
Expand Down Expand Up @@ -515,6 +547,36 @@ public void setNotifyNoData(Boolean notifyNoData) {
this.notifyNoData = notifyNoData;
}

public MonitorOptions onMissingData(OnMissingDataOption onMissingData) {
this.onMissingData = onMissingData;
this.unparsed |= !onMissingData.isValid();
return this;
}

/**
* Controls how groups or monitors are treated if an evaluation does not return any data points.
* The default option results in different behavior depending on the monitor query type. For
* monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to
* the threshold conditions. For monitor using any query type other than Count, for example Gauge
* or Rate, the monitor shows the last known status. This option is only available for APM Trace
* Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors.
*
* @return onMissingData
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ON_MISSING_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OnMissingDataOption getOnMissingData() {
return onMissingData;
}

public void setOnMissingData(OnMissingDataOption onMissingData) {
if (!onMissingData.isValid()) {
this.unparsed = true;
}
this.onMissingData = onMissingData;
}

public MonitorOptions renotifyInterval(Long renotifyInterval) {
this.renotifyInterval = JsonNullable.<Long>of(renotifyInterval);
return this;
Expand Down Expand Up @@ -835,6 +897,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.enableLogsSample, monitorOptions.enableLogsSample)
&& Objects.equals(this.escalationMessage, monitorOptions.escalationMessage)
&& Objects.equals(this.evaluationDelay, monitorOptions.evaluationDelay)
&& Objects.equals(this.groupRetentionDuration, monitorOptions.groupRetentionDuration)
&& Objects.equals(this.groupbySimpleMonitor, monitorOptions.groupbySimpleMonitor)
&& Objects.equals(this.includeTags, monitorOptions.includeTags)
&& Objects.equals(this.locked, monitorOptions.locked)
Expand All @@ -845,6 +908,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.noDataTimeframe, monitorOptions.noDataTimeframe)
&& Objects.equals(this.notifyAudit, monitorOptions.notifyAudit)
&& Objects.equals(this.notifyNoData, monitorOptions.notifyNoData)
&& Objects.equals(this.onMissingData, monitorOptions.onMissingData)
&& Objects.equals(this.renotifyInterval, monitorOptions.renotifyInterval)
&& Objects.equals(this.renotifyOccurrences, monitorOptions.renotifyOccurrences)
&& Objects.equals(this.renotifyStatuses, monitorOptions.renotifyStatuses)
Expand All @@ -865,6 +929,7 @@ public int hashCode() {
enableLogsSample,
escalationMessage,
evaluationDelay,
groupRetentionDuration,
groupbySimpleMonitor,
includeTags,
locked,
Expand All @@ -875,6 +940,7 @@ public int hashCode() {
noDataTimeframe,
notifyAudit,
notifyNoData,
onMissingData,
renotifyInterval,
renotifyOccurrences,
renotifyStatuses,
Expand All @@ -896,6 +962,9 @@ public String toString() {
sb.append(" enableLogsSample: ").append(toIndentedString(enableLogsSample)).append("\n");
sb.append(" escalationMessage: ").append(toIndentedString(escalationMessage)).append("\n");
sb.append(" evaluationDelay: ").append(toIndentedString(evaluationDelay)).append("\n");
sb.append(" groupRetentionDuration: ")
.append(toIndentedString(groupRetentionDuration))
.append("\n");
sb.append(" groupbySimpleMonitor: ")
.append(toIndentedString(groupbySimpleMonitor))
.append("\n");
Expand All @@ -908,6 +977,7 @@ public String toString() {
sb.append(" noDataTimeframe: ").append(toIndentedString(noDataTimeframe)).append("\n");
sb.append(" notifyAudit: ").append(toIndentedString(notifyAudit)).append("\n");
sb.append(" notifyNoData: ").append(toIndentedString(notifyNoData)).append("\n");
sb.append(" onMissingData: ").append(toIndentedString(onMissingData)).append("\n");
sb.append(" renotifyInterval: ").append(toIndentedString(renotifyInterval)).append("\n");
sb.append(" renotifyOccurrences: ")
.append(toIndentedString(renotifyOccurrences))
Expand Down
Loading

0 comments on commit 0266432

Please sign in to comment.