Class: Google::Cloud::Recommender::V1::Recommender::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Recommender::V1::Recommender::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/recommender/v1/recommender/rest/client.rb
Overview
REST client for the Recommender service.
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.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the Recommender Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the Recommender Client instance.
-
#get_insight(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Insight
Gets the requested insight.
-
#get_insight_type_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig
Gets the requested InsightTypeConfig.
-
#get_recommendation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Gets the requested recommendation.
-
#get_recommender_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig
Gets the requested Recommender Config.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new Recommender REST client object.
-
#list_insights(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>
Lists insights for the specified Cloud Resource.
-
#list_recommendations(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>
Lists recommendations for the specified Cloud Resource.
-
#mark_insight_accepted(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Insight
Marks the Insight State as Accepted.
-
#mark_recommendation_claimed(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Marks the Recommendation State as Claimed.
-
#mark_recommendation_dismissed(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Mark the Recommendation State as Dismissed.
-
#mark_recommendation_failed(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Marks the Recommendation State as Failed.
-
#mark_recommendation_succeeded(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Marks the Recommendation State as Succeeded.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_insight_type_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig
Updates an InsightTypeConfig change.
-
#update_recommender_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig
Updates a Recommender Config.
Methods included from Paths
#insight_path, #insight_type_config_path, #insight_type_path, #recommendation_path, #recommender_config_path, #recommender_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new Recommender REST client object.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 157 def initialize # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @recommender_stub = ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Recommender Client class.
See Configuration for a description of the configuration fields.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 67 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Recommender", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_insights.timeout = 60.0 default_config.rpcs.list_insights.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_insight.timeout = 60.0 default_config.rpcs.get_insight.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.mark_insight_accepted.timeout = 60.0 default_config.rpcs.list_recommendations.timeout = 60.0 default_config.rpcs.list_recommendations.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_recommendation.timeout = 60.0 default_config.rpcs.get_recommendation.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.mark_recommendation_claimed.timeout = 60.0 default_config.rpcs.mark_recommendation_succeeded.timeout = 60.0 default_config.rpcs.mark_recommendation_failed.timeout = 60.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the Recommender Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
127 128 129 130 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 127 def configure yield @config if block_given? @config end |
#get_insight(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Insight #get_insight(name: nil) ⇒ ::Google::Cloud::Recommender::V1::Insight
Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 373 def get_insight request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_insight..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_insight.timeout, metadata: , retry_policy: @config.rpcs.get_insight.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.get_insight request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_insight_type_config(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig #get_insight_type_config(name: nil) ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig
Gets the requested InsightTypeConfig. There is only one instance of the config for each InsightType.
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 1322 def get_insight_type_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_insight_type_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout, metadata: , retry_policy: @config.rpcs.get_insight_type_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.get_insight_type_config request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_recommendation(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation #get_recommendation(name: nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation
Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender.
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 681 def get_recommendation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_recommendation..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_recommendation.timeout, metadata: , retry_policy: @config.rpcs.get_recommendation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.get_recommendation request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_recommender_config(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig #get_recommender_config(name: nil) ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig
Gets the requested Recommender Config. There is only one instance of the config for each Recommender.
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 1147 def get_recommender_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_recommender_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_recommender_config.timeout, metadata: , retry_policy: @config.rpcs.get_recommender_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.get_recommender_config request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_insights(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight> #list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>
Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 292 def list_insights request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_insights..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_insights.timeout, metadata: , retry_policy: @config.rpcs.list_insights.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.list_insights request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_insights, "insights", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_recommendations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation> #list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>
Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender.
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 600 def list_recommendations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_recommendations..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_recommendations.timeout, metadata: , retry_policy: @config.rpcs.list_recommendations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.list_recommendations request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_recommendations, "recommendations", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#mark_insight_accepted(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Insight #mark_insight_accepted(name: nil, state_metadata: nil, etag: nil) ⇒ ::Google::Cloud::Recommender::V1::Insight
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.
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 462 def mark_insight_accepted request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.mark_insight_accepted..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout, metadata: , retry_policy: @config.rpcs.mark_insight_accepted.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.mark_insight_accepted request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#mark_recommendation_claimed(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation #mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation
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.
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 865 def mark_recommendation_claimed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.mark_recommendation_claimed..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout, metadata: , retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.mark_recommendation_claimed request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#mark_recommendation_dismissed(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation #mark_recommendation_dismissed(name: nil, etag: nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation
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.
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 770 def mark_recommendation_dismissed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.mark_recommendation_dismissed..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.mark_recommendation_dismissed.timeout, metadata: , retry_policy: @config.rpcs.mark_recommendation_dismissed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.mark_recommendation_dismissed request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#mark_recommendation_failed(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation #mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation
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.
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 1057 def mark_recommendation_failed request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.mark_recommendation_failed..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout, metadata: , retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.mark_recommendation_failed request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#mark_recommendation_succeeded(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation #mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil) ⇒ ::Google::Cloud::Recommender::V1::Recommendation
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.
961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 961 def mark_recommendation_succeeded request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.mark_recommendation_succeeded..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout, metadata: , retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.mark_recommendation_succeeded request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
137 138 139 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 137 def universe_domain @recommender_stub.universe_domain end |
#update_insight_type_config(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig #update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil) ⇒ ::Google::Cloud::Recommender::V1::InsightTypeConfig
Updates an InsightTypeConfig change. This will create a new revision of the config.
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 1407 def update_insight_type_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_insight_type_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_insight_type_config.timeout, metadata: , retry_policy: @config.rpcs.update_insight_type_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.update_insight_type_config request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_recommender_config(request, options = nil) ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig #update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil) ⇒ ::Google::Cloud::Recommender::V1::RecommenderConfig
Updates a Recommender Config. This will create a new revision of the config.
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/google/cloud/recommender/v1/recommender/rest/client.rb', line 1232 def update_recommender_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_recommender_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Recommender::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_recommender_config.timeout, metadata: , retry_policy: @config.rpcs.update_recommender_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @recommender_stub.update_recommender_config request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |