Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Add monitor name and priority options #858

Merged
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
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.4.1.dev8",
"regenerated": "2021-06-08 12:36:47.910917",
"spec_repo_commit": "6fd1064"
"regenerated": "2021-06-08 14:41:25.492440",
"spec_repo_commit": "e6c8320"
},
"v2": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-06-08 12:37:43.383713",
"spec_repo_commit": "6fd1064"
"regenerated": "2021-06-08 14:42:10.151344",
"spec_repo_commit": "e6c8320"
}
}
}
2 changes: 2 additions & 0 deletions api_docs/v1/SyntheticsTestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Name | Type | Description | Notes
**followRedirects** | **Boolean** | For API HTTP test, whether or not the test should follow redirects. | [optional]
**minFailureDuration** | **Long** | Minimum amount of time in failure required to trigger an alert. | [optional]
**minLocationFailed** | **Long** | Minimum number of locations in failure required to trigger an alert. | [optional]
**monitorName** | **String** | The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs. | [optional]
**monitorOptions** | [**SyntheticsTestOptionsMonitorOptions**](SyntheticsTestOptionsMonitorOptions.md) | | [optional]
**monitorPriority** | **Integer** | Integer from 1 (high) to 5 (low) indicating alert severity. | [optional]
**noScreenshot** | **Boolean** | Prevents saving screenshots of the steps. | [optional]
**retry** | [**SyntheticsTestOptionsRetry**](SyntheticsTestOptionsRetry.md) | | [optional]
**tickEvery** | **SyntheticsTickInterval** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
SyntheticsTestOptions.JSON_PROPERTY_FOLLOW_REDIRECTS,
SyntheticsTestOptions.JSON_PROPERTY_MIN_FAILURE_DURATION,
SyntheticsTestOptions.JSON_PROPERTY_MIN_LOCATION_FAILED,
SyntheticsTestOptions.JSON_PROPERTY_MONITOR_NAME,
SyntheticsTestOptions.JSON_PROPERTY_MONITOR_OPTIONS,
SyntheticsTestOptions.JSON_PROPERTY_MONITOR_PRIORITY,
SyntheticsTestOptions.JSON_PROPERTY_NO_SCREENSHOT,
SyntheticsTestOptions.JSON_PROPERTY_RETRY,
SyntheticsTestOptions.JSON_PROPERTY_TICK_EVERY
Expand Down Expand Up @@ -57,9 +59,15 @@ public class SyntheticsTestOptions {
public static final String JSON_PROPERTY_MIN_LOCATION_FAILED = "min_location_failed";
private Long minLocationFailed;

public static final String JSON_PROPERTY_MONITOR_NAME = "monitor_name";
private String monitorName;

public static final String JSON_PROPERTY_MONITOR_OPTIONS = "monitor_options";
private SyntheticsTestOptionsMonitorOptions monitorOptions;

public static final String JSON_PROPERTY_MONITOR_PRIORITY = "monitor_priority";
private Integer monitorPriority;

public static final String JSON_PROPERTY_NO_SCREENSHOT = "noScreenshot";
private Boolean noScreenshot;

Expand Down Expand Up @@ -233,6 +241,32 @@ public void setMinLocationFailed(Long minLocationFailed) {
this.minLocationFailed = minLocationFailed;
}

public SyntheticsTestOptions monitorName(String monitorName) {
this.monitorName = monitorName;
return this;
}

/**
* The monitor name is used for the alert title as well as for all monitor dashboard widgets and
* SLOs.
*
* @return monitorName
*/
@javax.annotation.Nullable
@ApiModelProperty(
value =
"The monitor name is used for the alert title as well as for all monitor dashboard"
+ " widgets and SLOs.")
@JsonProperty(JSON_PROPERTY_MONITOR_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMonitorName() {
return monitorName;
}

public void setMonitorName(String monitorName) {
this.monitorName = monitorName;
}

public SyntheticsTestOptions monitorOptions(SyntheticsTestOptionsMonitorOptions monitorOptions) {
this.monitorOptions = monitorOptions;
return this;
Expand All @@ -255,6 +289,28 @@ public void setMonitorOptions(SyntheticsTestOptionsMonitorOptions monitorOptions
this.monitorOptions = monitorOptions;
}

public SyntheticsTestOptions monitorPriority(Integer monitorPriority) {
this.monitorPriority = monitorPriority;
return this;
}

/**
* Integer from 1 (high) to 5 (low) indicating alert severity. minimum: 1 maximum: 5
*
* @return monitorPriority
*/
@javax.annotation.Nullable
@ApiModelProperty(value = "Integer from 1 (high) to 5 (low) indicating alert severity.")
@JsonProperty(JSON_PROPERTY_MONITOR_PRIORITY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getMonitorPriority() {
return monitorPriority;
}

public void setMonitorPriority(Integer monitorPriority) {
this.monitorPriority = monitorPriority;
}

public SyntheticsTestOptions noScreenshot(Boolean noScreenshot) {
this.noScreenshot = noScreenshot;
return this;
Expand Down Expand Up @@ -338,7 +394,9 @@ public boolean equals(Object o) {
&& Objects.equals(this.followRedirects, syntheticsTestOptions.followRedirects)
&& Objects.equals(this.minFailureDuration, syntheticsTestOptions.minFailureDuration)
&& Objects.equals(this.minLocationFailed, syntheticsTestOptions.minLocationFailed)
&& Objects.equals(this.monitorName, syntheticsTestOptions.monitorName)
&& Objects.equals(this.monitorOptions, syntheticsTestOptions.monitorOptions)
&& Objects.equals(this.monitorPriority, syntheticsTestOptions.monitorPriority)
&& Objects.equals(this.noScreenshot, syntheticsTestOptions.noScreenshot)
&& Objects.equals(this.retry, syntheticsTestOptions.retry)
&& Objects.equals(this.tickEvery, syntheticsTestOptions.tickEvery);
Expand All @@ -354,7 +412,9 @@ public int hashCode() {
followRedirects,
minFailureDuration,
minLocationFailed,
monitorName,
monitorOptions,
monitorPriority,
noScreenshot,
retry,
tickEvery);
Expand All @@ -371,7 +431,9 @@ public String toString() {
sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n");
sb.append(" minFailureDuration: ").append(toIndentedString(minFailureDuration)).append("\n");
sb.append(" minLocationFailed: ").append(toIndentedString(minLocationFailed)).append("\n");
sb.append(" monitorName: ").append(toIndentedString(monitorName)).append("\n");
sb.append(" monitorOptions: ").append(toIndentedString(monitorOptions)).append("\n");
sb.append(" monitorPriority: ").append(toIndentedString(monitorPriority)).append("\n");
sb.append(" noScreenshot: ").append(toIndentedString(noScreenshot)).append("\n");
sb.append(" retry: ").append(toIndentedString(retry)).append("\n");
sb.append(" tickEvery: ").append(toIndentedString(tickEvery)).append("\n");
Expand Down
Loading