pub struct Recommender { /* private fields */ }Expand description
Implements a client for the Recommender API.
§Example
let client = Recommender::builder().build().await?;
// use `client` to make requests to the Recommender API.§Service Description
Provides insights and recommendations for cloud customers for various categories like performance optimization, cost savings, reliability, feature discovery, etc. Insights and recommendations are generated automatically based on analysis of user resources, configuration and monitoring metrics.
§Configuration
To configure Recommender use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://recommender.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
Recommender holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Recommender in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Recommender
impl Recommender
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Recommender.
let client = Recommender::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Recommender + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Recommender + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn list_insights(&self) -> ListInsights
pub fn list_insights(&self) -> ListInsights
Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
Sourcepub fn get_insight(&self) -> GetInsight
pub fn get_insight(&self) -> GetInsight
Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
Sourcepub fn mark_insight_accepted(&self) -> MarkInsightAccepted
pub fn mark_insight_accepted(&self) -> MarkInsightAccepted
Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated.
MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
Sourcepub fn list_recommendations(&self) -> ListRecommendations
pub fn list_recommendations(&self) -> ListRecommendations
Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender.
Sourcepub fn get_recommendation(&self) -> GetRecommendation
pub fn get_recommendation(&self) -> GetRecommendation
Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender.
Sourcepub fn mark_recommendation_dismissed(&self) -> MarkRecommendationDismissed
pub fn mark_recommendation_dismissed(&self) -> MarkRecommendationDismissed
Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED.
MarkRecommendationDismissed can be applied to recommendations in ACTIVE state.
Requires the recommender.*.update IAM permission for the specified recommender.
Sourcepub fn mark_recommendation_claimed(&self) -> MarkRecommendationClaimed
pub fn mark_recommendation_claimed(&self) -> MarkRecommendationClaimed
Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state.
MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state.
Requires the recommender.*.update IAM permission for the specified recommender.
Sourcepub fn mark_recommendation_succeeded(&self) -> MarkRecommendationSucceeded
pub fn mark_recommendation_succeeded(&self) -> MarkRecommendationSucceeded
Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state.
MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state.
Requires the recommender.*.update IAM permission for the specified recommender.
Sourcepub fn mark_recommendation_failed(&self) -> MarkRecommendationFailed
pub fn mark_recommendation_failed(&self) -> MarkRecommendationFailed
Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state.
MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state.
Requires the recommender.*.update IAM permission for the specified recommender.
Sourcepub fn get_recommender_config(&self) -> GetRecommenderConfig
pub fn get_recommender_config(&self) -> GetRecommenderConfig
Gets the requested Recommender Config. There is only one instance of the config for each Recommender.
Sourcepub fn update_recommender_config(&self) -> UpdateRecommenderConfig
pub fn update_recommender_config(&self) -> UpdateRecommenderConfig
Updates a Recommender Config. This will create a new revision of the config.
Sourcepub fn get_insight_type_config(&self) -> GetInsightTypeConfig
pub fn get_insight_type_config(&self) -> GetInsightTypeConfig
Gets the requested InsightTypeConfig. There is only one instance of the config for each InsightType.
Sourcepub fn update_insight_type_config(&self) -> UpdateInsightTypeConfig
pub fn update_insight_type_config(&self) -> UpdateInsightTypeConfig
Updates an InsightTypeConfig change. This will create a new revision of the config.
Trait Implementations§
Source§impl Clone for Recommender
impl Clone for Recommender
Source§fn clone(&self) -> Recommender
fn clone(&self) -> Recommender
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more