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
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ 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.10.6 - 2020-02-25
====================

Added
-----
* Support for restarting autonomous databases in the Database service
* Support for private endpoints on autonomous databases in the Database service
* Support for IP-based policies in the Identity service
* Support for management of OAuth 2.0 client credentials in the Identity service
* Support for OCI Functions as a subscription protocol in the Notifications service

====================
2.10.5 - 2020-02-18
====================
Expand Down
10 changes: 10 additions & 0 deletions docs/api/identity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Identity
oci.identity.models.CreateGroupDetails
oci.identity.models.CreateIdentityProviderDetails
oci.identity.models.CreateIdpGroupMappingDetails
oci.identity.models.CreateNetworkSourceDetails
oci.identity.models.CreateOAuth2ClientCredentialDetails
oci.identity.models.CreatePolicyDetails
oci.identity.models.CreateRegionSubscriptionDetails
oci.identity.models.CreateSaml2IdentityProviderDetails
Expand All @@ -49,6 +51,7 @@ Identity
oci.identity.models.DynamicGroup
oci.identity.models.EnumTagDefinitionValidator
oci.identity.models.FaultDomain
oci.identity.models.FullyQualifiedScope
oci.identity.models.Group
oci.identity.models.IdentityProvider
oci.identity.models.IdentityProviderGroupSummary
Expand All @@ -57,6 +60,11 @@ Identity
oci.identity.models.MfaTotpDeviceSummary
oci.identity.models.MfaTotpToken
oci.identity.models.MoveCompartmentDetails
oci.identity.models.NetworkSources
oci.identity.models.NetworkSourcesSummary
oci.identity.models.NetworkSourcesVirtualSourceList
oci.identity.models.OAuth2ClientCredential
oci.identity.models.OAuth2ClientCredentialSummary
oci.identity.models.PasswordPolicy
oci.identity.models.Policy
oci.identity.models.Region
Expand Down Expand Up @@ -87,6 +95,8 @@ Identity
oci.identity.models.UpdateGroupDetails
oci.identity.models.UpdateIdentityProviderDetails
oci.identity.models.UpdateIdpGroupMappingDetails
oci.identity.models.UpdateNetworkSourceDetails
oci.identity.models.UpdateOAuth2ClientCredentialDetails
oci.identity.models.UpdatePolicyDetails
oci.identity.models.UpdateSaml2IdentityProviderDetails
oci.identity.models.UpdateSmtpCredentialDetails
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CreateNetworkSourceDetails
==========================

.. currentmodule:: oci.identity.models

.. autoclass:: CreateNetworkSourceDetails
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CreateOAuth2ClientCredentialDetails
===================================

.. currentmodule:: oci.identity.models

.. autoclass:: CreateOAuth2ClientCredentialDetails
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FullyQualifiedScope
===================

.. currentmodule:: oci.identity.models

.. autoclass:: FullyQualifiedScope
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/api/identity/models/oci.identity.models.NetworkSources.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NetworkSources
==============

.. currentmodule:: oci.identity.models

.. autoclass:: NetworkSources
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NetworkSourcesSummary
=====================

.. currentmodule:: oci.identity.models

.. autoclass:: NetworkSourcesSummary
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NetworkSourcesVirtualSourceList
===============================

.. currentmodule:: oci.identity.models

.. autoclass:: NetworkSourcesVirtualSourceList
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
OAuth2ClientCredential
======================

.. currentmodule:: oci.identity.models

.. autoclass:: OAuth2ClientCredential
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
OAuth2ClientCredentialSummary
=============================

.. currentmodule:: oci.identity.models

.. autoclass:: OAuth2ClientCredentialSummary
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UpdateNetworkSourceDetails
==========================

.. currentmodule:: oci.identity.models

.. autoclass:: UpdateNetworkSourceDetails
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UpdateOAuth2ClientCredentialDetails
===================================

.. currentmodule:: oci.identity.models

