Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
feat: added validation only mode when writing dashboards feat: added …
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Jul 7, 2021
1 parent 168ea2a commit 867a08c
Show file tree
Hide file tree
Showing 12 changed files with 27,493 additions and 26,954 deletions.
40 changes: 40 additions & 0 deletions protos/google/monitoring/dashboard/v1/alertchart.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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
//
// http://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.

syntax = "proto3";

package google.monitoring.dashboard.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard";
option java_multiple_files = true;
option java_outer_classname = "AlertChartProto";
option java_package = "com.google.monitoring.dashboard.v1";
option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1";
option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1";

// A chart that displays alert policy data.
message AlertChart {
option (google.api.resource) = {
type: "monitoring.googleapis.com/AlertPolicy"
pattern: "projects/{project}/alertPolicies/{alert_policy}"
};

// Required. The resource name of the alert policy. The format is:
//
// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
16 changes: 10 additions & 6 deletions protos/google/monitoring/dashboard/v1/dashboards_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ service DashboardsService {
"https://www.googleapis.com/auth/monitoring.read,"
"https://www.googleapis.com/auth/monitoring.write";

// Creates a new custom dashboard. For examples on how you can use this API to
// create dashboards, see [Managing dashboards by
// API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This method requires the
// `monitoring.dashboards.create` permission on the specified project. For
// more information about permissions, see [Cloud Identity and Access
// Management](https://cloud.google.com/iam).
// Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](/monitoring/dashboards/api-dashboard).
// This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](/iam).
rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) {
option (google.api.http) = {
post: "/v1/{parent=projects/*}/dashboards"
Expand Down Expand Up @@ -111,6 +107,10 @@ message CreateDashboardRequest {

// Required. The initial dashboard specification.
Dashboard dashboard = 2 [(google.api.field_behavior) = REQUIRED];

// If set, validate the request and preview the review, but do not actually
// save it.
bool validate_only = 3;
}

// The `ListDashboards` request.
Expand Down Expand Up @@ -178,4 +178,8 @@ message DeleteDashboardRequest {
message UpdateDashboardRequest {
// Required. The dashboard that will replace the existing dashboard.
Dashboard dashboard = 1 [(google.api.field_behavior) = REQUIRED];

// If set, validate the request and preview the review, but do not actually
// save it.
bool validate_only = 3;
}
11 changes: 4 additions & 7 deletions protos/google/monitoring/dashboard/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ message TimeSeriesQuery {
// [`ListTimeSeries`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
// method.
message TimeSeriesFilter {
// Required. The [monitoring
// filter](https://cloud.google.com/monitoring/api/v3/filters) that identifies
// the metric types, resources, and projects to query.
// Required. The [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
// that identifies the metric types, resources, and projects to query.
string filter = 1 [(google.api.field_behavior) = REQUIRED];

// By default, the raw time series data is returned.
Expand All @@ -74,8 +73,7 @@ message TimeSeriesFilter {

// Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
[deprecated = true];
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
}
}

Expand Down Expand Up @@ -114,8 +112,7 @@ message TimeSeriesFilterRatio {

// Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
[deprecated = true];
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
}
}

Expand Down
6 changes: 2 additions & 4 deletions protos/google/monitoring/dashboard/v1/scorecard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ message Scorecard {
// timeseries.
message SparkChartView {
// Required. The type of sparkchart to show in this chartView.
SparkChartType spark_chart_type = 1
[(google.api.field_behavior) = REQUIRED];
SparkChartType spark_chart_type = 1 [(google.api.field_behavior) = REQUIRED];

// The lower bound on data point frequency in the chart implemented by
// specifying the minimum alignment period to use in a time series query.
Expand All @@ -63,8 +62,7 @@ message Scorecard {

// Required. Fields for querying time series data from the
// Stackdriver metrics API.
TimeSeriesQuery time_series_query = 1
[(google.api.field_behavior) = REQUIRED];
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];

// Defines the optional additional chart shown on the scorecard. If
// neither is included - then a default scorecard is shown.
Expand Down
4 changes: 4 additions & 0 deletions protos/google/monitoring/dashboard/v1/widget.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ syntax = "proto3";
package google.monitoring.dashboard.v1;

import "google/api/field_behavior.proto";
import "google/monitoring/dashboard/v1/alertchart.proto";
import "google/monitoring/dashboard/v1/scorecard.proto";
import "google/monitoring/dashboard/v1/text.proto";
import "google/monitoring/dashboard/v1/xychart.proto";
Expand Down Expand Up @@ -48,5 +49,8 @@ message Widget {

// A blank space.
google.protobuf.Empty blank = 5;

// A chart of alert policy data.
AlertChart alert_chart = 7;
}
}
14 changes: 6 additions & 8 deletions protos/google/monitoring/dashboard/v1/xychart.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ message XyChart {

// Required. Fields for querying time series data from the
// Stackdriver metrics API.
TimeSeriesQuery time_series_query = 1
[(google.api.field_behavior) = REQUIRED];
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];

// How this data should be plotted on the chart.
PlotType plot_type = 2;
Expand All @@ -71,13 +70,12 @@ message XyChart {
// which will resolve to the label's value.
string legend_template = 3;

// Optional. The lower bound on data point frequency for this data set,
// implemented by specifying the minimum alignment period to use in a time
// series query. For example, if the data is published once every 10 minutes,
// the `min_alignment_period` should be at least 10 minutes. It would not
// Optional. The lower bound on data point frequency for this data set, implemented by
// specifying the minimum alignment period to use in a time series query
// For example, if the data is published once every 10 minutes, the
// `min_alignment_period` should be at least 10 minutes. It would not
// make sense to fetch and align data at one minute intervals.
google.protobuf.Duration min_alignment_period = 4
[(google.api.field_behavior) = OPTIONAL];
google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL];
}

// A chart axis.
Expand Down
Loading

0 comments on commit 867a08c

Please sign in to comment.