OptimizerClientCompositeOperations

class oci.optimizer.OptimizerClientCompositeOperations(client, **kwargs)

This class provides a wrapper around OptimizerClient 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

Methods:

__init__(client, **kwargs)

Creates a new OptimizerClientCompositeOperations object

bulk_apply_recommendations_and_wait_for_state(...)

Calls bulk_apply_recommendations() and waits for the WorkRequest to enter the given state(s).

create_profile_and_wait_for_state(...[, ...])

Calls create_profile() and waits for the Profile acted upon to enter the given state(s).

delete_profile_and_wait_for_state(profile_id)

Calls delete_profile() and waits for the Profile acted upon to enter the given state(s).

update_enrollment_status_and_wait_for_state(...)

Calls update_enrollment_status() and waits for the EnrollmentStatus acted upon to enter the given state(s).

update_profile_and_wait_for_state(...[, ...])

Calls update_profile() and waits for the Profile acted upon to enter the given state(s).

update_recommendation_and_wait_for_state(...)

Calls update_recommendation() and waits for the Recommendation acted upon to enter the given state(s).

update_resource_action_and_wait_for_state(...)

Calls update_resource_action() and waits for the ResourceAction acted upon to enter the given state(s).

__init__(client, **kwargs)

Creates a new OptimizerClientCompositeOperations object

Parameters

client (OptimizerClient) – The service client which will be wrapped by this object

bulk_apply_recommendations_and_wait_for_state(recommendation_id, bulk_apply_recommendations_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls bulk_apply_recommendations() and waits for the WorkRequest to enter the given state(s).

Parameters
  • recommendation_id (str) – (required) The unique OCID associated with the recommendation.

  • bulk_apply_recommendations_details (oci.optimizer.models.BulkApplyRecommendationsDetails) – (required) Details about bulk recommendation actions.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for status

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to bulk_apply_recommendations()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

create_profile_and_wait_for_state(create_profile_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls create_profile() and waits for the Profile acted upon to enter the given state(s).

Parameters
  • create_profile_details (oci.optimizer.models.CreateProfileDetails) – (required) Details for creating the profile.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to create_profile()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

delete_profile_and_wait_for_state(profile_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls delete_profile() and waits for the Profile acted upon to enter the given state(s).

Parameters
  • profile_id (str) – (required) The unique OCID of the profile.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to delete_profile()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

update_enrollment_status_and_wait_for_state(enrollment_status_id, update_enrollment_status_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls update_enrollment_status() and waits for the EnrollmentStatus acted upon to enter the given state(s).

Parameters
  • enrollment_status_id (str) – (required) The unique OCID associated with the enrollment status.

  • update_enrollment_status_details (oci.optimizer.models.UpdateEnrollmentStatusDetails) – (required) The request object for updating the enrollment status.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to update_enrollment_status()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

update_profile_and_wait_for_state(profile_id, update_profile_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls update_profile() and waits for the Profile acted upon to enter the given state(s).

Parameters
  • profile_id (str) – (required) The unique OCID of the profile.

  • update_profile_details (oci.optimizer.models.UpdateProfileDetails) – (required) The profile information to use for the update.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to update_profile()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

update_recommendation_and_wait_for_state(recommendation_id, update_recommendation_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls update_recommendation() and waits for the Recommendation acted upon to enter the given state(s).

Parameters
  • recommendation_id (str) – (required) The unique OCID associated with the recommendation.

  • update_recommendation_details (oci.optimizer.models.UpdateRecommendationDetails) – (required) The request object for updating the recommendation details.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to update_recommendation()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait

update_resource_action_and_wait_for_state(resource_action_id, update_resource_action_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={})

Calls update_resource_action() and waits for the ResourceAction acted upon to enter the given state(s).

Parameters
  • resource_action_id (str) – (required) The unique OCID associated with the resource action.

  • update_resource_action_details (oci.optimizer.models.UpdateResourceActionDetails) – (required) The resource action information to be updated.

  • wait_for_states (list[str]) – An array of states to wait on. These should be valid values for lifecycle_state

  • operation_kwargs (dict) – A dictionary of keyword arguments to pass to update_resource_action()

  • waiter_kwargs (dict) – A dictionary of keyword arguments to pass to the oci.wait_until() function. For example, you could pass max_interval_seconds or max_interval_seconds as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait