OptimizerClient

class oci.optimizer.OptimizerClient(config, **kwargs)

APIs for managing Cloud Advisor. Cloud Advisor provides recommendations that help you maximize cost savings and improve the security posture of your tenancy.

Methods

__init__(config, **kwargs) Creates a new service client
bulk_apply_recommendations(…) Applies the specified recommendations to the resources.
create_profile(create_profile_details, **kwargs) Creates a new profile.
delete_profile(profile_id, **kwargs) Deletes the specified profile.
get_category(category_id, **kwargs) Gets the category that corresponds to the specified OCID.
get_enrollment_status(enrollment_status_id, …) Gets the Cloud Advisor enrollment status.
get_profile(profile_id, **kwargs) Gets the specified profile’s information.
get_recommendation(recommendation_id, **kwargs) Gets the recommendation for the specified OCID.
get_resource_action(resource_action_id, **kwargs) Gets the resource action that corresponds to the specified OCID.
get_work_request(work_request_id, **kwargs) Gets the status of the work request associated with the specified ID.
list_categories(compartment_id, …) Lists the supported Cloud Advisor categories.
list_enrollment_statuses(compartment_id, …) Lists the Cloud Advisor enrollment statuses.
list_histories(compartment_id, …) Lists changes to the recommendations based on user activity.
list_profiles(compartment_id, **kwargs) Lists the existing profiles.
list_recommendation_strategies(…) Lists the existing strategies.
list_recommendations(compartment_id, …) Lists the Cloud Advisor recommendations that are currently supported in the specified category.
list_resource_actions(compartment_id, …) Lists the Cloud Advisor resource actions that are supported by the specified recommendation.
list_work_request_errors(work_request_id, …) Lists errors associated with the specified work request.
list_work_request_logs(work_request_id, **kwargs) Lists the logs associated with the specified work request.
list_work_requests(compartment_id, **kwargs) Lists the work requests in the tenancy.
update_enrollment_status(…) Updates the enrollment status of the tenancy.
update_profile(profile_id, …) Updates the specified profile.
update_recommendation(recommendation_id, …) Updates the recommendation that corresponds to the specified OCID.
update_resource_action(resource_action_id, …) Updates the resource action that corresponds to the specified OCID.
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client will not have circuit breakers enabled by default, users can use their own circuit breaker strategy or the convenient DEFAULT_CIRCUIT_BREAKER_STRATEGY provided by the SDK to enable it. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
bulk_apply_recommendations(recommendation_id, bulk_apply_recommendations_details, **kwargs)

Applies the specified recommendations to the resources.

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.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use bulk_apply_recommendations API.

create_profile(create_profile_details, **kwargs)

Creates a new profile.

Parameters:
  • create_profile_details (oci.optimizer.models.CreateProfileDetails) – (required) Details for creating the profile.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Profile

Return type:

Response

Example:

Click here to see an example of how to use create_profile API.

delete_profile(profile_id, **kwargs)

Deletes the specified profile. Uses the profile’s OCID to determine which profile to delete.

Parameters:
  • profile_id (str) – (required) The unique OCID of the profile.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use delete_profile API.

get_category(category_id, **kwargs)

Gets the category that corresponds to the specified OCID.

Parameters:
  • category_id (str) – (required) The unique OCID associated with the category.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Category

Return type:

Response

Example:

Click here to see an example of how to use get_category API.

get_enrollment_status(enrollment_status_id, **kwargs)

Gets the Cloud Advisor enrollment status.

Parameters:
  • enrollment_status_id (str) – (required) The unique OCID associated with the enrollment status.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type EnrollmentStatus

Return type:

Response

Example:

Click here to see an example of how to use get_enrollment_status API.

get_profile(profile_id, **kwargs)

Gets the specified profile’s information. Uses the profile’s OCID to determine which profile to retrieve.

Parameters:
  • profile_id (str) – (required) The unique OCID of the profile.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Profile

Return type:

Response

Example:

Click here to see an example of how to use get_profile API.

get_recommendation(recommendation_id, **kwargs)

Gets the recommendation for the specified OCID.

Parameters:
  • recommendation_id (str) – (required) The unique OCID associated with the recommendation.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Recommendation

Return type:

Response

Example:

Click here to see an example of how to use get_recommendation API.

get_resource_action(resource_action_id, **kwargs)

Gets the resource action that corresponds to the specified OCID.

Parameters:
  • resource_action_id (str) – (required) The unique OCID associated with the resource action.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ResourceAction

Return type:

Response

Example:

Click here to see an example of how to use get_resource_action API.

get_work_request(work_request_id, **kwargs)

Gets the status of the work request associated with the specified ID.

Parameters:
  • work_request_id (str) – (required) The OCID of the work request.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type WorkRequest

Return type:

Response

Example:

Click here to see an example of how to use get_work_request API.

list_categories(compartment_id, compartment_id_in_subtree, **kwargs)

Lists the supported Cloud Advisor categories.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • compartment_id_in_subtree (bool) –

    (required) When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of accessLevel.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type CategoryCollection

Return type:

Response

Example:

Click here to see an example of how to use list_categories API.

list_enrollment_statuses(compartment_id, **kwargs)

Lists the Cloud Advisor enrollment statuses.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • status (str) –

    (optional) A filter that returns results that match the Cloud Advisor enrollment status specified.

    Allowed values are: “ACTIVE”, “INACTIVE”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type EnrollmentStatusCollection

Return type:

Response

