diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java index 45a13ef8..92c892e8 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Monitoring API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= AlertPolicyServiceClient ======================= * diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java index be1094a2..cf0e0180 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java @@ -13795,6 +13795,44 @@ public interface AlertStrategyOrBuilder */ com.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitOrBuilder getNotificationRateLimitOrBuilder(); + + /** + * + * + *

+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return Whether the autoClose field is set. + */ + boolean hasAutoClose(); + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return The autoClose. + */ + com.google.protobuf.Duration getAutoClose(); + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder(); } /** * @@ -13864,6 +13902,21 @@ private AlertStrategy( notificationRateLimit_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (autoClose_ != null) { + subBuilder = autoClose_.toBuilder(); + } + autoClose_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(autoClose_); + autoClose_ = subBuilder.buildPartial(); + } + break; } default: @@ -14741,6 +14794,55 @@ public boolean hasNotificationRateLimit() { return getNotificationRateLimit(); } + public static final int AUTO_CLOSE_FIELD_NUMBER = 3; + private com.google.protobuf.Duration autoClose_; + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return Whether the autoClose field is set. + */ + @java.lang.Override + public boolean hasAutoClose() { + return autoClose_ != null; + } + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return The autoClose. + */ + @java.lang.Override + public com.google.protobuf.Duration getAutoClose() { + return autoClose_ == null ? com.google.protobuf.Duration.getDefaultInstance() : autoClose_; + } + /** + * + * + *
+     * If an alert policy that was active has no data for this long, any open
+     * incidents will close
+     * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder() { + return getAutoClose(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -14758,6 +14860,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (notificationRateLimit_ != null) { output.writeMessage(1, getNotificationRateLimit()); } + if (autoClose_ != null) { + output.writeMessage(3, getAutoClose()); + } unknownFields.writeTo(output); } @@ -14771,6 +14876,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getNotificationRateLimit()); } + if (autoClose_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAutoClose()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -14791,6 +14899,10 @@ public boolean equals(final java.lang.Object obj) { if (hasNotificationRateLimit()) { if (!getNotificationRateLimit().equals(other.getNotificationRateLimit())) return false; } + if (hasAutoClose() != other.hasAutoClose()) return false; + if (hasAutoClose()) { + if (!getAutoClose().equals(other.getAutoClose())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -14806,6 +14918,10 @@ public int hashCode() { hash = (37 * hash) + NOTIFICATION_RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getNotificationRateLimit().hashCode(); } + if (hasAutoClose()) { + hash = (37 * hash) + AUTO_CLOSE_FIELD_NUMBER; + hash = (53 * hash) + getAutoClose().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -14960,6 +15076,12 @@ public Builder clear() { notificationRateLimit_ = null; notificationRateLimitBuilder_ = null; } + if (autoCloseBuilder_ == null) { + autoClose_ = null; + } else { + autoClose_ = null; + autoCloseBuilder_ = null; + } return this; } @@ -14992,6 +15114,11 @@ public com.google.monitoring.v3.AlertPolicy.AlertStrategy buildPartial() { } else { result.notificationRateLimit_ = notificationRateLimitBuilder_.build(); } + if (autoCloseBuilder_ == null) { + result.autoClose_ = autoClose_; + } else { + result.autoClose_ = autoCloseBuilder_.build(); + } onBuilt(); return result; } @@ -15047,6 +15174,9 @@ public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.AlertStrategy othe if (other.hasNotificationRateLimit()) { mergeNotificationRateLimit(other.getNotificationRateLimit()); } + if (other.hasAutoClose()) { + mergeAutoClose(other.getAutoClose()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -15301,6 +15431,198 @@ public Builder clearNotificationRateLimit() { return notificationRateLimitBuilder_; } + private com.google.protobuf.Duration autoClose_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + autoCloseBuilder_; + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return Whether the autoClose field is set. + */ + public boolean hasAutoClose() { + return autoCloseBuilder_ != null || autoClose_ != null; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + * + * @return The autoClose. + */ + public com.google.protobuf.Duration getAutoClose() { + if (autoCloseBuilder_ == null) { + return autoClose_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : autoClose_; + } else { + return autoCloseBuilder_.getMessage(); + } + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder setAutoClose(com.google.protobuf.Duration value) { + if (autoCloseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autoClose_ = value; + onChanged(); + } else { + autoCloseBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder setAutoClose(com.google.protobuf.Duration.Builder builderForValue) { + if (autoCloseBuilder_ == null) { + autoClose_ = builderForValue.build(); + onChanged(); + } else { + autoCloseBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder mergeAutoClose(com.google.protobuf.Duration value) { + if (autoCloseBuilder_ == null) { + if (autoClose_ != null) { + autoClose_ = + com.google.protobuf.Duration.newBuilder(autoClose_).mergeFrom(value).buildPartial(); + } else { + autoClose_ = value; + } + onChanged(); + } else { + autoCloseBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public Builder clearAutoClose() { + if (autoCloseBuilder_ == null) { + autoClose_ = null; + onChanged(); + } else { + autoClose_ = null; + autoCloseBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public com.google.protobuf.Duration.Builder getAutoCloseBuilder() { + + onChanged(); + return getAutoCloseFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + public com.google.protobuf.DurationOrBuilder getAutoCloseOrBuilder() { + if (autoCloseBuilder_ != null) { + return autoCloseBuilder_.getMessageOrBuilder(); + } else { + return autoClose_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : autoClose_; + } + } + /** + * + * + *
+       * If an alert policy that was active has no data for this long, any open
+       * incidents will close
+       * 
+ * + * .google.protobuf.Duration auto_close = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAutoCloseFieldBuilder() { + if (autoCloseBuilder_ == null) { + autoCloseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAutoClose(), getParentForChildren(), isClean()); + autoClose_ = null; + } + return autoCloseBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java index 9f2631a4..ab6ac96d 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java @@ -91,7 +91,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "monitoring/v3/mutation_record.proto\032\036goo" + "gle/protobuf/duration.proto\032\036google/prot" + "obuf/wrappers.proto\032\027google/rpc/status.p" - + "roto\"\264\027\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + + "roto\"\343\027\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + "splay_name\030\002 \001(\t\022F\n\rdocumentation\030\r \001(\0132" + "/.google.monitoring.v3.AlertPolicy.Docum" + "entation\022F\n\013user_labels\030\020 \003(\01321.google.m" @@ -152,26 +152,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "}/alertPolicies/{alert_policy}/condition" + "s/{condition}\022Dfolders/{folder}/alertPol" + "icies/{alert_policy}/conditions/{conditi" - + "on}\022\001*B\013\n\tcondition\032\273\001\n\rAlertStrategy\022f\n" + + "on}\022\001*B\013\n\tcondition\032\352\001\n\rAlertStrategy\022f\n" + "\027notification_rate_limit\030\001 \001(\0132E.google." + "monitoring.v3.AlertPolicy.AlertStrategy." - + "NotificationRateLimit\032B\n\025NotificationRat" - + "eLimit\022)\n\006period\030\001 \001(\0132\031.google.protobuf" - + ".Duration\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(" - + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025ConditionCombine" - + "rType\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n\003AND\020\001\022" - + "\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESOURCE\020\003:" - + "\311\001\352A\305\001\n%monitoring.googleapis.com/AlertP" - + "olicy\022/projects/{project}/alertPolicies/" - + "{alert_policy}\0229organizations/{organizat" - + "ion}/alertPolicies/{alert_policy}\022-folde" - + "rs/{folder}/alertPolicies/{alert_policy}" - + "\022\001*B\302\001\n\030com.google.monitoring.v3B\nAlertP" - + "rotoP\001Z>google.golang.org/genproto/googl" - + "eapis/monitoring/v3;monitoring\252\002\032Google." - + "Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monit" - + "oring\\V3\352\002\035Google::Cloud::Monitoring::V3" - + "b\006proto3" + + "NotificationRateLimit\022-\n\nauto_close\030\003 \001(" + + "\0132\031.google.protobuf.Duration\032B\n\025Notifica" + + "tionRateLimit\022)\n\006period\030\001 \001(\0132\031.google.p" + + "rotobuf.Duration\0321\n\017UserLabelsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025Condition" + + "CombinerType\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n" + + "\003AND\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESO" + + "URCE\020\003:\311\001\352A\305\001\n%monitoring.googleapis.com" + + "/AlertPolicy\022/projects/{project}/alertPo" + + "licies/{alert_policy}\0229organizations/{or" + + "ganization}/alertPolicies/{alert_policy}" + + "\022-folders/{folder}/alertPolicies/{alert_" + + "policy}\022\001*B\302\001\n\030com.google.monitoring.v3B" + + "\nAlertProtoP\001Z>google.golang.org/genprot" + + "o/googleapis/monitoring/v3;monitoring\252\002\032" + + "Google.Cloud.Monitoring.V3\312\002\032Google\\Clou" + + "d\\Monitoring\\V3\352\002\035Google::Cloud::Monitor" + + "ing::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -299,7 +300,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor, new java.lang.String[] { - "NotificationRateLimit", + "NotificationRateLimit", "AutoClose", }); internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_NotificationRateLimit_descriptor = internal_static_google_monitoring_v3_AlertPolicy_AlertStrategy_descriptor diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java index f1b9b894..a4c1100f 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/TimeInterval.java @@ -36,7 +36,7 @@ * the next interval must be at least a millisecond after the end time * of the previous interval. * * For `CUMULATIVE` metrics, the start time and end time must specify a - * a non-zero interval, with subsequent points specifying the same + * non-zero interval, with subsequent points specifying the same * start time and increasing end times, until an event resets the * cumulative value to zero and sets a new start time for the following * points. The new start time must be at least a millisecond after the @@ -447,7 +447,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * the next interval must be at least a millisecond after the end time * of the previous interval. * * For `CUMULATIVE` metrics, the start time and end time must specify a - * a non-zero interval, with subsequent points specifying the same + * non-zero interval, with subsequent points specifying the same * start time and increasing end times, until an event resets the * cumulative value to zero and sets a new start time for the following * points. The new start time must be at least a millisecond after the diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto index a1d15510..b63b318a 100644 --- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto @@ -334,6 +334,10 @@ message AlertPolicy { // // This limit is not implemented for alert policies that are not log-based. NotificationRateLimit notification_rate_limit = 1; + + // If an alert policy that was active has no data for this long, any open + // incidents will close + google.protobuf.Duration auto_close = 3; } // Operators for combining conditions. diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto index b278d739..d603cab7 100644 --- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/common.proto @@ -68,7 +68,7 @@ message TypedValue { // of the previous interval. // // * For `CUMULATIVE` metrics, the start time and end time must specify a -// a non-zero interval, with subsequent points specifying the same +// non-zero interval, with subsequent points specifying the same // start time and increasing end times, until an event resets the // cumulative value to zero and sets a new start time for the following // points. The new start time must be at least a millisecond after the diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto index 210cbe5d..fb24e149 100644 --- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/uptime.proto @@ -28,27 +28,6 @@ option java_package = "com.google.monitoring.v3"; option php_namespace = "Google\\Cloud\\Monitoring\\V3"; option ruby_package = "Google::Cloud::Monitoring::V3"; -// The regions from which an Uptime check can be run. -enum UptimeCheckRegion { - // Default value if no region is specified. Will result in Uptime checks - // running from all regions. - REGION_UNSPECIFIED = 0; - - // Allows checks to run from locations within the United States of America. - USA = 1; - - // Allows checks to run from locations within the continent of Europe. - EUROPE = 2; - - // Allows checks to run from locations within the continent of South - // America. - SOUTH_AMERICA = 3; - - // Allows checks to run from locations within the Asia Pacific area (ex: - // Singapore). - ASIA_PACIFIC = 4; -} - // An internal checker allows Uptime checks to run on private/internal GCP // resources. message InternalChecker { @@ -105,6 +84,27 @@ message InternalChecker { State state = 7; } +// The regions from which an Uptime check can be run. +enum UptimeCheckRegion { + // Default value if no region is specified. Will result in Uptime checks + // running from all regions. + REGION_UNSPECIFIED = 0; + + // Allows checks to run from locations within the United States of America. + USA = 1; + + // Allows checks to run from locations within the continent of Europe. + EUROPE = 2; + + // Allows checks to run from locations within the continent of South + // America. + SOUTH_AMERICA = 3; + + // Allows checks to run from locations within the Asia Pacific area (ex: + // Singapore). + ASIA_PACIFIC = 4; +} + // This message configures which resources and services to monitor for // availability. message UptimeCheckConfig {