.. autoclass:: UpdateOAuth2ClientCredentialDetails
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ def __init__(self, **kwargs):
# opc-obo-token is added to the request headers
def do_request_sign(self, request, enforce_content_headers=True):
request.headers['opc-obo-token'] = self.delegation_token
super(InstancePrincipalsDelegationTokenSigner, self).do_request_sign(request)
super(InstancePrincipalsDelegationTokenSigner, self).do_request_sign(request, enforce_content_headers)
return request
81 changes: 79 additions & 2 deletions src/oci/database/database_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6022,7 +6022,7 @@ def list_autonomous_databases(self, compartment_id, **kwargs):
:param str lifecycle_state: (optional)
A filter to return only resources that match the given lifecycle state exactly.

Allowed values are: "PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS"
Allowed values are: "PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING"

:param str db_workload: (optional)
A filter to return only autonomous database resources that match the specified workload type.
Expand Down Expand Up @@ -6091,7 +6091,7 @@ def list_autonomous_databases(self, compartment_id, **kwargs):
)

if 'lifecycle_state' in kwargs:
lifecycle_state_allowed_values = ["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS"]
lifecycle_state_allowed_values = ["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING"]
if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
raise ValueError(
"Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
Expand Down Expand Up @@ -8789,6 +8789,83 @@ def restart_autonomous_container_database(self, autonomous_container_database_id
header_params=header_params,
response_type="AutonomousContainerDatabase")

def restart_autonomous_database(self, autonomous_database_id, **kwargs):
"""
Restarts the specified Autonomous Database.
Restarts the specified Autonomous Database.


:param str autonomous_database_id: (required)
The database `OCID`__.

__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

: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 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.

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

:return: A :class:`~oci.response.Response` object with data of type :class:`~oci.database.models.AutonomousDatabase`
:rtype: :class:`~oci.response.Response`
"""
resource_path = "/autonomousDatabases/{autonomousDatabaseId}/actions/restart"
method = "POST"

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

path_params = {
"autonomousDatabaseId": autonomous_database_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('Parameter {} cannot be None, whitespace or empty string'.format(k))

header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", 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.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')

if retry_strategy:
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,
response_type="AutonomousDatabase")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="AutonomousDatabase")

def restore_autonomous_data_warehouse(self, autonomous_data_warehouse_id, restore_autonomous_data_warehouse_details, **kwargs):
"""
Restores an Autonomous Data Warehouse based on the provided request parameters.
Expand Down
77 changes: 77 additions & 0 deletions src/oci/database/database_client_composite_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,83 @@ def restart_autonomous_container_database_and_wait_for_state(self, autonomous_co
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def restart_autonomous_database_and_wait_for_work_request(self, autonomous_database_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.database.DatabaseClient.restart_autonomous_database` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).

:param str autonomous_database_id: (required)
The database `OCID`__.

__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.restart_autonomous_database`

: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
"""
operation_result = self.client.restart_autonomous_database(autonomous_database_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
work_request_id = operation_result.headers['opc-work-request-id']

try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def restart_autonomous_database_and_wait_for_state(self, autonomous_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.database.DatabaseClient.restart_autonomous_database` and waits for the :py:class:`~oci.database.models.AutonomousDatabase` acted upon
to enter the given state(s).

:param str autonomous_database_id: (required)
The database `OCID`__.

__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm

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

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.restart_autonomous_database`

: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
"""
operation_result = self.client.restart_autonomous_database(autonomous_database_id, **operation_kwargs)
if not wait_for_states:
return operation_result

lowered_wait_for_states = [w.lower() for w in wait_for_states]
wait_for_resource_id = operation_result.data.id

try:
waiter_result = oci.wait_until(
self.client,
self.client.get_autonomous_database(wait_for_resource_id),
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 Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def restore_autonomous_data_warehouse_and_wait_for_state(self, autonomous_data_warehouse_id, restore_autonomous_data_warehouse_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.database.DatabaseClient.restore_autonomous_data_warehouse` and waits for the :py:class:`~oci.database.models.AutonomousDataWarehouse` acted upon
Expand Down
Loading