Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ Change Log
All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
====================
2.124.0 - 2024-03-05
====================

Added
-----
* Support for Linux capabilities configuration for the containers in the Container Instances service
* Support for service platforms in the Oracle Store Platform Gateway service
* Support for whisper models and delete job operation in the Speech service
* Support for new SQL insight content types in news reports in the Operations Insights service
* Support for launching virtual machines with multiple volumes in the Compute service

Breaking
--------
* The property `CapacityPlanningResources` has been made optional in the model `NewsContentTypes` in the Operations Insights service

====================
2.123.0 - 2024-02-27
====================
Expand Down
1 change: 1 addition & 0 deletions docs/api/container_instances.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Container Instances
oci.container_instances.models.BasicImagePullSecret
oci.container_instances.models.ChangeContainerInstanceCompartmentDetails
oci.container_instances.models.Container
oci.container_instances.models.ContainerCapabilities
oci.container_instances.models.ContainerCollection
oci.container_instances.models.ContainerCommandHealthCheck
oci.container_instances.models.ContainerConfigFile
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ContainerCapabilities
=====================

.. currentmodule:: oci.container_instances.models

.. autoclass:: ContainerCapabilities
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/api/opsi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ Opsi
oci.opsi.models.UpdateOpsiUxConfigurationDetails
oci.opsi.models.UpdatePeComanagedDatabaseInsightDetails
oci.opsi.models.UpdatePeComanagedExadataInsightDetails
oci.opsi.models.UpdatePeComanagedHostInsightDetails
oci.opsi.models.UxConfigurationItemsCollection
oci.opsi.models.VmClusterSummary
oci.opsi.models.WarehouseDataObjectCollection
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UpdatePeComanagedHostInsightDetails
===================================

.. currentmodule:: oci.opsi.models

.. autoclass:: UpdatePeComanagedHostInsightDetails
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
5 changes: 5 additions & 0 deletions examples/showoci/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.

=====================
24.03.03 - 24.03.03
=====================
* Remove max_cpu_core_count from Autonomous Database

=====================
24.03.02 - 24.03.02
=====================
Expand Down
2 changes: 1 addition & 1 deletion examples/showoci/showoci.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
import os
import time

version = "24.03.02"
version = "24.03.03"

##########################################################################
# check OCI version
Expand Down
3 changes: 1 addition & 2 deletions examples/showoci/showoci_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class ShowOCIData(object):
version = "24.03.02"
version = "24.03.03"

############################################
# ShowOCIService - Service object to query
Expand Down Expand Up @@ -3029,7 +3029,6 @@ def __get_database_adb_database_info(self, dbs):
'is_auto_scaling_for_storage_enabled': dbs['is_auto_scaling_for_storage_enabled'],
'allocated_storage_size_in_tbs': dbs['allocated_storage_size_in_tbs'],
'actual_used_data_storage_size_in_tbs': dbs['actual_used_data_storage_size_in_tbs'],
'max_cpu_core_count': dbs['max_cpu_core_count'],
'database_edition': dbs['database_edition'],
'local_disaster_recovery_type': dbs['local_disaster_recovery_type'],
'disaster_recovery_region_type': dbs['disaster_recovery_region_type'],
Expand Down
2 changes: 1 addition & 1 deletion examples/showoci/showoci_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class ShowOCIOutput(object):
version = "24.03.02"
version = "24.03.03"

##########################################################################
# spaces for align
Expand Down
3 changes: 1 addition & 2 deletions examples/showoci/showoci_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# class ShowOCIService
##########################################################################
class ShowOCIService(object):
version = "24.03.02"
version = "24.03.03"
oci_compatible_version = "2.119.1"
thread_lock = threading.Lock()

