feat: Add support for "billingAccounts" as another parent resource name for recommendations and insights APIs.

PiperOrigin-RevId: 347703845
This commit is contained in:
Google APIs 2020-12-15 15:22:41 -08:00 committed by Copybara-Service
parent 64f1e20354
commit 5256ab60f3
3 changed files with 39 additions and 3 deletions

View File

@ -30,6 +30,7 @@ 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
@ -38,6 +39,7 @@ 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.

View File

@ -30,6 +30,7 @@ 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
@ -38,6 +39,7 @@ 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.
@ -170,12 +172,12 @@ message Operation {
// "/versions/*/targetSize/percent": 20
// }
// * Example: {
// "/bindings/*/role": "roles/admin"
// "/bindings/*/role": "roles/owner"
// "/bindings/*/condition" : null
// }
// * Example: {
// "/bindings/*/role": "roles/admin"
// "/bindings/*/members/*" : ["x@google.com", "y@google.com"]
// "/bindings/*/role": "roles/owner"
// "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
// }
// When both path_filters and path_value_matchers are set, an implicit AND
// must be performed.

View File

@ -43,6 +43,9 @@ 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";
}
@ -52,6 +55,9 @@ 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";
}
@ -66,6 +72,10 @@ 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";
}
@ -75,6 +85,9 @@ 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";
@ -85,6 +98,9 @@ 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";
}
@ -103,6 +119,10 @@ 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";
}
@ -122,6 +142,10 @@ 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";
}
@ -141,6 +165,10 @@ 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";
}
@ -156,6 +184,8 @@ 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) = {
@ -229,6 +259,8 @@ 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) = {