Skip to content

Commit

Permalink
feat: Add support for "billingAccounts" as another parent resource na…
Browse files Browse the repository at this point in the history
…me for recommendations and insights APIs.

PiperOrigin-RevId: 347984439
  • Loading branch information
Google APIs authored and copybara-github committed Dec 17, 2020
1 parent 1c353b7 commit be40b52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
2 changes: 0 additions & 2 deletions google/cloud/recommender/v1/insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ option objc_class_prefix = "CREC";
option (google.api.resource_definition) = {
type: "recommender.googleapis.com/InsightType"
pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}"
pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}"
};

// An insight along with the information used to derive the insight. The insight
Expand All @@ -39,7 +38,6 @@ message Insight {
option (google.api.resource) = {
type: "recommender.googleapis.com/Insight"
pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
};

// Reference to an associated recommendation.
Expand Down
8 changes: 3 additions & 5 deletions google/cloud/recommender/v1/recommendation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ option objc_class_prefix = "CREC";
option (google.api.resource_definition) = {
type: "recommender.googleapis.com/Recommender"
pattern: "projects/{project}/locations/{location}/recommenders/{recommender}"
pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}"
};

// A recommendation along with a suggested action. E.g., a rightsizing
Expand All @@ -39,7 +38,6 @@ message Recommendation {
option (google.api.resource) = {
type: "recommender.googleapis.com/Recommendation"
pattern: "projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}"
pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}"
};

// Reference to an associated insight.
Expand Down Expand Up @@ -172,12 +170,12 @@ message Operation {
// "/versions/*/targetSize/percent": 20
// }
// * Example: {
// "/bindings/*/role": "roles/owner"
// "/bindings/*/role": "roles/admin"
// "/bindings/*/condition" : null
// }
// * Example: {
// "/bindings/*/role": "roles/owner"
// "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
// "/bindings/*/role": "roles/admin"
// "/bindings/*/members/*" : ["x@google.com", "y@google.com"]
// }
// When both path_filters and path_value_matchers are set, an implicit AND
// must be performed.
Expand Down
32 changes: 0 additions & 32 deletions google/cloud/recommender/v1/recommender_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ service Recommender {
rpc ListInsights(ListInsightsRequest) returns (ListInsightsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights"
additional_bindings {
get: "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights"
}
};
option (google.api.method_signature) = "parent";
}
Expand All @@ -55,9 +52,6 @@ service Recommender {
rpc GetInsight(GetInsightRequest) returns (Insight) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}"
additional_bindings {
get: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand All @@ -72,10 +66,6 @@ service Recommender {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted"
body: "*"
additional_bindings {
post: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted"
body: "*"
}
};
option (google.api.method_signature) = "name,state_metadata,etag";
}
Expand All @@ -85,9 +75,6 @@ service Recommender {
rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations"
additional_bindings {
get: "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations"
}
};
option (google.api.method_signature) = "parent";
option (google.api.method_signature) = "parent,filter";
Expand All @@ -98,9 +85,6 @@ service Recommender {
rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}"
additional_bindings {
get: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand All @@ -119,10 +103,6 @@ service Recommender {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed"
body: "*"
additional_bindings {
post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed"
body: "*"
}
};
option (google.api.method_signature) = "name,state_metadata,etag";
}
Expand All @@ -142,10 +122,6 @@ service Recommender {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded"
body: "*"
additional_bindings {
post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded"
body: "*"
}
};
option (google.api.method_signature) = "name,state_metadata,etag";
}
Expand All @@ -165,10 +141,6 @@ service Recommender {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed"
body: "*"
additional_bindings {
post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed"
body: "*"
}
};
option (google.api.method_signature) = "name,state_metadata,etag";
}
Expand All @@ -184,8 +156,6 @@ message ListInsightsRequest {
//
// LOCATION here refers to GCP Locations:
// https://cloud.google.com/about/locations/
// INSIGHT_TYPE_ID refers to supported insight types:
// https://cloud.google.com/recommender/docs/insights/insight-types.)
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -259,8 +229,6 @@ message ListRecommendationsRequest {
//
// LOCATION here refers to GCP Locations:
// https://cloud.google.com/about/locations/
// RECOMMENDER_ID refers to supported recommenders:
// https://cloud.google.com/recommender/docs/recommenders.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down

0 comments on commit be40b52

Please sign in to comment.