-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added support for Monitoring Query Language: https://cloud.goog…
…le.com/monitoring/mql feat: Added support for units in the MetricService feat: Added total_size to the response of ListAlertPolicies. fix: Un-deprecated cluster_istio for service monitoring. feat: Added IstioCanonicalService for service monitoring. feat: Added creation and mutation records to notification channels. feat: Added support for querying metrics for folders and organizations. fix: Extended the default deadline for UpdateGroup to 180s. feat: Added support for secondary aggregation when querying metrics. PiperOrigin-RevId: 364422694 Source-Author: Google APIs <noreply@google.com> Source-Date: Mon Mar 22 15:30:13 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 2124b6251e56e2ec8dd5c47e7d3815d7d5841880 Source-Link: googleapis/googleapis@2124b62
- Loading branch information
1 parent
a6aa034
commit 770bd47
Showing
29 changed files
with
3,502 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
...e.Cloud.Monitoring.V3/Google.Cloud.Monitoring.V3.Snippets/QueryServiceClientSnippets.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace Google.Cloud.Monitoring.V3.Snippets | ||
{ | ||
using Google.Api.Gax; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary>Generated snippets.</summary> | ||
public sealed class GeneratedQueryServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for QueryTimeSeries</summary> | ||
public void QueryTimeSeriesRequestObject() | ||
{ | ||
// Snippet: QueryTimeSeries(QueryTimeSeriesRequest, CallSettings) | ||
// Create client | ||
QueryServiceClient queryServiceClient = QueryServiceClient.Create(); | ||
// Initialize request argument(s) | ||
QueryTimeSeriesRequest request = new QueryTimeSeriesRequest { Name = "", Query = "", }; | ||
// Make the request | ||
PagedEnumerable<QueryTimeSeriesResponse, TimeSeriesData> response = queryServiceClient.QueryTimeSeries(request); | ||
|
||
// Iterate over all response items, lazily performing RPCs as required | ||
foreach (TimeSeriesData item in response) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
|
||
// Or iterate over pages (of server-defined size), performing one RPC per page | ||
foreach (QueryTimeSeriesResponse page in response.AsRawResponses()) | ||
{ | ||
// Do something with each page of items | ||
Console.WriteLine("A page of results:"); | ||
foreach (TimeSeriesData item in page) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
} | ||
|
||
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required | ||
int pageSize = 10; | ||
Page<TimeSeriesData> singlePage = response.ReadPage(pageSize); | ||
// Do something with the page of items | ||
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); | ||
foreach (TimeSeriesData item in singlePage) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
// Store the pageToken, for when the next page is required. | ||
string nextPageToken = singlePage.NextPageToken; | ||
// End snippet | ||
} | ||
|
||
/// <summary>Snippet for QueryTimeSeries</summary> | ||
public async Task QueryTimeSeriesRequestObjectAsync() | ||
{ | ||
// Snippet: QueryTimeSeriesAsync(QueryTimeSeriesRequest, CallSettings) | ||
// Create client | ||
QueryServiceClient queryServiceClient = await QueryServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
QueryTimeSeriesRequest request = new QueryTimeSeriesRequest { Name = "", Query = "", }; | ||
// Make the request | ||
PagedAsyncEnumerable<QueryTimeSeriesResponse, TimeSeriesData> response = queryServiceClient.QueryTimeSeriesAsync(request); | ||
|
||
// Iterate over all response items, lazily performing RPCs as required | ||
await response.ForEachAsync((TimeSeriesData item) => | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
}); | ||
|
||
// Or iterate over pages (of server-defined size), performing one RPC per page | ||
await response.AsRawResponses().ForEachAsync((QueryTimeSeriesResponse page) => | ||
{ | ||
// Do something with each page of items | ||
Console.WriteLine("A page of results:"); | ||
foreach (TimeSeriesData item in page) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
}); | ||
|
||
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required | ||
int pageSize = 10; | ||
Page<TimeSeriesData> singlePage = await response.ReadPageAsync(pageSize); | ||
// Do something with the page of items | ||
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); | ||
foreach (TimeSeriesData item in singlePage) | ||
{ | ||
// Do something with each item | ||
Console.WriteLine(item); | ||
} | ||
// Store the pageToken, for when the next page is required. | ||
string nextPageToken = singlePage.NextPageToken; | ||
// End snippet | ||
} | ||
} | ||
} |
Oops, something went wrong.