Skip to content

Commit

Permalink
feat: Added support for logs-based alerts: https://cloud.google.com/l…
Browse files Browse the repository at this point in the history
…ogging/docs/alerting/log-based-alerts feat: Added support for user-defined labels on cloud monitoring's Service and ServiceLevelObjective objects fix!: mark required fields in QueryTimeSeriesRequest as required

PiperOrigin-RevId: 393200011

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Aug 26 13:54:31 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 354d0763e7e4ce7ab370790ffba0c3c25b1420c3
Source-Link: googleapis/googleapis@354d076
  • Loading branch information
yoshi-automation authored and jskeet committed Sep 15, 2021
1 parent 82d5b27 commit e724d81
Show file tree
Hide file tree
Showing 23 changed files with 1,925 additions and 705 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void GetAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -103,6 +104,7 @@ public void GetAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -146,6 +148,7 @@ public void GetAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -187,6 +190,7 @@ public void GetAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -230,6 +234,7 @@ public void GetAlertPolicyResourceNames1()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -271,6 +276,7 @@ public void GetAlertPolicyResourceNames1()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -314,6 +320,7 @@ public void GetAlertPolicyResourceNames2()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -355,6 +362,7 @@ public void GetAlertPolicyResourceNames2()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.GetAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -399,6 +407,7 @@ public void CreateAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -441,6 +450,7 @@ public void CreateAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -485,6 +495,7 @@ public void CreateAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -527,6 +538,7 @@ public void CreateAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -571,6 +583,7 @@ public void CreateAlertPolicyResourceNames1()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -613,6 +626,7 @@ public void CreateAlertPolicyResourceNames1()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -657,6 +671,7 @@ public void CreateAlertPolicyResourceNames2()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -699,6 +714,7 @@ public void CreateAlertPolicyResourceNames2()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -743,6 +759,7 @@ public void CreateAlertPolicyResourceNames3()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -785,6 +802,7 @@ public void CreateAlertPolicyResourceNames3()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -829,6 +847,7 @@ public void CreateAlertPolicyResourceNames4()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -871,6 +890,7 @@ public void CreateAlertPolicyResourceNames4()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.CreateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1039,6 +1059,7 @@ public void UpdateAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.UpdateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1081,6 +1102,7 @@ public void UpdateAlertPolicyRequestObject()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.UpdateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1125,6 +1147,7 @@ public void UpdateAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.UpdateAlertPolicy(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1167,6 +1190,7 @@ public void UpdateAlertPolicy()
},
Enabled = true,
Validity = new gr::Status(),
AlertStrategy = new AlertPolicy.Types.AlertStrategy(),
};
mockGrpcClient.Setup(x => x.UpdateAlertPolicyAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AlertPolicy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
AlertPolicyServiceClient client = new AlertPolicyServiceClientImpl(mockGrpcClient.Object, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ public void GetNotificationChannelDescriptorRequestObject()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -79,12 +73,6 @@ public void GetNotificationChannelDescriptorRequestObject()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -114,12 +102,6 @@ public void GetNotificationChannelDescriptor()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -147,12 +129,6 @@ public void GetNotificationChannelDescriptor()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -182,12 +158,6 @@ public void GetNotificationChannelDescriptorResourceNames1()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -215,12 +185,6 @@ public void GetNotificationChannelDescriptorResourceNames1()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -250,12 +214,6 @@ public void GetNotificationChannelDescriptorResourceNames2()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down Expand Up @@ -283,12 +241,6 @@ public void GetNotificationChannelDescriptorResourceNames2()
{
new ga::LabelDescriptor(),
},
#pragma warning disable CS0612
SupportedTiers =
#pragma warning restore CS0612
{
ServiceTier.Premium,
},
NotificationChannelDescriptorName = NotificationChannelDescriptorName.FromProjectChannelDescriptor("[PROJECT]", "[CHANNEL_DESCRIPTOR]"),
LaunchStage = ga::LaunchStage.Unspecified,
};
Expand Down
Loading

0 comments on commit e724d81

Please sign in to comment.