Class: OCI::DataFlow::DataFlowClient
- Inherits:
-
Object
- Object
- OCI::DataFlow::DataFlowClient
- Defined in:
- lib/oci/data_flow/data_flow_client.rb
Overview
Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure.
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
-
#change_application_compartment(application_id, change_application_compartment_details, opts = {}) ⇒ Response
Moves an application into a different compartment.
-
#change_run_compartment(run_id, change_run_compartment_details, opts = {}) ⇒ Response
Moves a run into a different compartment.
-
#create_application(create_application_details, opts = {}) ⇒ Response
Creates an application.
-
#create_run(create_run_details, opts = {}) ⇒ Response
Creates a run for an application.
-
#delete_application(application_id, opts = {}) ⇒ Response
Deletes an application using an
applicationId
. -
#delete_run(run_id, opts = {}) ⇒ Response
Cancels the specified run if it has not already completed or was previously cancelled.
-
#get_application(application_id, opts = {}) ⇒ Response
Retrieves an application using an
applicationId
. -
#get_run(run_id, opts = {}) ⇒ Response
Retrieves the run for the specified
runId
. -
#get_run_log(run_id, name, opts = {}, &block) ⇒ Response
Retrieves the content of an run log.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DataFlowClient
constructor
Creates a new DataFlowClient.
-
#list_applications(compartment_id, opts = {}) ⇒ Response
Lists all applications in the specified compartment.
-
#list_run_logs(run_id, opts = {}) ⇒ Response
Retrieves summaries of the run's logs.
-
#list_runs(compartment_id, opts = {}) ⇒ Response
Lists all runs of an application in the specified compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#update_application(update_application_details, application_id, opts = {}) ⇒ Response
Updates an application using an
applicationId
. -
#update_run(update_run_details, run_id, opts = {}) ⇒ Response
Updates a run using a
runId
.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DataFlowClient
Creates a new DataFlowClient. 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.
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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 53 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) 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 + '/20200129' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "DataFlowClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
13 14 15 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 13 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
17 18 19 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 17 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
27 28 29 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 27 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
23 24 25 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 23 def retry_config @retry_config end |
Instance Method Details
#change_application_compartment(application_id, change_application_compartment_details, opts = {}) ⇒ Response
Moves an application into a different compartment. When provided, If-Match is checked against ETag values of the resource. Associated resources, like runs, will not be automatically moved.
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 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 133 def change_application_compartment(application_id, change_application_compartment_details, opts = {}) logger.debug 'Calling operation DataFlowClient#change_application_compartment.' if logger raise "Missing the required parameter 'application_id' when calling change_application_compartment." if application_id.nil? raise "Missing the required parameter 'change_application_compartment_details' when calling change_application_compartment." if change_application_compartment_details.nil? raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id) path = '/applications/{applicationId}/actions/changeCompartment'.sub('{applicationId}', application_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] 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(change_application_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#change_application_compartment') 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 |
#change_run_compartment(run_id, change_run_compartment_details, opts = {}) ⇒ Response
Moves a run into a different compartment. When provided, If-Match is checked against ETag values of the resource. Associated resources, like historical metrics, will not be automatically moved. The run must be in a terminal state (CANCELED, FAILED, SUCCEEDED) in order for it to be moved to a different compartment
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 207 def change_run_compartment(run_id, change_run_compartment_details, opts = {}) logger.debug 'Calling operation DataFlowClient#change_run_compartment.' if logger raise "Missing the required parameter 'run_id' when calling change_run_compartment." if run_id.nil? raise "Missing the required parameter 'change_run_compartment_details' when calling change_run_compartment." if change_run_compartment_details.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) path = '/runs/{runId}/actions/changeCompartment'.sub('{runId}', run_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] 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(change_run_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#change_run_compartment') 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_application(create_application_details, opts = {}) ⇒ Response
Creates an application.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 272 def create_application(create_application_details, opts = {}) logger.debug 'Calling operation DataFlowClient#create_application.' if logger raise "Missing the required parameter 'create_application_details' when calling create_application." if create_application_details.nil? path = '/applications' 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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_application_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#create_application') 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::DataFlow::Models::Application' ) end # rubocop:enable Metrics/BlockLength end |
#create_run(create_run_details, opts = {}) ⇒ Response
Creates a run for an application.
335 336 337 338 339 340 341 342 343 344 345 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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 335 def create_run(create_run_details, opts = {}) logger.debug 'Calling operation DataFlowClient#create_run.' if logger raise "Missing the required parameter 'create_run_details' when calling create_run." if create_run_details.nil? path = '/runs' 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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_run_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#create_run') 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::DataFlow::Models::Run' ) end # rubocop:enable Metrics/BlockLength end |
#delete_application(application_id, opts = {}) ⇒ Response
Deletes an application using an applicationId
.
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 397 def delete_application(application_id, opts = {}) logger.debug 'Calling operation DataFlowClient#delete_application.' if logger raise "Missing the required parameter 'application_id' when calling delete_application." if application_id.nil? raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id) path = '/applications/{applicationId}'.sub('{applicationId}', application_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: 'DataFlowClient#delete_application') 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 |
#delete_run(run_id, opts = {}) ⇒ Response
Cancels the specified run if it has not already completed or was previously cancelled. If a run is in progress, the executing job will be killed.
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 492 493 494 495 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 459 def delete_run(run_id, opts = {}) logger.debug 'Calling operation DataFlowClient#delete_run.' if logger raise "Missing the required parameter 'run_id' when calling delete_run." if run_id.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) path = '/runs/{runId}'.sub('{runId}', run_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: 'DataFlowClient#delete_run') 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_application(application_id, opts = {}) ⇒ Response
Retrieves an application using an applicationId
.
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 549 550 551 552 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 516 def get_application(application_id, opts = {}) logger.debug 'Calling operation DataFlowClient#get_application.' if logger raise "Missing the required parameter 'application_id' when calling get_application." if application_id.nil? raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id) path = '/applications/{applicationId}'.sub('{applicationId}', application_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: 'DataFlowClient#get_application') 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::DataFlow::Models::Application' ) end # rubocop:enable Metrics/BlockLength end |
#get_run(run_id, opts = {}) ⇒ Response
Retrieves the run for the specified runId
.
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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 573 def get_run(run_id, opts = {}) logger.debug 'Calling operation DataFlowClient#get_run.' if logger raise "Missing the required parameter 'run_id' when calling get_run." if run_id.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) path = '/runs/{runId}'.sub('{runId}', run_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: 'DataFlowClient#get_run') 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::DataFlow::Models::Run' ) end # rubocop:enable Metrics/BlockLength end |
#get_run_log(run_id, name, opts = {}, &block) ⇒ Response
Retrieves the content of an run log.
634 635 636 637 638 639 640 641 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 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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 634 def get_run_log(run_id, name, opts = {}, &block) logger.debug 'Calling operation DataFlowClient#get_run_log.' if logger raise "Missing the required parameter 'run_id' when calling get_run_log." if run_id.nil? raise "Missing the required parameter 'name' when calling get_run_log." if name.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) raise "Parameter value for 'name' must not be blank" if OCI::Internal::Util.blank_string?(name) path = '/runs/{runId}/logs/{name}'.sub('{runId}', run_id.to_s).sub('{name}', name.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: 'DataFlowClient#get_run_log') 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_applications(compartment_id, opts = {}) ⇒ Response
Lists all applications in the specified compartment.
Allowed values are: timeCreated, displayName, language
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 754 def list_applications(compartment_id, opts = {}) logger.debug 'Calling operation DataFlowClient#list_applications.' if logger raise "Missing the required parameter 'compartment_id' when calling list_applications." if compartment_id.nil? if opts[:sort_by] && !%w[timeCreated displayName language].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeCreated, displayName, language.' 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 = '/applications' 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[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:ownerPrincipalId] = opts[:owner_principal_id] if opts[:owner_principal_id] query_params[:displayNameStartsWith] = opts[:display_name_starts_with] if opts[:display_name_starts_with] # 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: 'DataFlowClient#list_applications') 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::DataFlow::Models::ApplicationSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_run_logs(run_id, opts = {}) ⇒ Response
Retrieves summaries of the run's logs.
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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 831 def list_run_logs(run_id, opts = {}) logger.debug 'Calling operation DataFlowClient#list_run_logs.' if logger raise "Missing the required parameter 'run_id' when calling list_run_logs." if run_id.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) path = '/runs/{runId}/logs'.sub('{runId}', run_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} 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: 'DataFlowClient#list_run_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::DataFlow::Models::RunLogSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_runs(compartment_id, opts = {}) ⇒ Response
Lists all runs of an application in the specified compartment.
Allowed values are: timeCreated, displayName, language, runDurationInMilliseconds, lifecycleState, totalOCpu, dataReadInBytes, dataWrittenInBytes
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 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 913 def list_runs(compartment_id, opts = {}) logger.debug 'Calling operation DataFlowClient#list_runs.' if logger raise "Missing the required parameter 'compartment_id' when calling list_runs." if compartment_id.nil? if opts[:lifecycle_state] && !OCI::DataFlow::Models::RUN_LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::DataFlow::Models::RUN_LIFECYCLE_STATE_ENUM.' end if opts[:sort_by] && !%w[timeCreated displayName language runDurationInMilliseconds lifecycleState totalOCpu dataReadInBytes dataWrittenInBytes].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeCreated, displayName, language, runDurationInMilliseconds, lifecycleState, totalOCpu, dataReadInBytes, dataWrittenInBytes.' 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 = '/runs' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:applicationId] = opts[:application_id] if opts[:application_id] query_params[:ownerPrincipalId] = opts[:owner_principal_id] if opts[:owner_principal_id] query_params[:displayNameStartsWith] = opts[:display_name_starts_with] if opts[:display_name_starts_with] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:timeCreatedGreaterThan] = opts[:time_created_greater_than] if opts[:time_created_greater_than] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:displayName] = opts[:display_name] if opts[:display_name] # 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: 'DataFlowClient#list_runs') 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::DataFlow::Models::RunSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
101 102 103 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 101 def logger @api_client.config.logger end |
#update_application(update_application_details, application_id, opts = {}) ⇒ Response
Updates an application using an applicationId
.
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 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 998 def update_application(update_application_details, application_id, opts = {}) logger.debug 'Calling operation DataFlowClient#update_application.' if logger raise "Missing the required parameter 'update_application_details' when calling update_application." if update_application_details.nil? raise "Missing the required parameter 'application_id' when calling update_application." if application_id.nil? raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id) path = '/applications/{applicationId}'.sub('{applicationId}', application_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_application_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#update_application') 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::DataFlow::Models::Application' ) end # rubocop:enable Metrics/BlockLength end |
#update_run(update_run_details, run_id, opts = {}) ⇒ Response
Updates a run using a runId
.
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 |
# File 'lib/oci/data_flow/data_flow_client.rb', line 1063 def update_run(update_run_details, run_id, opts = {}) logger.debug 'Calling operation DataFlowClient#update_run.' if logger raise "Missing the required parameter 'update_run_details' when calling update_run." if update_run_details.nil? raise "Missing the required parameter 'run_id' when calling update_run." if run_id.nil? raise "Parameter value for 'run_id' must not be blank" if OCI::Internal::Util.blank_string?(run_id) path = '/runs/{runId}'.sub('{runId}', run_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_run_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'DataFlowClient#update_run') 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::DataFlow::Models::Run' ) end # rubocop:enable Metrics/BlockLength end |