Class: OCI::Optimizer::OptimizerClient
- Inherits:
-
Object
- Object
- OCI::Optimizer::OptimizerClient
- Defined in:
- lib/oci/optimizer/optimizer_client.rb
Overview
Use the Cloud Advisor API to find potential inefficiencies in your tenancy and address them. Cloud Advisor can help you save money, improve performance, strengthen system resilience, and improve security. For more information, see Cloud Advisor.
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#bulk_apply_recommendations(recommendation_id, bulk_apply_recommendations_details, opts = {}) ⇒ Response
Applies the specified recommendations to the resources.
-
#create_profile(create_profile_details, opts = {}) ⇒ Response
Creates a new profile.
-
#delete_profile(profile_id, opts = {}) ⇒ Response
Deletes the specified profile.
-
#filter_resource_actions(compartment_id, compartment_id_in_subtree, query_details, opts = {}) ⇒ Response
Queries the Cloud Advisor resource actions that are supported.
-
#get_category(category_id, opts = {}) ⇒ Response
Gets the category that corresponds to the specified OCID.
-
#get_enrollment_status(enrollment_status_id, opts = {}) ⇒ Response
Gets the Cloud Advisor enrollment status.
-
#get_profile(profile_id, opts = {}) ⇒ Response
Gets the specified profile's information.
-
#get_recommendation(recommendation_id, opts = {}) ⇒ Response
Gets the recommendation for the specified OCID.
-
#get_resource_action(resource_action_id, opts = {}) ⇒ Response
Gets the resource action that corresponds to the specified OCID.
-
#get_work_request(work_request_id, opts = {}) ⇒ Response
Gets the status of the work request associated with the specified ID.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ OptimizerClient
constructor
Creates a new OptimizerClient.
-
#list_categories(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the supported Cloud Advisor categories.
-
#list_enrollment_statuses(compartment_id, opts = {}) ⇒ Response
Lists the Cloud Advisor enrollment statuses.
-
#list_histories(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists changes to the recommendations based on user activity.
-
#list_profile_levels(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the existing profile levels.
-
#list_profiles(compartment_id, opts = {}) ⇒ Response
Lists the existing profiles.
-
#list_recommendation_strategies(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the existing strategies.
-
#list_recommendations(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the Cloud Advisor recommendations that are currently supported.
-
#list_resource_action_queryable_fields(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the fields that are indexed for querying and their associated value types.
-
#list_resource_actions(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Lists the Cloud Advisor resource actions that are supported.
-
#list_work_request_errors(work_request_id, opts = {}) ⇒ Response
Lists errors associated with the specified work request.
-
#list_work_request_logs(work_request_id, opts = {}) ⇒ Response
Lists the logs associated with the specified work request.
-
#list_work_requests(compartment_id, opts = {}) ⇒ Response
Lists the work requests in the tenancy.
-
#logger ⇒ Logger
The logger for this client.
-
#update_enrollment_status(enrollment_status_id, update_enrollment_status_details, opts = {}) ⇒ Response
Updates the enrollment status of the tenancy.
-
#update_profile(profile_id, update_profile_details, opts = {}) ⇒ Response
Updates the specified profile.
-
#update_recommendation(recommendation_id, update_recommendation_details, opts = {}) ⇒ Response
Updates the recommendation that corresponds to the specified OCID.
-
#update_resource_action(resource_action_id, update_resource_action_details, opts = {}) ⇒ Response
Updates the resource action that corresponds to the specified OCID.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ OptimizerClient
Creates a new OptimizerClient. Notes: If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 57 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config = OCI::Config.validate_and_build_config_with_signer(config, signer) signer = OCI::Signer.config_file_auth_builder(config) if signer.nil? @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20200606' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "OptimizerClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
17 18 19 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 17 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
21 22 23 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 21 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
31 32 33 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 31 def region @region end |
#retry_config ⇒ OCI::Retry::RetryConfig (readonly)
The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil
, which means that an operation will not perform any retries
27 28 29 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 27 def retry_config @retry_config end |
Instance Method Details
#bulk_apply_recommendations(recommendation_id, bulk_apply_recommendations_details, opts = {}) ⇒ Response
Click here to see an example of how to use bulk_apply_recommendations API.
Applies the specified recommendations to the resources.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 123 def bulk_apply_recommendations(recommendation_id, bulk_apply_recommendations_details, opts = {}) logger.debug 'Calling operation OptimizerClient#bulk_apply_recommendations.' if logger raise "Missing the required parameter 'recommendation_id' when calling bulk_apply_recommendations." if recommendation_id.nil? raise "Missing the required parameter 'bulk_apply_recommendations_details' when calling bulk_apply_recommendations." if bulk_apply_recommendations_details.nil? raise "Parameter value for 'recommendation_id' must not be blank" if OCI::Internal::Util.blank_string?(recommendation_id) path = '/recommendations/{recommendationId}/actions/bulkApplyRecommendations'.sub('{recommendationId}', recommendation_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(bulk_apply_recommendations_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#bulk_apply_recommendations') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#create_profile(create_profile_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_profile API.
Creates a new profile.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 188 def create_profile(create_profile_details, opts = {}) logger.debug 'Calling operation OptimizerClient#create_profile.' if logger raise "Missing the required parameter 'create_profile_details' when calling create_profile." if create_profile_details.nil? path = '/profiles' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_profile_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#create_profile') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Profile' ) end # rubocop:enable Metrics/BlockLength end |
#delete_profile(profile_id, opts = {}) ⇒ Response
Click here to see an example of how to use delete_profile API.
Deletes the specified profile. Uses the profile's OCID to determine which profile to delete.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 252 def delete_profile(profile_id, opts = {}) logger.debug 'Calling operation OptimizerClient#delete_profile.' if logger raise "Missing the required parameter 'profile_id' when calling delete_profile." if profile_id.nil? raise "Parameter value for 'profile_id' must not be blank" if OCI::Internal::Util.blank_string?(profile_id) path = '/profiles/{profileId}'.sub('{profileId}', profile_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#delete_profile') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#filter_resource_actions(compartment_id, compartment_id_in_subtree, query_details, opts = {}) ⇒ Response
Click here to see an example of how to use filter_resource_actions API.
Queries the Cloud Advisor resource actions that are supported.
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 346 def filter_resource_actions(compartment_id, compartment_id_in_subtree, query_details, opts = {}) logger.debug 'Calling operation OptimizerClient#filter_resource_actions.' if logger raise "Missing the required parameter 'compartment_id' when calling filter_resource_actions." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling filter_resource_actions." if compartment_id_in_subtree.nil? raise "Missing the required parameter 'query_details' when calling filter_resource_actions." if query_details.nil? path = '/actions/filterResourceActions' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:recommendationId] = opts[:recommendation_id] if opts[:recommendation_id] query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name] query_params[:childTenancyIds] = OCI::ApiClient.build_collection_params(opts[:child_tenancy_ids], :multi) if opts[:child_tenancy_ids] && !opts[:child_tenancy_ids].empty? query_params[:includeOrganization] = opts[:include_organization] if !opts[:include_organization].nil? query_params[:includeResourceMetadata] = opts[:include_resource_metadata] if !opts[:include_resource_metadata].nil? query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(query_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#filter_resource_actions') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ResourceActionCollection' ) end # rubocop:enable Metrics/BlockLength end |
#get_category(category_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_category API.
Gets the category that corresponds to the specified OCID.
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 413 def get_category(category_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_category.' if logger raise "Missing the required parameter 'category_id' when calling get_category." if category_id.nil? raise "Parameter value for 'category_id' must not be blank" if OCI::Internal::Util.blank_string?(category_id) path = '/categories/{categoryId}'.sub('{categoryId}', category_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_category') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Category' ) end # rubocop:enable Metrics/BlockLength end |
#get_enrollment_status(enrollment_status_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_enrollment_status API.
Gets the Cloud Advisor enrollment status.
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 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 470 def get_enrollment_status(enrollment_status_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_enrollment_status.' if logger raise "Missing the required parameter 'enrollment_status_id' when calling get_enrollment_status." if enrollment_status_id.nil? raise "Parameter value for 'enrollment_status_id' must not be blank" if OCI::Internal::Util.blank_string?(enrollment_status_id) path = '/enrollmentStatus/{enrollmentStatusId}'.sub('{enrollmentStatusId}', enrollment_status_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_enrollment_status') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::EnrollmentStatus' ) end # rubocop:enable Metrics/BlockLength end |
#get_profile(profile_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_profile API.
Gets the specified profile's information. Uses the profile's OCID to determine which profile to retrieve.
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 527 def get_profile(profile_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_profile.' if logger raise "Missing the required parameter 'profile_id' when calling get_profile." if profile_id.nil? raise "Parameter value for 'profile_id' must not be blank" if OCI::Internal::Util.blank_string?(profile_id) path = '/profiles/{profileId}'.sub('{profileId}', profile_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_profile') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Profile' ) end # rubocop:enable Metrics/BlockLength end |
#get_recommendation(recommendation_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_recommendation API.
Gets the recommendation for the specified OCID.
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 584 def get_recommendation(recommendation_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_recommendation.' if logger raise "Missing the required parameter 'recommendation_id' when calling get_recommendation." if recommendation_id.nil? raise "Parameter value for 'recommendation_id' must not be blank" if OCI::Internal::Util.blank_string?(recommendation_id) path = '/recommendations/{recommendationId}'.sub('{recommendationId}', recommendation_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_recommendation') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Recommendation' ) end # rubocop:enable Metrics/BlockLength end |
#get_resource_action(resource_action_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_resource_action API.
Gets the resource action that corresponds to the specified OCID.
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 642 def get_resource_action(resource_action_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_resource_action.' if logger raise "Missing the required parameter 'resource_action_id' when calling get_resource_action." if resource_action_id.nil? raise "Parameter value for 'resource_action_id' must not be blank" if OCI::Internal::Util.blank_string?(resource_action_id) path = '/resourceActions/{resourceActionId}'.sub('{resourceActionId}', resource_action_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:includeResourceMetadata] = opts[:include_resource_metadata] if !opts[:include_resource_metadata].nil? # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_resource_action') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ResourceAction' ) end # rubocop:enable Metrics/BlockLength end |
#get_work_request(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_work_request API.
Gets the status of the work request associated with the specified ID.
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 699 def get_work_request(work_request_id, opts = {}) logger.debug 'Calling operation OptimizerClient#get_work_request.' if logger raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#get_work_request') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::WorkRequest' ) end # rubocop:enable Metrics/BlockLength end |
#list_categories(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_categories API.
Lists the supported Cloud Advisor categories.
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 796 def list_categories(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_categories.' if logger raise "Missing the required parameter 'compartment_id' when calling list_categories." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_categories." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end path = '/categories' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:childTenancyIds] = OCI::ApiClient.build_collection_params(opts[:child_tenancy_ids], :multi) if opts[:child_tenancy_ids] && !opts[:child_tenancy_ids].empty? query_params[:includeOrganization] = opts[:include_organization] if !opts[:include_organization].nil? query_params[:name] = opts[:name] if opts[:name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_categories') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::CategoryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_enrollment_statuses(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_enrollment_statuses API.
Lists the Cloud Advisor enrollment statuses.
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 886 def list_enrollment_statuses(compartment_id, opts = {}) logger.debug 'Calling operation OptimizerClient#list_enrollment_statuses.' if logger raise "Missing the required parameter 'compartment_id' when calling list_enrollment_statuses." if compartment_id.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end if opts[:status] && !OCI::Optimizer::Models::OPTIMIZER_ENROLLMENT_STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::OPTIMIZER_ENROLLMENT_STATUS_ENUM.' end path = '/enrollmentStatus' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:status] = opts[:status] if opts[:status] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_enrollment_statuses') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::EnrollmentStatusCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_histories(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_histories API.
Lists changes to the recommendations based on user activity. For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated.
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 986 def list_histories(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_histories.' if logger raise "Missing the required parameter 'compartment_id' when calling list_histories." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_histories." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end if opts[:status] && !OCI::Optimizer::Models::STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.' end path = '/histories' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:name] = opts[:name] if opts[:name] query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name] query_params[:recommendationId] = opts[:recommendation_id] if opts[:recommendation_id] query_params[:resourceType] = opts[:resource_type] if opts[:resource_type] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:status] = opts[:status] if opts[:status] query_params[:includeResourceMetadata] = opts[:include_resource_metadata] if !opts[:include_resource_metadata].nil? # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_histories') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::HistoryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_profile_levels(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_profile_levels API.
Lists the existing profile levels.
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1085 def list_profile_levels(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_profile_levels.' if logger raise "Missing the required parameter 'compartment_id' when calling list_profile_levels." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_profile_levels." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end path = '/profileLevels' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:name] = opts[:name] if opts[:name] query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_profile_levels') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ProfileLevelCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_profiles(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_profiles API.
Lists the existing profiles.
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1168 def list_profiles(compartment_id, opts = {}) logger.debug 'Calling operation OptimizerClient#list_profiles.' if logger raise "Missing the required parameter 'compartment_id' when calling list_profiles." if compartment_id.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end path = '/profiles' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:name] = opts[:name] if opts[:name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_profiles') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ProfileCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_recommendation_strategies(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_recommendation_strategies API.
Lists the existing strategies.
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1256 def list_recommendation_strategies(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_recommendation_strategies.' if logger raise "Missing the required parameter 'compartment_id' when calling list_recommendation_strategies." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_recommendation_strategies." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end path = '/recommendationStrategies' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:name] = opts[:name] if opts[:name] query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_recommendation_strategies') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::RecommendationStrategyCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_recommendations(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_recommendations API.
Lists the Cloud Advisor recommendations that are currently supported.
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 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 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1373 def list_recommendations(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_recommendations.' if logger raise "Missing the required parameter 'compartment_id' when calling list_recommendations." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_recommendations." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end if opts[:status] && !OCI::Optimizer::Models::STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.' end path = '/recommendations' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:categoryId] = opts[:category_id] if opts[:category_id] query_params[:categoryName] = opts[:category_name] if opts[:category_name] query_params[:childTenancyIds] = OCI::ApiClient.build_collection_params(opts[:child_tenancy_ids], :multi) if opts[:child_tenancy_ids] && !opts[:child_tenancy_ids].empty? query_params[:includeOrganization] = opts[:include_organization] if !opts[:include_organization].nil? query_params[:name] = opts[:name] if opts[:name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:status] = opts[:status] if opts[:status] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_recommendations') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::RecommendationCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_resource_action_queryable_fields(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_resource_action_queryable_fields API.
Lists the fields that are indexed for querying and their associated value types.
1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1466 def list_resource_action_queryable_fields(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_resource_action_queryable_fields.' if logger raise "Missing the required parameter 'compartment_id' when calling list_resource_action_queryable_fields." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_resource_action_queryable_fields." if compartment_id_in_subtree.nil? path = '/resourceActions/actions/getQueryableFields' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_resource_action_queryable_fields') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::QueryableFieldCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_resource_actions(compartment_id, compartment_id_in_subtree, opts = {}) ⇒ Response
Click here to see an example of how to use list_resource_actions API.
Lists the Cloud Advisor resource actions that are supported.
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1573 def list_resource_actions(compartment_id, compartment_id_in_subtree, opts = {}) logger.debug 'Calling operation OptimizerClient#list_resource_actions.' if logger raise "Missing the required parameter 'compartment_id' when calling list_resource_actions." if compartment_id.nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_resource_actions." if compartment_id_in_subtree.nil? if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end if opts[:status] && !OCI::Optimizer::Models::STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.' end path = '/resourceActions' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:compartmentIdInSubtree] = compartment_id_in_subtree query_params[:recommendationId] = opts[:recommendation_id] if opts[:recommendation_id] query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name] query_params[:childTenancyIds] = OCI::ApiClient.build_collection_params(opts[:child_tenancy_ids], :multi) if opts[:child_tenancy_ids] && !opts[:child_tenancy_ids].empty? query_params[:includeOrganization] = opts[:include_organization] if !opts[:include_organization].nil? query_params[:name] = opts[:name] if opts[:name] query_params[:resourceType] = opts[:resource_type] if opts[:resource_type] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:status] = opts[:status] if opts[:status] query_params[:includeResourceMetadata] = opts[:include_resource_metadata] if !opts[:include_resource_metadata].nil? # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_resource_actions') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ResourceActionCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_work_request_errors(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_work_request_errors API.
Lists errors associated with the specified work request.
1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1664 def list_work_request_errors(work_request_id, opts = {}) logger.debug 'Calling operation OptimizerClient#list_work_request_errors.' if logger raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_work_request_errors') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::WorkRequestErrorCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_work_request_logs(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_work_request_logs API.
Lists the logs associated with the specified work request.
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1726 def list_work_request_logs(work_request_id, opts = {}) logger.debug 'Calling operation OptimizerClient#list_work_request_logs.' if logger raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_work_request_logs') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::WorkRequestLogEntryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_work_requests(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_work_requests API.
Lists the work requests in the tenancy. The tenancy is the root compartment.
1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1788 def list_work_requests(compartment_id, opts = {}) logger.debug 'Calling operation OptimizerClient#list_work_requests.' if logger raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil? path = '/workRequests' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#list_work_requests') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::WorkRequestCollection' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
96 97 98 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 96 def logger @api_client.config.logger end |
#update_enrollment_status(enrollment_status_id, update_enrollment_status_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_enrollment_status API.
Updates the enrollment status of the tenancy.
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1854 def update_enrollment_status(enrollment_status_id, update_enrollment_status_details, opts = {}) logger.debug 'Calling operation OptimizerClient#update_enrollment_status.' if logger raise "Missing the required parameter 'enrollment_status_id' when calling update_enrollment_status." if enrollment_status_id.nil? raise "Missing the required parameter 'update_enrollment_status_details' when calling update_enrollment_status." if update_enrollment_status_details.nil? raise "Parameter value for 'enrollment_status_id' must not be blank" if OCI::Internal::Util.blank_string?(enrollment_status_id) path = '/enrollmentStatus/{enrollmentStatusId}'.sub('{enrollmentStatusId}', enrollment_status_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_enrollment_status_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#update_enrollment_status') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::EnrollmentStatus' ) end # rubocop:enable Metrics/BlockLength end |
#update_profile(profile_id, update_profile_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_profile API.
Updates the specified profile. Uses the profile's OCID to determine which profile to update.
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1920 def update_profile(profile_id, update_profile_details, opts = {}) logger.debug 'Calling operation OptimizerClient#update_profile.' if logger raise "Missing the required parameter 'profile_id' when calling update_profile." if profile_id.nil? raise "Missing the required parameter 'update_profile_details' when calling update_profile." if update_profile_details.nil? raise "Parameter value for 'profile_id' must not be blank" if OCI::Internal::Util.blank_string?(profile_id) path = '/profiles/{profileId}'.sub('{profileId}', profile_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_profile_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#update_profile') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Profile' ) end # rubocop:enable Metrics/BlockLength end |
#update_recommendation(recommendation_id, update_recommendation_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_recommendation API.
Updates the recommendation that corresponds to the specified OCID. Use this operation to implement the following actions:
-
Postpone recommendation
-
Dismiss recommendation
-
Reactivate recommendation
1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 1991 def update_recommendation(recommendation_id, update_recommendation_details, opts = {}) logger.debug 'Calling operation OptimizerClient#update_recommendation.' if logger raise "Missing the required parameter 'recommendation_id' when calling update_recommendation." if recommendation_id.nil? raise "Missing the required parameter 'update_recommendation_details' when calling update_recommendation." if update_recommendation_details.nil? raise "Parameter value for 'recommendation_id' must not be blank" if OCI::Internal::Util.blank_string?(recommendation_id) path = '/recommendations/{recommendationId}'.sub('{recommendationId}', recommendation_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_recommendation_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#update_recommendation') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::Recommendation' ) end # rubocop:enable Metrics/BlockLength end |
#update_resource_action(resource_action_id, update_resource_action_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_resource_action API.
Updates the resource action that corresponds to the specified OCID. Use this operation to implement the following actions:
-
Postpone resource action
-
Ignore resource action
-
Reactivate resource action
2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 |
# File 'lib/oci/optimizer/optimizer_client.rb', line 2062 def update_resource_action(resource_action_id, update_resource_action_details, opts = {}) logger.debug 'Calling operation OptimizerClient#update_resource_action.' if logger raise "Missing the required parameter 'resource_action_id' when calling update_resource_action." if resource_action_id.nil? raise "Missing the required parameter 'update_resource_action_details' when calling update_resource_action." if update_resource_action_details.nil? raise "Parameter value for 'resource_action_id' must not be blank" if OCI::Internal::Util.blank_string?(resource_action_id) path = '/resourceActions/{resourceActionId}'.sub('{resourceActionId}', resource_action_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_resource_action_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'OptimizerClient#update_resource_action') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Optimizer::Models::ResourceAction' ) end # rubocop:enable Metrics/BlockLength end |