Expand Down Expand Up @@ -10623,7 +10623,6 @@ def __load_database_adb_database(self, database_client, compartments):
'is_auto_scaling_for_storage_enabled': self.get_value(dbs.is_auto_scaling_for_storage_enabled),
'allocated_storage_size_in_tbs': self.get_value(dbs.allocated_storage_size_in_tbs),
'actual_used_data_storage_size_in_tbs': self.get_value(dbs.actual_used_data_storage_size_in_tbs),
'max_cpu_core_count': self.get_value(dbs.max_cpu_core_count),
'database_edition': self.get_value(dbs.database_edition),
'local_disaster_recovery_type': self.get_value(dbs.local_disaster_recovery_type),
'disaster_recovery_region_type': self.get_value(dbs.disaster_recovery_region_type),
Expand Down
113 changes: 113 additions & 0 deletions src/oci/ai_speech/ai_service_speech_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,119 @@ def create_transcription_job(self, create_transcription_job_details, **kwargs):
api_reference_link=api_reference_link,
required_arguments=required_arguments)

def delete_transcription_job(self, transcription_job_id, **kwargs):
"""
Delete API cleans job, tasks and the related metadata. However the generated transcriptions in customer tenancy will not be deleted.


:param str transcription_job_id: (required)
Unique Transcription Job identifier.

:param str if_match: (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.

:param str opc_request_id: (optional)
The client request ID for tracing.

:param str opc_retry_token: (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
might be rejected.

:param obj retry_strategy: (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 :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

:param bool allow_control_chars: (optional)
allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
By default, the response will not allow control characters in strings

:return: A :class:`~oci.response.Response` object with data of type None
:rtype: :class:`~oci.response.Response`

:example:
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/aispeech/delete_transcription_job.py.html>`__ to see an example of how to use delete_transcription_job API.
"""
# Required path and query arguments. These are in camelCase to replace values in service endpoints.
required_arguments = ['transcriptionJobId']
resource_path = "/transcriptionJobs/{transcriptionJobId}"
method = "DELETE"
operation_name = "delete_transcription_job"
api_reference_link = "https://docs.oracle.com/iaas/api/#/en/speech/20220101/TranscriptionJob/DeleteTranscriptionJob"

# Don't accept unknown kwargs
expected_kwargs = [
"allow_control_chars",
"retry_strategy",
"if_match",
"opc_request_id",
"opc_retry_token"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
f"delete_transcription_job got unknown kwargs: {extra_kwargs!r}")

path_params = {
"transcriptionJobId": transcription_job_id
}

path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}

for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string')

header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_request_id", missing),
"opc-retry-token": kwargs.get("opc_retry_token", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}

retry_strategy = self.base_client.get_preferred_retry_strategy(
operation_retry_strategy=kwargs.get('retry_strategy'),
client_retry_strategy=self.retry_strategy
)

if retry_strategy:
if not isinstance(retry_strategy, retry.NoneRetryStrategy):
self.base_client.add_opc_retry_token_if_needed(header_params)
self.base_client.add_opc_client_retries_header(header_params)
retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback)
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
allow_control_chars=kwargs.get('allow_control_chars'),
operation_name=operation_name,
api_reference_link=api_reference_link,
required_arguments=required_arguments)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
allow_control_chars=kwargs.get('allow_control_chars'),
operation_name=operation_name,
api_reference_link=api_reference_link,
required_arguments=required_arguments)

def get_transcription_job(self, transcription_job_id, **kwargs):
"""
Gets a Transcription Job by identifier
Expand Down
59 changes: 59 additions & 0 deletions src/oci/ai_speech/ai_service_speech_client_composite_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,65 @@ def create_transcription_job_and_wait_for_state(self, create_transcription_job_d
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def delete_transcription_job_and_wait_for_state(self, transcription_job_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.ai_speech.AIServiceSpeechClient.delete_transcription_job` and waits for the :py:class:`~oci.ai_speech.models.TranscriptionJob` acted upon
to enter the given state(s).

:param str transcription_job_id: (required)
Unique Transcription Job identifier.

:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.ai_speech.models.TranscriptionJob.lifecycle_state`

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.ai_speech.AIServiceSpeechClient.delete_transcription_job`

:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`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
"""
initial_get_result = self.client.get_transcription_job(transcription_job_id)
operation_result = None
try:
operation_result = self.client.delete_transcription_job(transcription_job_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e

if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]

try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_transcription_job, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result

return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def update_transcription_job_and_wait_for_state(self, transcription_job_id, update_transcription_job_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.ai_speech.AIServiceSpeechClient.update_transcription_job` and waits for the :py:class:`~oci.ai_speech.models.TranscriptionJob` acted upon
Expand Down
Loading