Class: OCI::ResourceManager::ResourceManagerClient
- Inherits:
-
Object
- Object
- OCI::ResourceManager::ResourceManagerClient
- Defined in:
- lib/oci/resource_manager/resource_manager_client.rb
Overview
API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see [Overview of Resource Manager](/iaas/Content/ResourceManager/Concepts/resourcemanager.htm).
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 OCI::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
-
#cancel_job(job_id, opts = {}) ⇒ Response
Indicates the intention to cancel the specified job.
-
#create_job(create_job_details, opts = {}) ⇒ Response
Creates a job.
-
#create_stack(create_stack_details, opts = {}) ⇒ Response
Creates a stack in the specified comparment.
-
#delete_stack(stack_id, opts = {}) ⇒ Response
Deletes the specified stack object.
-
#get_job(job_id, opts = {}) ⇒ Response
Returns the specified job along with the job details.
-
#get_job_logs(job_id, opts = {}) ⇒ Response
Returns log entries for the specified job in JSON format.
-
#get_job_logs_content(job_id, opts = {}) ⇒ Response
Returns raw log file for the specified job in text format.
-
#get_job_tf_config(job_id, opts = {}, &block) ⇒ Response
Returns the Terraform configuration file for the specified job in .zip format.
-
#get_job_tf_state(job_id, opts = {}, &block) ⇒ Response
Returns the Terraform state for the specified job.
-
#get_stack(stack_id, opts = {}) ⇒ Response
Gets a stack using the stack ID.
-
#get_stack_tf_config(stack_id, opts = {}, &block) ⇒ Response
Returns the Terraform configuration file in .zip format for the specified stack.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ResourceManagerClient
constructor
Creates a new ResourceManagerClient.
-
#list_jobs(opts = {}) ⇒ Response
Returns a list of jobs in a stack or compartment, ordered by time created.
-
#list_stacks(opts = {}) ⇒ Response
Returns a list of stacks.
-
#logger ⇒ Logger
The logger for this client.
-
#update_job(job_id, update_job_details, opts = {}) ⇒ Response
Updates the specified job.
-
#update_stack(stack_id, update_stack_details, opts = {}) ⇒ Response
Updates the specified stack object.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ResourceManagerClient
Creates a new ResourceManagerClient. 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.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 52 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals) # 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 unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) if signer.nil? signer = OCI::Signer.new( config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content ) end @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20180917' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "ResourceManagerClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
12 13 14 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 16 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in OCI::Regions::REGION_ENUM.
26 27 28 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 26 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
22 23 24 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 22 def retry_config @retry_config end |
Instance Method Details
#cancel_job(job_id, opts = {}) ⇒ Response
Indicates the intention to cancel the specified job. Cancellation of the job is not immediate, and may be delayed, or may not happen at all.
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 162 163 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 127 def cancel_job(job_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#cancel_job.' if logger raise "Missing the required parameter 'job_id' when calling cancel_job." if job_id.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}'.sub('{jobId}', job_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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#cancel_job') 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 |
#create_job(create_job_details, opts = {}) ⇒ Response
Creates a job.
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/resource_manager/resource_manager_client.rb', line 188 def create_job(create_job_details, opts = {}) logger.debug 'Calling operation ResourceManagerClient#create_job.' if logger raise "Missing the required parameter 'create_job_details' when calling create_job." if create_job_details.nil? path = '/jobs' 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_job_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#create_job') 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::ResourceManager::Models::Job' ) end # rubocop:enable Metrics/BlockLength end |
#create_stack(create_stack_details, opts = {}) ⇒ Response
Creates a stack in the specified comparment. Specify the compartment using the compartment ID.
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 289 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 252 def create_stack(create_stack_details, opts = {}) logger.debug 'Calling operation ResourceManagerClient#create_stack.' if logger raise "Missing the required parameter 'create_stack_details' when calling create_stack." if create_stack_details.nil? path = '/stacks' 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_stack_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#create_stack') 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::ResourceManager::Models::Stack' ) end # rubocop:enable Metrics/BlockLength end |
#delete_stack(stack_id, opts = {}) ⇒ Response
Deletes the specified stack object.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 312 def delete_stack(stack_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#delete_stack.' if logger raise "Missing the required parameter 'stack_id' when calling delete_stack." if stack_id.nil? raise "Parameter value for 'stack_id' must not be blank" if OCI::Internal::Util.blank_string?(stack_id) path = '/stacks/{stackId}'.sub('{stackId}', stack_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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#delete_stack') 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 |
#get_job(job_id, opts = {}) ⇒ Response
Returns the specified job along with the job details.
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 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 367 def get_job(job_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#get_job.' if logger raise "Missing the required parameter 'job_id' when calling get_job." if job_id.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}'.sub('{jobId}', job_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: 'ResourceManagerClient#get_job') 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::ResourceManager::Models::Job' ) end # rubocop:enable Metrics/BlockLength end |
#get_job_logs(job_id, opts = {}) ⇒ Response
Returns log entries for the specified job in JSON format.
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 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 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 440 def get_job_logs(job_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#get_job_logs.' if logger raise "Missing the required parameter 'job_id' when calling get_job_logs." if job_id.nil? if opts[:level_greater_than_or_equal_to] && !OCI::ResourceManager::Models::LogEntry::LEVEL_ENUM.include?(opts[:level_greater_than_or_equal_to]) raise 'Invalid value for "level_greater_than_or_equal_to", must be one of the values in OCI::ResourceManager::Models::LogEntry::LEVEL_ENUM.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}/logs'.sub('{jobId}', job_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:type] = OCI::ApiClient.build_collection_params(opts[:type], :multi) if opts[:type] && !opts[:type].empty? query_params[:levelGreaterThanOrEqualTo] = opts[:level_greater_than_or_equal_to] if opts[:level_greater_than_or_equal_to] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:timestampGreaterThanOrEqualTo] = opts[:timestamp_greater_than_or_equal_to] if opts[:timestamp_greater_than_or_equal_to] query_params[:timestampLessThanOrEqualTo] = opts[:timestamp_less_than_or_equal_to] if opts[:timestamp_less_than_or_equal_to] # 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: 'ResourceManagerClient#get_job_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: 'Array<OCI::ResourceManager::Models::LogEntry>' ) end # rubocop:enable Metrics/BlockLength end |
#get_job_logs_content(job_id, opts = {}) ⇒ Response
Returns raw log file for the specified job in text format. Returns a maximum of 100,000 log entries.
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 512 def get_job_logs_content(job_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#get_job_logs_content.' if logger raise "Missing the required parameter 'job_id' when calling get_job_logs_content." if job_id.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}/logs/content'.sub('{jobId}', job_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'text/plain; charset=utf-8' 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: 'ResourceManagerClient#get_job_logs_content') 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: 'String' ) end # rubocop:enable Metrics/BlockLength end |
#get_job_tf_config(job_id, opts = {}, &block) ⇒ Response
Returns the Terraform configuration file for the specified job in .zip format. Returns an error if no zip file is found.
571 572 573 574 575 576 577 578 579 580 581 582 583 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 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 571 def get_job_tf_config(job_id, opts = {}, &block) logger.debug 'Calling operation ResourceManagerClient#get_job_tf_config.' if logger raise "Missing the required parameter 'job_id' when calling get_job_tf_config." if job_id.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}/tfConfig'.sub('{jobId}', job_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = opts[:accept] if opts[:accept] header_params[:accept] ||= 'application/zip' header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding] 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: 'ResourceManagerClient#get_job_tf_config') do if !block.nil? @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: 'Stream', &block ) elsif opts[:response_target] if opts[:response_target].respond_to? :write @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: 'Stream', &proc { |chunk, _response| opts[:response_target].write(chunk) } ) elsif opts[:response_target].is_a?(String) File.open(opts[:response_target], 'wb') do |output| return @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: 'Stream', &proc { |chunk, _response| output.write(chunk) } ) end end else @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: 'String' ) end end # rubocop:enable Metrics/BlockLength end |
#get_job_tf_state(job_id, opts = {}, &block) ⇒ Response
Returns the Terraform state for the specified job.
672 673 674 675 676 677 678 679 680 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 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 672 def get_job_tf_state(job_id, opts = {}, &block) logger.debug 'Calling operation ResourceManagerClient#get_job_tf_state.' if logger raise "Missing the required parameter 'job_id' when calling get_job_tf_state." if job_id.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}/tfState'.sub('{jobId}', job_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = opts[:accept] if opts[:accept] header_params[:accept] ||= 'application/octet-stream' header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding] 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: 'ResourceManagerClient#get_job_tf_state') do if !block.nil? @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: 'Stream', &block ) elsif opts[:response_target] if opts[:response_target].respond_to? :write @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: 'Stream', &proc { |chunk, _response| opts[:response_target].write(chunk) } ) elsif opts[:response_target].is_a?(String) File.open(opts[:response_target], 'wb') do |output| return @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: 'Stream', &proc { |chunk, _response| output.write(chunk) } ) end end else @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: 'String' ) end end # rubocop:enable Metrics/BlockLength end |
#get_stack(stack_id, opts = {}) ⇒ Response
Gets a stack using the stack ID.
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 805 806 807 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 771 def get_stack(stack_id, opts = {}) logger.debug 'Calling operation ResourceManagerClient#get_stack.' if logger raise "Missing the required parameter 'stack_id' when calling get_stack." if stack_id.nil? raise "Parameter value for 'stack_id' must not be blank" if OCI::Internal::Util.blank_string?(stack_id) path = '/stacks/{stackId}'.sub('{stackId}', stack_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: 'ResourceManagerClient#get_stack') 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::ResourceManager::Models::Stack' ) end # rubocop:enable Metrics/BlockLength end |
#get_stack_tf_config(stack_id, opts = {}, &block) ⇒ Response
Returns the Terraform configuration file in .zip format for the specified stack. Returns an error if no zip file is found.
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 855 856 857 858 859 860 861 862 863 864 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 900 901 902 903 904 905 906 907 908 909 910 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 830 def get_stack_tf_config(stack_id, opts = {}, &block) logger.debug 'Calling operation ResourceManagerClient#get_stack_tf_config.' if logger raise "Missing the required parameter 'stack_id' when calling get_stack_tf_config." if stack_id.nil? raise "Parameter value for 'stack_id' must not be blank" if OCI::Internal::Util.blank_string?(stack_id) path = '/stacks/{stackId}/tfConfig'.sub('{stackId}', stack_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = opts[:accept] if opts[:accept] header_params[:accept] ||= 'application/zip' header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding] 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: 'ResourceManagerClient#get_stack_tf_config') do if !block.nil? @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: 'Stream', &block ) elsif opts[:response_target] if opts[:response_target].respond_to? :write @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: 'Stream', &proc { |chunk, _response| opts[:response_target].write(chunk) } ) elsif opts[:response_target].is_a?(String) File.open(opts[:response_target], 'wb') do |output| return @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: 'Stream', &proc { |chunk, _response| output.write(chunk) } ) end end else @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: 'String' ) end end # rubocop:enable Metrics/BlockLength end |
#list_jobs(opts = {}) ⇒ Response
Returns a list of jobs in a stack or compartment, ordered by time created.
-
To list all jobs in a stack, provide the stack OCID.
-
To list all jobs in a compartment, provide the compartment OCID.
-
To return a specific job, provide the job OCID.
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 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 964 def list_jobs(opts = {}) logger.debug 'Calling operation ResourceManagerClient#list_jobs.' if logger if opts[:lifecycle_state] && !OCI::ResourceManager::Models::Job::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::ResourceManager::Models::Job::LIFECYCLE_STATE_ENUM.' end if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end path = '/jobs' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:stackId] = opts[:stack_id] if opts[:stack_id] query_params[:id] = opts[:id] if opts[:id] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] 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: 'ResourceManagerClient#list_jobs') 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: 'Array<OCI::ResourceManager::Models::JobSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_stacks(opts = {}) ⇒ Response
Returns a list of stacks.
-
If called using the compartment ID, returns all stacks in the specified compartment.
-
If called using the stack ID, returns the specified stack.
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 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 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 1068 def list_stacks(opts = {}) logger.debug 'Calling operation ResourceManagerClient#list_stacks.' if logger if opts[:lifecycle_state] && !OCI::ResourceManager::Models::Stack::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::ResourceManager::Models::Stack::LIFECYCLE_STATE_ENUM.' end if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end path = '/stacks' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:id] = opts[:id] if opts[:id] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] 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: 'ResourceManagerClient#list_stacks') 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: 'Array<OCI::ResourceManager::Models::StackSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
102 103 104 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 102 def logger @api_client.config.logger end |
#update_job(job_id, update_job_details, opts = {}) ⇒ Response
Updates the specified job.
1146 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 1182 1183 1184 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 1146 def update_job(job_id, update_job_details, opts = {}) logger.debug 'Calling operation ResourceManagerClient#update_job.' if logger raise "Missing the required parameter 'job_id' when calling update_job." if job_id.nil? raise "Missing the required parameter 'update_job_details' when calling update_job." if update_job_details.nil? raise "Parameter value for 'job_id' must not be blank" if OCI::Internal::Util.blank_string?(job_id) path = '/jobs/{jobId}'.sub('{jobId}', job_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_job_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#update_job') 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::ResourceManager::Models::Job' ) end # rubocop:enable Metrics/BlockLength end |
#update_stack(stack_id, update_stack_details, opts = {}) ⇒ Response
Updates the specified stack object. Use UpdateStack when you update your Terraform configuration and want your changes to be reflected in the execution plan.
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
# File 'lib/oci/resource_manager/resource_manager_client.rb', line 1212 def update_stack(stack_id, update_stack_details, opts = {}) logger.debug 'Calling operation ResourceManagerClient#update_stack.' if logger raise "Missing the required parameter 'stack_id' when calling update_stack." if stack_id.nil? raise "Missing the required parameter 'update_stack_details' when calling update_stack." if update_stack_details.nil? raise "Parameter value for 'stack_id' must not be blank" if OCI::Internal::Util.blank_string?(stack_id) path = '/stacks/{stackId}'.sub('{stackId}', stack_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_stack_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ResourceManagerClient#update_stack') 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::ResourceManager::Models::Stack' ) end # rubocop:enable Metrics/BlockLength end |