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

Commit

Permalink
fix: updated proto files with new proto annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Jan 31, 2020
1 parent 9c391df commit cf8cc77
Show file tree
Hide file tree
Showing 31 changed files with 2,627 additions and 1,273 deletions.
21 changes: 21 additions & 0 deletions protos/google/monitoring/v3/alert.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ syntax = "proto3";

package google.monitoring.v3;

import "google/api/resource.proto";
import "google/monitoring/v3/common.proto";
import "google/monitoring/v3/mutation_record.proto";
import "google/protobuf/duration.proto";
Expand All @@ -35,6 +36,14 @@ option php_namespace = "Google\\Cloud\\Monitoring\\V3";
// this state. For an overview of alert policies, see
// [Introduction to Alerting](/monitoring/alerts/).
message AlertPolicy {
option (google.api.resource) = {
type: "monitoring.googleapis.com/AlertPolicy"
pattern: "projects/{project}/alertPolicies/{alert_policy}"
pattern: "organizations/{organization}/alertPolicies/{alert_policy}"
pattern: "folders/{folder}/alertPolicies/{alert_policy}"
pattern: "*"
};

// A content string and a MIME type that describes the content string's
// format.
message Documentation {
Expand All @@ -54,6 +63,14 @@ message AlertPolicy {
// should open an incident. If a condition evaluates to true, it signifies
// that something is wrong.
message Condition {
option (google.api.resource) = {
type: "monitoring.googleapis.com/AlertPolicyCondition"
pattern: "projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}"
pattern: "organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}"
pattern: "folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}"
pattern: "*"
};

// Specifies how many time series must fail a predicate to trigger a
// condition. If not specified, then a `{count: 1}` trigger is used.
message Trigger {
Expand Down Expand Up @@ -300,10 +317,14 @@ message AlertPolicy {
// OR according to the `combiner` field. If the combined conditions evaluate
// to true, then an incident is created. A policy can have from one to six
// conditions.
// If |condition_time_series_uery_language| is present, it must be the only
// |condition|.
repeated Condition conditions = 12;

// How to combine the results of multiple conditions to determine if an
// incident should be opened.
// If condition_time_series_query_language is present, this must be
// COMBINE_UNSPECIFIED.
ConditionCombinerType combiner = 6;

// Whether or not the policy is enabled. On write, the default interpretation
Expand Down
53 changes: 40 additions & 13 deletions protos/google/monitoring/v3/alert_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ syntax = "proto3";
package google.monitoring.v3;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/monitoring/v3/alert.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/api/client.proto";

option csharp_namespace = "Google.Cloud.Monitoring.V3";
option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
Expand Down Expand Up @@ -51,13 +53,15 @@ service AlertPolicyService {
option (google.api.http) = {
get: "/v3/{name=projects/*}/alertPolicies"
};
option (google.api.method_signature) = "name";
}

// Gets a single alerting policy.
rpc GetAlertPolicy(GetAlertPolicyRequest) returns (AlertPolicy) {
option (google.api.http) = {
get: "/v3/{name=projects/*/alertPolicies/*}"
};
option (google.api.method_signature) = "name";
}

// Creates a new alerting policy.
Expand All @@ -66,13 +70,15 @@ service AlertPolicyService {
post: "/v3/{name=projects/*}/alertPolicies"
body: "alert_policy"
};
option (google.api.method_signature) = "name,alert_policy";
}

// Deletes an alerting policy.
rpc DeleteAlertPolicy(DeleteAlertPolicyRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v3/{name=projects/*/alertPolicies/*}"
};
option (google.api.method_signature) = "name";
}

// Updates an alerting policy. You can either replace the entire policy with
Expand All @@ -84,38 +90,49 @@ service AlertPolicyService {
patch: "/v3/{alert_policy.name=projects/*/alertPolicies/*}"
body: "alert_policy"
};
option (google.api.method_signature) = "update_mask,alert_policy";
}
}

// The protocol for the `CreateAlertPolicy` request.
message CreateAlertPolicyRequest {
// The project in which to create the alerting policy. The format is
// Required. The project in which to create the alerting policy. The format is
// `projects/[PROJECT_ID]`.
//
// Note that this field names the parent container in which the alerting
// policy will be written, not the name of the created policy. The alerting
// policy that is returned will have a name that contains a normalized
// representation of this name as a prefix but adds a suffix of the form
// `/alertPolicies/[POLICY_ID]`, identifying the policy in the container.
string name = 3;

// The requested alerting policy. You should omit the `name` field in this
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "monitoring.googleapis.com/AlertPolicy"
}
];

// Required. The requested alerting policy. You should omit the `name` field in this
// policy. The name will be returned in the new policy, including
// a new [ALERT_POLICY_ID] value.
AlertPolicy alert_policy = 2;
AlertPolicy alert_policy = 2 [(google.api.field_behavior) = REQUIRED];
}

// The protocol for the `GetAlertPolicy` request.
message GetAlertPolicyRequest {
// The alerting policy to retrieve. The format is
// Required. The alerting policy to retrieve. The format is
//
// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]
string name = 3;
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "monitoring.googleapis.com/AlertPolicy"
}
];
}

// The protocol for the `ListAlertPolicies` request.
message ListAlertPoliciesRequest {
// The project whose alert policies are to be listed. The format is
// Required. The project whose alert policies are to be listed. The format is
//
// projects/[PROJECT_ID]
//
Expand All @@ -124,7 +141,12 @@ message ListAlertPoliciesRequest {
// by name, use the
// [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy]
// operation, instead.
string name = 4;
string name = 4 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "monitoring.googleapis.com/AlertPolicy"
}
];

// If provided, this field specifies the criteria that must be met by
// alert policies to be included in the response.
Expand Down Expand Up @@ -190,15 +212,20 @@ message UpdateAlertPolicyRequest {
// fields listed in `update_mask`.
// If `update_mask` is not empty, any fields in this policy that are
// not in `update_mask` are ignored.
AlertPolicy alert_policy = 3;
AlertPolicy alert_policy = 3 [(google.api.field_behavior) = REQUIRED];
}

// The protocol for the `DeleteAlertPolicy` request.
message DeleteAlertPolicyRequest {
// The alerting policy to delete. The format is:
// Required. The alerting policy to delete. The format is:
//
// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]
//
// For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
string name = 3;
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "monitoring.googleapis.com/AlertPolicy"
}
];
}
Loading

0 comments on commit cf8cc77

Please sign in to comment.