class OCI::Devops::DevopsClientCompositeOperations

This class provides a wrapper around {OCI::Devops::DevopsClient} and offers convenience methods for operations that would otherwise need to be chained together. For example, instead of performing an action on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource to enter a given state, you can call a single method in this class to accomplish the same functionality

Attributes

service_client[R]

The {OCI::Devops::DevopsClient} used to communicate with the service_client

@return [OCI::Devops::DevopsClient]

Public Class Methods

new(service_client = OCI::Devops::DevopsClient.new) click to toggle source

Initializes a new DevopsClientCompositeOperations

@param [OCI::Devops::DevopsClient] service_client The client used to communicate with the service.

Defaults to a new service client created via {OCI::Devops::DevopsClient#initialize} with no arguments
# File lib/oci/devops/devops_client_composite_operations.rb, line 20
def initialize(service_client = OCI::Devops::DevopsClient.new)
  @service_client = service_client
end

Public Instance Methods

approve_deployment_and_wait_for_state(deployment_id, approve_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#approve_deployment} and then waits for the {OCI::Devops::Models::Deployment} acted upon to enter the given state(s).

@param [String] deployment_id Unique deployment identifier. @param [OCI::Devops::Models::ApproveDeploymentDetails] approve_deployment_details The stage information for approval. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::Deployment#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#approve_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object with data of type {OCI::Devops::Models::Deployment}

# File lib/oci/devops/devops_client_composite_operations.rb, line 40
def approve_deployment_and_wait_for_state(deployment_id, approve_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.approve_deployment(deployment_id, approve_deployment_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_deployment(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
cancel_deployment_and_wait_for_state(deployment_id, cancel_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#cancel_deployment} and then waits for the {OCI::Devops::Models::Deployment} acted upon to enter the given state(s).

@param [String] deployment_id Unique deployment identifier. @param [OCI::Devops::Models::CancelDeploymentDetails] cancel_deployment_details The information regarding the deployment to be canceled. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::Deployment#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#cancel_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object with data of type {OCI::Devops::Models::Deployment}

# File lib/oci/devops/devops_client_composite_operations.rb, line 80
def cancel_deployment_and_wait_for_state(deployment_id, cancel_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.cancel_deployment(deployment_id, cancel_deployment_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_deployment(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
change_project_compartment_and_wait_for_state(project_id, change_project_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#change_project_compartment} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] project_id Unique project identifier. @param [OCI::Devops::Models::ChangeProjectCompartmentDetails] change_project_compartment_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#change_project_compartment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 120
def change_project_compartment_and_wait_for_state(project_id, change_project_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_project_compartment(project_id, change_project_compartment_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deploy_artifact_and_wait_for_state(create_deploy_artifact_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_deploy_artifact} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [OCI::Devops::Models::CreateDeployArtifactDetails] create_deploy_artifact_details Details for the new deployment artifact. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_deploy_artifact} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 169
def create_deploy_artifact_and_wait_for_state(create_deploy_artifact_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deploy_artifact(create_deploy_artifact_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deploy_environment_and_wait_for_state(create_deploy_environment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_deploy_environment} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [OCI::Devops::Models::CreateDeployEnvironmentDetails] create_deploy_environment_details Details for the new deployment environment. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_deploy_environment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 218
def create_deploy_environment_and_wait_for_state(create_deploy_environment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deploy_environment(create_deploy_environment_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deploy_pipeline_and_wait_for_state(create_deploy_pipeline_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_deploy_pipeline} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [OCI::Devops::Models::CreateDeployPipelineDetails] create_deploy_pipeline_details Details for the new deployment pipeline. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_deploy_pipeline} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 267
def create_deploy_pipeline_and_wait_for_state(create_deploy_pipeline_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deploy_pipeline(create_deploy_pipeline_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deploy_stage_and_wait_for_state(create_deploy_stage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_deploy_stage} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [OCI::Devops::Models::CreateDeployStageDetails] create_deploy_stage_details Details for the new DeployStage. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_deploy_stage} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 316
def create_deploy_stage_and_wait_for_state(create_deploy_stage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deploy_stage(create_deploy_stage_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deployment_and_wait_for_state(create_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_deployment} and then waits for the {OCI::Devops::Models::Deployment} acted upon to enter the given state(s).

@param [OCI::Devops::Models::CreateDeploymentDetails] create_deployment_details Details for the new deployment. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::Deployment#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object with data of type {OCI::Devops::Models::Deployment}

# File lib/oci/devops/devops_client_composite_operations.rb, line 365
def create_deployment_and_wait_for_state(create_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deployment(create_deployment_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_deployment(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_project_and_wait_for_state(create_project_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#create_project} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [OCI::Devops::Models::CreateProjectDetails] create_project_details Details for the new project. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#create_project} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 404
def create_project_and_wait_for_state(create_project_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_project(create_project_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deploy_artifact_and_wait_for_state(deploy_artifact_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#delete_deploy_artifact} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_artifact_id Unique artifact identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#delete_deploy_artifact} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 453
def delete_deploy_artifact_and_wait_for_state(deploy_artifact_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deploy_artifact(deploy_artifact_id, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deploy_environment_and_wait_for_state(deploy_environment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#delete_deploy_environment} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_environment_id Unique environment identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#delete_deploy_environment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 502
def delete_deploy_environment_and_wait_for_state(deploy_environment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deploy_environment(deploy_environment_id, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deploy_pipeline_and_wait_for_state(deploy_pipeline_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#delete_deploy_pipeline} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_pipeline_id Unique pipeline identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#delete_deploy_pipeline} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 551
def delete_deploy_pipeline_and_wait_for_state(deploy_pipeline_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deploy_pipeline(deploy_pipeline_id, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deploy_stage_and_wait_for_state(deploy_stage_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#delete_deploy_stage} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_stage_id Unique stage identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#delete_deploy_stage} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 600
def delete_deploy_stage_and_wait_for_state(deploy_stage_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deploy_stage(deploy_stage_id, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_project_and_wait_for_state(project_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#delete_project} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] project_id Unique project identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#delete_project} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 649
def delete_project_and_wait_for_state(project_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_project(project_id, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deploy_artifact_and_wait_for_state(deploy_artifact_id, update_deploy_artifact_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_deploy_artifact} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_artifact_id Unique artifact identifier. @param [OCI::Devops::Models::UpdateDeployArtifactDetails] update_deploy_artifact_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_deploy_artifact} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 699
def update_deploy_artifact_and_wait_for_state(deploy_artifact_id, update_deploy_artifact_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deploy_artifact(deploy_artifact_id, update_deploy_artifact_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deploy_environment_and_wait_for_state(deploy_environment_id, update_deploy_environment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_deploy_environment} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_environment_id Unique environment identifier. @param [OCI::Devops::Models::UpdateDeployEnvironmentDetails] update_deploy_environment_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_deploy_environment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 749
def update_deploy_environment_and_wait_for_state(deploy_environment_id, update_deploy_environment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deploy_environment(deploy_environment_id, update_deploy_environment_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deploy_pipeline_and_wait_for_state(deploy_pipeline_id, update_deploy_pipeline_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_deploy_pipeline} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_pipeline_id Unique pipeline identifier. @param [OCI::Devops::Models::UpdateDeployPipelineDetails] update_deploy_pipeline_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_deploy_pipeline} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 799
def update_deploy_pipeline_and_wait_for_state(deploy_pipeline_id, update_deploy_pipeline_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deploy_pipeline(deploy_pipeline_id, update_deploy_pipeline_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deploy_stage_and_wait_for_state(deploy_stage_id, update_deploy_stage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_deploy_stage} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] deploy_stage_id Unique stage identifier. @param [OCI::Devops::Models::UpdateDeployStageDetails] update_deploy_stage_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_deploy_stage} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 849
def update_deploy_stage_and_wait_for_state(deploy_stage_id, update_deploy_stage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deploy_stage(deploy_stage_id, update_deploy_stage_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deployment_and_wait_for_state(deployment_id, update_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_deployment} and then waits for the {OCI::Devops::Models::Deployment} acted upon to enter the given state(s).

@param [String] deployment_id Unique deployment identifier. @param [OCI::Devops::Models::UpdateDeploymentDetails] update_deployment_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::Deployment#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object with data of type {OCI::Devops::Models::Deployment}

# File lib/oci/devops/devops_client_composite_operations.rb, line 899
def update_deployment_and_wait_for_state(deployment_id, update_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deployment(deployment_id, update_deployment_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_deployment(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_project_and_wait_for_state(project_id, update_project_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Devops::DevopsClient#update_project} and then waits for the {OCI::Devops::Models::WorkRequest} to enter the given state(s).

@param [String] project_id Unique project identifier. @param [OCI::Devops::Models::UpdateProjectDetails] update_project_details The information to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Devops::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Devops::DevopsClient#update_project} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::Devops::Models::WorkRequest}

# File lib/oci/devops/devops_client_composite_operations.rb, line 939
def update_project_and_wait_for_state(project_id, update_project_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_project(project_id, update_project_details, base_operation_opts)
  use_util = OCI::Devops::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Devops::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end