Package com.google.cloud.recommender.v1 (2.3.0)

A client to Recommender API

The interfaces provided are listed below, along with usage samples.

RecommenderClient

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.

Sample for RecommenderClient:


 try (RecommenderClient recommenderClient = RecommenderClient.create()) {
   InsightName name =
       InsightName.ofProjectLocationInsightTypeInsightName(
           "[PROJECT]", "[LOCATION]", "[INSIGHT_TYPE]", "[INSIGHT]");
   Insight response = recommenderClient.getInsight(name);
 }
 

Classes

CostProjection

Contains metadata about how much money a recommendation can save or incur.

Protobuf type google.cloud.recommender.v1.CostProjection

CostProjection.Builder

Contains metadata about how much money a recommendation can save or incur.

Protobuf type google.cloud.recommender.v1.CostProjection

GetInsightRequest

Request to the GetInsight method.

Protobuf type google.cloud.recommender.v1.GetInsightRequest

GetInsightRequest.Builder

Request to the GetInsight method.

Protobuf type google.cloud.recommender.v1.GetInsightRequest

GetRecommendationRequest

Request to the GetRecommendation method.

Protobuf type google.cloud.recommender.v1.GetRecommendationRequest

GetRecommendationRequest.Builder

Request to the GetRecommendation method.

Protobuf type google.cloud.recommender.v1.GetRecommendationRequest

Impact

Contains the impact a recommendation can have for a given category.

Protobuf type google.cloud.recommender.v1.Impact

Impact.Builder

Contains the impact a recommendation can have for a given category.

Protobuf type google.cloud.recommender.v1.Impact

Insight

An insight along with the information used to derive the insight. The insight may have associated recomendations as well.

Protobuf type google.cloud.recommender.v1.Insight

Insight.Builder

An insight along with the information used to derive the insight. The insight may have associated recomendations as well.

Protobuf type google.cloud.recommender.v1.Insight

Insight.RecommendationReference

Reference to an associated recommendation.

Protobuf type google.cloud.recommender.v1.Insight.RecommendationReference

Insight.RecommendationReference.Builder

Reference to an associated recommendation.

Protobuf type google.cloud.recommender.v1.Insight.RecommendationReference

InsightName

InsightName.BillingAccountLocationInsightTypeInsightBuilder

Builder for billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}.

InsightName.Builder

Builder for projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}.

InsightName.FolderLocationInsightTypeInsightBuilder

Builder for folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}.

InsightName.OrganizationLocationInsightTypeInsightBuilder

Builder for organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}.

InsightProto

InsightStateInfo

Information related to insight state.

Protobuf type google.cloud.recommender.v1.InsightStateInfo

InsightStateInfo.Builder

Information related to insight state.

Protobuf type google.cloud.recommender.v1.InsightStateInfo

InsightTypeName

InsightTypeName.BillingAccountLocationInsightTypeBuilder

Builder for billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}.

InsightTypeName.Builder

Builder for projects/{project}/locations/{location}/insightTypes/{insight_type}.

InsightTypeName.FolderLocationInsightTypeBuilder

Builder for folders/{folder}/locations/{location}/insightTypes/{insight_type}.

InsightTypeName.OrganizationLocationInsightTypeBuilder

Builder for organizations/{organization}/locations/{location}/insightTypes/{insight_type}.

ListInsightsRequest

Request for the ListInsights method.

Protobuf type google.cloud.recommender.v1.ListInsightsRequest

ListInsightsRequest.Builder

Request for the ListInsights method.

Protobuf type google.cloud.recommender.v1.ListInsightsRequest

ListInsightsResponse

Response to the ListInsights method.

Protobuf type google.cloud.recommender.v1.ListInsightsResponse

ListInsightsResponse.Builder

Response to the ListInsights method.

Protobuf type google.cloud.recommender.v1.ListInsightsResponse

ListRecommendationsRequest

Request for the ListRecommendations method.

Protobuf type google.cloud.recommender.v1.ListRecommendationsRequest

ListRecommendationsRequest.Builder

Request for the ListRecommendations method.

Protobuf type google.cloud.recommender.v1.ListRecommendationsRequest

ListRecommendationsResponse

Response to the ListRecommendations method.

