def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_db_home,
         call_fn_args=(),
         call_fn_kwargs=dict(
             db_home_id=self.module.params.get("db_home_id"),
             perform_final_backup=self.module.params.get(
                 "perform_final_backup"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
Exemplo n.º 2
0
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_table,
         call_fn_args=(),
         call_fn_kwargs=dict(
             table_name_or_id=self.module.params.get("table_name_or_id"),
             compartment_id=self.module.params.get("compartment_id"),
             is_if_exists=self.module.params.get("is_if_exists"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def update_resource(self):
     update_details = self.get_update_model()
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.update_db_home,
         call_fn_args=(),
         call_fn_kwargs=dict(
             db_home_id=self.module.params.get("db_home_id"),
             update_db_home_details=update_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.UPDATE_OPERATION_KEY,
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def generate(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.generate_analytics_cluster_memory_estimate,
         call_fn_args=(),
         call_fn_kwargs=dict(
             db_system_id=self.module.params.get("db_system_id"), ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def offboard(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.offboard_namespace,
         call_fn_args=(),
         call_fn_kwargs=dict(
             namespace_name=self.module.params.get("namespace_name"), ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
Exemplo n.º 6
0
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_vm_cluster_network,
         call_fn_args=(),
         call_fn_kwargs=dict(
             exadata_infrastructure_id=self.module.params.get(
                 "exadata_infrastructure_id"
             ),
             vm_cluster_network_id=self.module.params.get("vm_cluster_network_id"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
 def deactivate(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.deactivate_notebook_session,
         call_fn_args=(),
         call_fn_kwargs=dict(
             notebook_session_id=self.module.params.get("notebook_session_id"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 8
0
 def create_resource(self):
     create_details = self.get_create_model()
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.create_log,
         call_fn_args=(),
         call_fn_kwargs=dict(
             log_group_id=self.module.params.get("log_group_id"),
             create_log_details=create_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.CREATE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
Exemplo n.º 9
0
 def switchover(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.switchover_autonomous_database,
         call_fn_args=(),
         call_fn_kwargs=dict(
             autonomous_database_id=self.module.params.get("autonomous_database_id"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 10
0
 def update_resource(self):
     update_details = self.get_update_model()
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.update_health_checker,
         call_fn_args=(),
         call_fn_kwargs=dict(
             health_checker=update_details,
             load_balancer_id=self.module.params.get("load_balancer_id"),
             backend_set_name=self.module.params.get("backend_set_name"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.UPDATE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 11
0
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_private_access_channel,
         call_fn_args=(),
         call_fn_kwargs=dict(
             private_access_channel_key=self.module.params.get(
                 "private_access_channel_key"),
             analytics_instance_id=self.module.params.get(
                 "analytics_instance_id"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_backend,
         call_fn_args=(),
         call_fn_kwargs=dict(
             network_load_balancer_id=self.module.params.get(
                 "network_load_balancer_id"
             ),
             backend_set_name=self.module.params.get("backend_set_name"),
             backend_name=self.module.params.get("name"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
 def deploy_plugins(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, DeployPluginsDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.deploy_plugins,
         call_fn_args=(),
         call_fn_kwargs=dict(deploy_plugins_details=action_details,),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.delete_workspace,
         call_fn_args=(),
         call_fn_kwargs=dict(
             workspace_id=self.module.params.get("workspace_id"),
             quiesce_timeout=self.module.params.get("quiesce_timeout"),
             is_force_operation=self.module.params.get(
                 "is_force_operation"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def install_all_windows_updates(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.
         install_all_windows_updates_on_managed_instance,
         call_fn_args=(),
         call_fn_kwargs=dict(managed_instance_id=self.module.params.get(
             "managed_instance_id"), ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
    def delete_resource(self):
        try:
            delete_operation_response = oci_wait_utils.call_and_wait(
                call_fn=self.client.delete_exadata_infrastructure,
                call_fn_args=(),
                call_fn_kwargs=dict(
                    exadata_infrastructure_id=self.module.params.get(
                        "exadata_infrastructure_id"
                    ),
                ),
                waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
                operation=oci_common_utils.DELETE_OPERATION_KEY,
                waiter_client=self.work_request_client,
                resource_helper=self,
                wait_for_states=oci_common_utils.get_work_request_completed_states(),
            )
        except ServiceError as delete_service_error:
            # delete_exadata_infrastructure can return a 404 if you are not allowed to delete it
            if delete_service_error.status == 404:
                # so attempt a GET to determine if the resource is really still there
                try:
                    oci_common_utils.call_with_backoff(
                        self.client.get_exadata_infrastructure,
                        exadata_infrastructure_id=self.module.params.get(
                            "exadata_infrastructure_id"
                        ),
                    )
                except ServiceError as get_service_error:
                    # if the resource truly doesn't exist, then just re-throw the existing delete 404
                    # and the resource_utils function will handle it appropriately
                    if get_service_error.status == 404:
                        raise delete_service_error

                # if we reach here it means that the DELETE call returned a 404 but the GET operation was successful
                # this means the resource is still present so the DELETE call must have recieved a 404 for some other
                # reason, so report that back to the user
                self.module.fail_json(
                    msg="Deleting resource failed with exception: {0}".format(
                        delete_service_error.message
                    )
                )

            raise delete_service_error

        return delete_operation_response
Exemplo n.º 17
0
 def delete_resource(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.remove_auto_scaling_configuration,
         call_fn_args=(),
         call_fn_kwargs=dict(
             bds_instance_id=self.module.params.get("bds_instance_id"),
             auto_scaling_configuration_id=self.module.params.get(
                 "auto_scaling_configuration_id"
             ),
             remove_auto_scaling_configuration_details=self.module.params.get(
                 "remove_auto_scaling_configuration_details"
             ),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 18
0
 def softreset(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.db_node_action,
         call_fn_args=(),
         call_fn_kwargs=dict(
             db_node_id=self.module.params.get("db_node_id"),
             action="SOFTRESET",
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def disable_external_non_container_database_database_management(self):
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.
         disable_external_non_container_database_database_management,
         call_fn_args=(),
         call_fn_kwargs=dict(
             external_non_container_database_id=self.module.params.get(
                 "external_non_container_database_id"), ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
Exemplo n.º 20
0
 def delete_resource(self):
     remove_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, RemoveAutoScalingConfigurationDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.remove_auto_scaling_configuration,
         call_fn_args=(),
         call_fn_kwargs=dict(
             bds_instance_id=self.module.params.get("bds_instance_id"),
             auto_scaling_configuration_id=self.module.params.get(
                 "auto_scaling_configuration_id"
             ),
             remove_auto_scaling_configuration_details=remove_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation=oci_common_utils.DELETE_OPERATION_KEY,
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 21
0
 def upgrade(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, UpgradeDatabaseDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.upgrade_database,
         call_fn_args=(),
         call_fn_kwargs=dict(
             database_id=self.module.params.get("database_id"),
             upgrade_database_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 22
0
 def change_compartment(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, ChangeLogGroupCompartmentDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.change_log_group_compartment,
         call_fn_args=(),
         call_fn_kwargs=dict(
             log_group_id=self.module.params.get("log_group_id"),
             change_log_group_compartment_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 23
0
 def add(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, AddAnalyticsClusterDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.add_analytics_cluster,
         call_fn_args=(),
         call_fn_kwargs=dict(
             db_system_id=self.module.params.get("db_system_id"),
             add_analytics_cluster_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
Exemplo n.º 24
0
 def attach_catalog_private_endpoint(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, AttachCatalogPrivateEndpointDetails
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.attach_catalog_private_endpoint,
         call_fn_args=(),
         call_fn_kwargs=dict(
             attach_catalog_private_endpoint_details=action_details,
             catalog_id=self.module.params.get("catalog_id"),
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
 def remove_cloud_sql(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, RemoveCloudSqlDetails)
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.remove_cloud_sql,
         call_fn_args=(),
         call_fn_kwargs=dict(
             bds_instance_id=self.module.params.get("bds_instance_id"),
             remove_cloud_sql_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.get_waiter_client(),
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def copy(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params, CopyObjectDetails)
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.copy_object,
         call_fn_args=(),
         call_fn_kwargs=dict(
             namespace_name=self.module.params.get("namespace_name"),
             bucket_name=self.module.params.get("bucket_name"),
             copy_object_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(
         ),
     )
 def enable_external_non_container_database_operations_insights(self):
     action_details = oci_common_utils.convert_input_data_to_model_class(
         self.module.params,
         EnableExternalNonContainerDatabaseOperationsInsightsDetails,
     )
     return oci_wait_utils.call_and_wait(
         call_fn=self.client.enable_external_non_container_database_operations_insights,
         call_fn_args=(),
         call_fn_kwargs=dict(
             external_non_container_database_id=self.module.params.get(
                 "external_non_container_database_id"
             ),
             enable_external_non_container_database_operations_insights_details=action_details,
         ),
         waiter_type=oci_wait_utils.WORK_REQUEST_WAITER_KEY,
         operation="{0}_{1}".format(
             self.module.params.get("action").upper(),
             oci_common_utils.ACTION_OPERATION_KEY,
         ),
         waiter_client=self.work_request_client,
         resource_helper=self,
         wait_for_states=oci_common_utils.get_work_request_completed_states(),
     )
    def update_resource(self):
        operation_response = oci_common_utils.call_with_backoff(
            self.client.update_autonomous_vm_cluster,
            autonomous_vm_cluster_id=self.module.params.get("autonomous_vm_cluster_id"),
            update_autonomous_vm_cluster_details=self.get_update_model(),
        )

        # Delete `opc-work-request-id` from operation_response to allow falling back to lifecycle based waiting.
        if (
            operation_response
            and operation_response.headers
            and oci_wait_utils.WORK_REQUEST_HEADER in operation_response.headers
        ):
            del operation_response.headers[oci_wait_utils.WORK_REQUEST_HEADER]

        return oci_wait_utils.get_waiter(
            oci_wait_utils.WORK_REQUEST_WAITER_KEY,
            oci_common_utils.UPDATE_OPERATION_KEY,
            self.work_request_client,
            self,
            operation_response=operation_response,
            wait_for_states=oci_common_utils.get_work_request_completed_states(),
        ).wait()