Example:

Click here to see an example of how to use list_enrollment_statuses API.

list_histories(compartment_id, compartment_id_in_subtree, **kwargs)

Lists changes to the recommendations based on user activity. For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • compartment_id_in_subtree (bool) –

    (required) When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of accessLevel.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • recommendation_name (str) – (optional) Optional. A filter that returns results that match the recommendation name specified.
  • recommendation_id (str) – (optional) The unique OCID associated with the recommendation.
  • resource_type (str) – (optional) Optional. A filter that returns results that match the resource type specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • status (str) –

    (optional) A filter that returns recommendations that match the status specified.

    Allowed values are: “PENDING”, “DISMISSED”, “POSTPONED”, “IMPLEMENTED”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type HistoryCollection

Return type:

Response

Example:

Click here to see an example of how to use list_histories API.

list_profiles(compartment_id, **kwargs)

Lists the existing profiles.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ProfileCollection

Return type:

Response

Example:

Click here to see an example of how to use list_profiles API.

list_recommendation_strategies(compartment_id, compartment_id_in_subtree, **kwargs)

Lists the existing strategies.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • compartment_id_in_subtree (bool) –

    (required) When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of accessLevel.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • recommendation_name (str) – (optional) Optional. A filter that returns results that match the recommendation name specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RecommendationStrategyCollection

Return type:

Response

Example:

Click here to see an example of how to use list_recommendation_strategies API.

list_recommendations(compartment_id, compartment_id_in_subtree, category_id, **kwargs)

Lists the Cloud Advisor recommendations that are currently supported in the specified category.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • compartment_id_in_subtree (bool) –

    (required) When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of accessLevel.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

  • category_id (str) – (required) The unique OCID associated with the category.
  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • status (str) –

    (optional) A filter that returns recommendations that match the status specified.

    Allowed values are: “PENDING”, “DISMISSED”, “POSTPONED”, “IMPLEMENTED”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RecommendationCollection

Return type:

Response

Example:

Click here to see an example of how to use list_recommendations API.

list_resource_actions(compartment_id, compartment_id_in_subtree, recommendation_id, **kwargs)

Lists the Cloud Advisor resource actions that are supported by the specified recommendation.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • compartment_id_in_subtree (bool) –

    (required) When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of accessLevel.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

  • recommendation_id (str) – (required) The unique OCID associated with the recommendation.
  • name (str) – (optional) Optional. A filter that returns results that match the name specified.
  • resource_type (str) – (optional) Optional. A filter that returns results that match the resource type specified.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • sort_order (str) –

    (optional) The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.

    Allowed values are: “NAME”, “TIMECREATED”

  • lifecycle_state (str) –

    (optional) A filter that returns results that match the lifecycle state specified.

    Allowed values are: “ACTIVE”, “FAILED”, “INACTIVE”, “ATTACHING”, “DETACHING”, “DELETING”, “DELETED”, “UPDATING”, “CREATING”

  • status (str) –

    (optional) A filter that returns recommendations that match the status specified.

    Allowed values are: “PENDING”, “DISMISSED”, “POSTPONED”, “IMPLEMENTED”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ResourceActionCollection

Return type:

Response

Example:

Click here to see an example of how to use list_resource_actions API.

list_work_request_errors(work_request_id, **kwargs)

Lists errors associated with the specified work request.

Parameters:
  • work_request_id (str) – (required) The OCID of the work request.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type WorkRequestErrorCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_request_errors API.

list_work_request_logs(work_request_id, **kwargs)

Lists the logs associated with the specified work request.

Parameters:
  • work_request_id (str) – (required) The OCID of the work request.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type WorkRequestLogEntryCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_request_logs API.

list_work_requests(compartment_id, **kwargs)

Lists the work requests in the tenancy. The tenancy is the root compartment.

Parameters:
  • compartment_id (str) – (required) The OCID of the compartment.
  • page (str) – (optional) The value of the opc-next-page response header from the previous “List” call.
  • limit (int) – (optional) The maximum number of items to return in a paginated “List” call.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type WorkRequestCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_requests API.

update_enrollment_status(enrollment_status_id, update_enrollment_status_details, **kwargs)

Updates the enrollment status of the tenancy.

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.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type EnrollmentStatus

Return type:

Response

Example:

Click here to see an example of how to use update_enrollment_status API.

update_profile(profile_id, update_profile_details, **kwargs)

Updates the specified profile. Uses the profile’s OCID to determine which profile to update.

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.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Profile

Return type:

Response

Example:

Click here to see an example of how to use update_profile API.

update_recommendation(recommendation_id, update_recommendation_details, **kwargs)

Updates the recommendation that corresponds to the specified OCID. Use this operation to implement the following actions:

  • Postpone recommendation
  • Dismiss recommendation
  • Reactivate recommendation
Parameters:
  • recommendation_id (str) – (required) The unique OCID associated with the recommendation.
  • update_recommendation_details (oci.optimizer.models.UpdateRecommendationDetails) – (required) The request object for udpating the recommendation details.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Recommendation

Return type:

Response

Example:

Click here to see an example of how to use update_recommendation API.

update_resource_action(resource_action_id, update_resource_action_details, **kwargs)

Updates the resource action that corresponds to the specified OCID. Use this operation to implement the following actions:

  • Postpone resource action
  • Ignore resource action
  • Reactivate resource action
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.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ResourceAction

Return type:

Response

Example:

Click here to see an example of how to use update_resource_action API.