Protobuf type google.cloud.recommender.v1.ListRecommendationsResponse

ListRecommendationsResponse.Builder

Response to the ListRecommendations method.

Protobuf type google.cloud.recommender.v1.ListRecommendationsResponse

MarkInsightAcceptedRequest

Request for the MarkInsightAccepted method.

Protobuf type google.cloud.recommender.v1.MarkInsightAcceptedRequest

MarkInsightAcceptedRequest.Builder

Request for the MarkInsightAccepted method.

Protobuf type google.cloud.recommender.v1.MarkInsightAcceptedRequest

MarkRecommendationClaimedRequest

Request for the MarkRecommendationClaimed Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationClaimedRequest

MarkRecommendationClaimedRequest.Builder

Request for the MarkRecommendationClaimed Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationClaimedRequest

MarkRecommendationFailedRequest

Request for the MarkRecommendationFailed Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationFailedRequest

MarkRecommendationFailedRequest.Builder

Request for the MarkRecommendationFailed Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationFailedRequest

MarkRecommendationSucceededRequest

Request for the MarkRecommendationSucceeded Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationSucceededRequest

MarkRecommendationSucceededRequest.Builder

Request for the MarkRecommendationSucceeded Method.

Protobuf type google.cloud.recommender.v1.MarkRecommendationSucceededRequest

Operation

Contains an operation for a resource loosely based on the JSON-PATCH format with support for:

  • Custom filters for describing partial array patch.
  • Extended path values for describing nested arrays.
  • Custom fields for describing the resource for which the operation is being described.
  • Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC.

Protobuf type google.cloud.recommender.v1.Operation

Operation.Builder

Contains an operation for a resource loosely based on the JSON-PATCH format with support for:

  • Custom filters for describing partial array patch.
  • Extended path values for describing nested arrays.
  • Custom fields for describing the resource for which the operation is being described.
  • Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC.

Protobuf type google.cloud.recommender.v1.Operation

OperationGroup

Group of operations that need to be performed atomically.

Protobuf type google.cloud.recommender.v1.OperationGroup

OperationGroup.Builder

Group of operations that need to be performed atomically.

Protobuf type google.cloud.recommender.v1.OperationGroup

Recommendation

A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc

Protobuf type google.cloud.recommender.v1.Recommendation

Recommendation.Builder

A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc

Protobuf type google.cloud.recommender.v1.Recommendation

Recommendation.InsightReference

Reference to an associated insight.

Protobuf type google.cloud.recommender.v1.Recommendation.InsightReference

Recommendation.InsightReference.Builder

Reference to an associated insight.

Protobuf type google.cloud.recommender.v1.Recommendation.InsightReference

RecommendationContent

Contains what resources are changing and how they are changing.

Protobuf type google.cloud.recommender.v1.RecommendationContent

RecommendationContent.Builder

Contains what resources are changing and how they are changing.

Protobuf type google.cloud.recommender.v1.RecommendationContent

RecommendationName

RecommendationName.BillingAccountLocationRecommenderRecommendationBuilder

Builder for billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}.

RecommendationName.Builder

Builder for projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}.

RecommendationName.FolderLocationRecommenderRecommendationBuilder

Builder for folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}.

RecommendationName.OrganizationLocationRecommenderRecommendationBuilder

Builder for organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}.

RecommendationOuterClass

RecommendationStateInfo

Information for state. Contains state and metadata.

Protobuf type google.cloud.recommender.v1.RecommendationStateInfo

RecommendationStateInfo.Builder

Information for state. Contains state and metadata.

Protobuf type google.cloud.recommender.v1.RecommendationStateInfo

RecommenderClient

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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 try (RecommenderClient recommenderClient = RecommenderClient.create()) {
   InsightName name =
       InsightName.ofProjectLocationInsightTypeInsightName(
           "[PROJECT]", "[LOCATION]", "[INSIGHT_TYPE]", "[INSIGHT]");
   Insight response = recommenderClient.getInsight(name);
 }
 

Note: close() needs to be called on the RecommenderClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of RecommenderSettings to create(). For example:

To customize credentials:


 RecommenderSettings recommenderSettings =
     RecommenderSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 RecommenderClient recommenderClient = RecommenderClient.create(recommenderSettings);
 

To customize the endpoint:


 RecommenderSettings recommenderSettings =
     RecommenderSettings.newBuilder().setEndpoint(myEndpoint).build();
 RecommenderClient recommenderClient = RecommenderClient.create(recommenderSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

RecommenderClient.ListInsightsFixedSizeCollection

RecommenderClient.ListInsightsPage

RecommenderClient.ListInsightsPagedResponse

RecommenderClient.ListRecommendationsFixedSizeCollection

RecommenderClient.ListRecommendationsPage

RecommenderClient.ListRecommendationsPagedResponse

RecommenderGrpc

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.

RecommenderGrpc.RecommenderBlockingStub

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.

RecommenderGrpc.RecommenderFutureStub

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.

RecommenderGrpc.RecommenderImplBase

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.

RecommenderGrpc.RecommenderStub

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.

RecommenderName

RecommenderName.BillingAccountLocationRecommenderBuilder

Builder for billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}.

RecommenderName.Builder

Builder for projects/{project}/locations/{location}/recommenders/{recommender}.

RecommenderName.FolderLocationRecommenderBuilder

Builder for folders/{folder}/locations/{location}/recommenders/{recommender}.

RecommenderName.OrganizationLocationRecommenderBuilder

Builder for organizations/{organization}/locations/{location}/recommenders/{recommender}.

RecommenderProto

RecommenderSettings

Settings class to configure an instance of RecommenderClient.

The default instance has everything set to sensible defaults:

  • The default service address (recommender.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getInsight to 30 seconds:


 RecommenderSettings.Builder recommenderSettingsBuilder = RecommenderSettings.newBuilder();
 recommenderSettingsBuilder
     .getInsightSettings()
     .setRetrySettings(
         recommenderSettingsBuilder
             .getInsightSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 RecommenderSettings recommenderSettings = recommenderSettingsBuilder.build();
 

RecommenderSettings.Builder

Builder for RecommenderSettings.

SecurityProjection

Contains various ways of describing the impact on Security.

Protobuf type google.cloud.recommender.v1.SecurityProjection

SecurityProjection.Builder

Contains various ways of describing the impact on Security.

Protobuf type google.cloud.recommender.v1.SecurityProjection

ValueMatcher

Contains various matching options for values for a GCP resource field.

Protobuf type google.cloud.recommender.v1.ValueMatcher

ValueMatcher.Builder

Contains various matching options for values for a GCP resource field.

Protobuf type google.cloud.recommender.v1.ValueMatcher

Interfaces

CostProjectionOrBuilder

GetInsightRequestOrBuilder

GetRecommendationRequestOrBuilder

ImpactOrBuilder

Insight.RecommendationReferenceOrBuilder

InsightOrBuilder

InsightStateInfoOrBuilder

ListInsightsRequestOrBuilder

ListInsightsResponseOrBuilder

ListRecommendationsRequestOrBuilder

ListRecommendationsResponseOrBuilder

MarkInsightAcceptedRequestOrBuilder

MarkRecommendationClaimedRequestOrBuilder

MarkRecommendationFailedRequestOrBuilder

MarkRecommendationSucceededRequestOrBuilder

OperationGroupOrBuilder

OperationOrBuilder

Recommendation.InsightReferenceOrBuilder

RecommendationContentOrBuilder

RecommendationOrBuilder

RecommendationStateInfoOrBuilder

SecurityProjectionOrBuilder

ValueMatcherOrBuilder

Enums

Impact.Category

The category of the impact.

Protobuf enum google.cloud.recommender.v1.Impact.Category

Impact.ProjectionCase

Insight.Category

Insight category.

Protobuf enum google.cloud.recommender.v1.Insight.Category

Insight.Severity

Insight severity levels.

Protobuf enum google.cloud.recommender.v1.Insight.Severity

InsightStateInfo.State

Represents insight state.

Protobuf enum google.cloud.recommender.v1.InsightStateInfo.State

Operation.PathValueCase

Recommendation.Priority

Recommendation priority levels.

Protobuf enum google.cloud.recommender.v1.Recommendation.Priority

RecommendationStateInfo.State

Represents Recommendation State.

Protobuf enum google.cloud.recommender.v1.RecommendationStateInfo.State

ValueMatcher.MatchVariantCase