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
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.

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

====================
1.4.4 - 2018-06-28
====================

Added
-----
* Support for service gateway management in the Networking service
* Support for backup and clone of boot volumes in the Block Storage service

Changed
-------
* Setup.py changed to allow more versions of pytz and python-dateutil packages when installing to an existing environment

====================
1.4.3 - 2018-06-14
====================
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ API reference can be found `here`__.
__ https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index.html
__ https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/index.html

A downloadable version of the documentation is include with in the release zip, which can be found `here`__.

__ https://github.com/oracle/oci-python-sdk/releases

====
Help
====
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx-rtd-theme==0.2.5b2
sphinx==1.6.4
sphinx==1.6.4
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ PyJWT==1.5.3
pyOpenSSL==17.4.0
pytest==3.2.3
pytest-catchlog==1.2.2
python-dateutil==2.7.3
pytz==2016.10
python-dateutil>=2.5.3,<=2.7.3
pytz>=2016.10
requests==2.18.4
sphinx-rtd-theme==0.2.5b2
six==1.11.0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def open_relative(*path):
"idna>=2.5,<2.7",
"PyJWT==1.5.3",
"pyOpenSSL<=17.4.0",
"python-dateutil==2.7.3",
"pytz==2016.10",
"python-dateutil>=2.5.3,<=2.7.3",
"pytz>=2016.10",
"requests==2.18.4",
"six==1.11.0",
]
Expand Down
557 changes: 544 additions & 13 deletions src/oci/core/blockstorage_client.py

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions src/oci/core/blockstorage_client_composite_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,82 @@ def __init__(self, client, **kwargs):
"""
self.client = client

def create_boot_volume_and_wait_for_state(self, create_boot_volume_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.create_boot_volume` and waits for the :py:class:`~oci.core.models.BootVolume` acted upon
to enter the given state(s).

:param CreateBootVolumeDetails create_boot_volume_details: (required)
Request to create a new boot volume.

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

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.BlockstorageClient.create_boot_volume`

: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.create_boot_volume(create_boot_volume_details, **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_boot_volume(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 create_boot_volume_backup_and_wait_for_state(self, create_boot_volume_backup_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.create_boot_volume_backup` and waits for the :py:class:`~oci.core.models.BootVolumeBackup` acted upon
to enter the given state(s).

:param CreateBootVolumeBackupDetails create_boot_volume_backup_details: (required)
Request to create a new backup of given boot volume.

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

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.BlockstorageClient.create_boot_volume_backup`

: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.create_boot_volume_backup(create_boot_volume_backup_details, **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_boot_volume_backup(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 create_volume_and_wait_for_state(self, create_volume_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.create_volume` and waits for the :py:class:`~oci.core.models.Volume` acted upon
Expand Down Expand Up @@ -212,6 +288,45 @@ def delete_boot_volume_and_wait_for_state(self, boot_volume_id, wait_for_states=
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def delete_boot_volume_backup_and_wait_for_state(self, boot_volume_backup_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.delete_boot_volume_backup` and waits for the :py:class:`~oci.core.models.BootVolumeBackup` acted upon
to enter the given state(s).

:param str boot_volume_backup_id: (required)
The OCID of the boot volume backup.

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

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.BlockstorageClient.delete_boot_volume_backup`

: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_boot_volume_backup(boot_volume_backup_id)
operation_result = self.client.delete_boot_volume_backup(boot_volume_backup_id, **operation_kwargs)
if not wait_for_states:
return operation_result

lowered_wait_for_states = [w.lower() for w in wait_for_states]

try:
waiter_result = oci.wait_until(
self.client,
initial_get_result,
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
succeed_on_not_found=True,
**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 delete_volume_and_wait_for_state(self, volume_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.delete_volume` and waits for the :py:class:`~oci.core.models.Volume` acted upon
Expand Down Expand Up @@ -409,6 +524,47 @@ def update_boot_volume_and_wait_for_state(self, boot_volume_id, update_boot_volu
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)

def update_boot_volume_backup_and_wait_for_state(self, boot_volume_backup_id, update_boot_volume_backup_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.update_boot_volume_backup` and waits for the :py:class:`~oci.core.models.BootVolumeBackup` acted upon
to enter the given state(s).

:param str boot_volume_backup_id: (required)
The OCID of the boot volume backup.

:param UpdateBootVolumeBackupDetails update_boot_volume_backup_details: (required)
Update boot volume backup fields

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

:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.BlockstorageClient.update_boot_volume_backup`

: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.update_boot_volume_backup(boot_volume_backup_id, update_boot_volume_backup_details, **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_boot_volume_backup(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 update_volume_and_wait_for_state(self, volume_id, update_volume_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.BlockstorageClient.update_volume` and waits for the :py:class:`~oci.core.models.Volume` acted upon
Expand Down
13 changes: 6 additions & 7 deletions src/oci/core/compute_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,18 +1708,17 @@ def get_windows_instance_initial_credentials(self, instance_id, **kwargs):
def instance_action(self, instance_id, action, **kwargs):
"""
InstanceAction
Performs one of the power actions (start, stop, softreset, softstop, or reset)
on the specified instance.
Performs one of the following power actions on the specified instance:

**start** - power on
- **START** - Powers on the instance.

**stop** - power off
- **STOP** - Powers off the instance.

**softreset** - ACPI shutdown and power on
- **SOFTRESET** - Gracefully reboots instance by sending a shutdown command to the operating system and then powers the instance back on.

**softstop** - signal the instance operating system to shutdown gracefully
- **SOFTSTOP** - Gracefully shuts down instance by sending a shutdown command to the operating system.

**reset** - power off and power on
- **RESET** - Powers off the instance and then powers it back on.

For more information see `Stopping and Starting an Instance`__.

Expand Down
26 changes: 26 additions & 0 deletions src/oci/core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
from .attach_volume_details import AttachVolumeDetails
from .boot_volume import BootVolume
from .boot_volume_attachment import BootVolumeAttachment
from .boot_volume_backup import BootVolumeBackup
from .boot_volume_source_details import BootVolumeSourceDetails
from .boot_volume_source_from_boot_volume_backup_details import BootVolumeSourceFromBootVolumeBackupDetails
from .boot_volume_source_from_boot_volume_details import BootVolumeSourceFromBootVolumeDetails
from .bulk_add_virtual_circuit_public_prefixes_details import BulkAddVirtualCircuitPublicPrefixesDetails
from .bulk_delete_virtual_circuit_public_prefixes_details import BulkDeleteVirtualCircuitPublicPrefixesDetails
from .capture_console_history_details import CaptureConsoleHistoryDetails
from .connect_local_peering_gateways_details import ConnectLocalPeeringGatewaysDetails
from .connect_remote_peering_connections_details import ConnectRemotePeeringConnectionsDetails
from .console_history import ConsoleHistory
from .cpe import Cpe
from .create_boot_volume_backup_details import CreateBootVolumeBackupDetails
from .create_boot_volume_details import CreateBootVolumeDetails
from .create_cpe_details import CreateCpeDetails
from .create_cross_connect_details import CreateCrossConnectDetails
from .create_cross_connect_group_details import CreateCrossConnectGroupDetails
Expand All @@ -33,6 +39,7 @@
from .create_remote_peering_connection_details import CreateRemotePeeringConnectionDetails
from .create_route_table_details import CreateRouteTableDetails
from .create_security_list_details import CreateSecurityListDetails
from .create_service_gateway_details import CreateServiceGatewayDetails
from .create_subnet_details import CreateSubnetDetails
from .create_vcn_details import CreateVcnDetails
from .create_virtual_circuit_details import CreateVirtualCircuitDetails
Expand Down Expand Up @@ -93,12 +100,17 @@
from .route_rule import RouteRule
from .route_table import RouteTable
from .security_list import SecurityList
from .service import Service
from .service_gateway import ServiceGateway
from .service_id_request_details import ServiceIdRequestDetails
from .service_id_response_details import ServiceIdResponseDetails
from .shape import Shape
from .subnet import Subnet
from .tcp_options import TcpOptions
from .tunnel_config import TunnelConfig
from .tunnel_status import TunnelStatus
from .udp_options import UdpOptions
from .update_boot_volume_backup_details import UpdateBootVolumeBackupDetails
from .update_boot_volume_details import UpdateBootVolumeDetails
from .update_console_history_details import UpdateConsoleHistoryDetails
from .update_cpe_details import UpdateCpeDetails
Expand All @@ -117,6 +129,7 @@
from .update_remote_peering_connection_details import UpdateRemotePeeringConnectionDetails
from .update_route_table_details import UpdateRouteTableDetails
from .update_security_list_details import UpdateSecurityListDetails
from .update_service_gateway_details import UpdateServiceGatewayDetails
from .update_subnet_details import UpdateSubnetDetails
from .update_vcn_details import UpdateVcnDetails
from .update_virtual_circuit_details import UpdateVirtualCircuitDetails
Expand Down Expand Up @@ -156,13 +169,19 @@
"AttachVolumeDetails": AttachVolumeDetails,
"BootVolume": BootVolume,
"BootVolumeAttachment": BootVolumeAttachment,
"BootVolumeBackup": BootVolumeBackup,
"BootVolumeSourceDetails": BootVolumeSourceDetails,
"BootVolumeSourceFromBootVolumeBackupDetails": BootVolumeSourceFromBootVolumeBackupDetails,
"BootVolumeSourceFromBootVolumeDetails": BootVolumeSourceFromBootVolumeDetails,
"BulkAddVirtualCircuitPublicPrefixesDetails": BulkAddVirtualCircuitPublicPrefixesDetails,
"BulkDeleteVirtualCircuitPublicPrefixesDetails": BulkDeleteVirtualCircuitPublicPrefixesDetails,
"CaptureConsoleHistoryDetails": CaptureConsoleHistoryDetails,
"ConnectLocalPeeringGatewaysDetails": ConnectLocalPeeringGatewaysDetails,
"ConnectRemotePeeringConnectionsDetails": ConnectRemotePeeringConnectionsDetails,
"ConsoleHistory": ConsoleHistory,
"Cpe": Cpe,
"CreateBootVolumeBackupDetails": CreateBootVolumeBackupDetails,
"CreateBootVolumeDetails": CreateBootVolumeDetails,
"CreateCpeDetails": CreateCpeDetails,
"CreateCrossConnectDetails": CreateCrossConnectDetails,
"CreateCrossConnectGroupDetails": CreateCrossConnectGroupDetails,
Expand All @@ -179,6 +198,7 @@
"CreateRemotePeeringConnectionDetails": CreateRemotePeeringConnectionDetails,
"CreateRouteTableDetails": CreateRouteTableDetails,
"CreateSecurityListDetails": CreateSecurityListDetails,
"CreateServiceGatewayDetails": CreateServiceGatewayDetails,
"CreateSubnetDetails": CreateSubnetDetails,
"CreateVcnDetails": CreateVcnDetails,
"CreateVirtualCircuitDetails": CreateVirtualCircuitDetails,
Expand Down Expand Up @@ -239,12 +259,17 @@
"RouteRule": RouteRule,
"RouteTable": RouteTable,
"SecurityList": SecurityList,
"Service": Service,
"ServiceGateway": ServiceGateway,
"ServiceIdRequestDetails": ServiceIdRequestDetails,
"ServiceIdResponseDetails": ServiceIdResponseDetails,
"Shape": Shape,
"Subnet": Subnet,
"TcpOptions": TcpOptions,
"TunnelConfig": TunnelConfig,
"TunnelStatus": TunnelStatus,
"UdpOptions": UdpOptions,
"UpdateBootVolumeBackupDetails": UpdateBootVolumeBackupDetails,
"UpdateBootVolumeDetails": UpdateBootVolumeDetails,
"UpdateConsoleHistoryDetails": UpdateConsoleHistoryDetails,
"UpdateCpeDetails": UpdateCpeDetails,
Expand All @@ -263,6 +288,7 @@
"UpdateRemotePeeringConnectionDetails": UpdateRemotePeeringConnectionDetails,
"UpdateRouteTableDetails": UpdateRouteTableDetails,
"UpdateSecurityListDetails": UpdateSecurityListDetails,
"UpdateServiceGatewayDetails": UpdateServiceGatewayDetails,
"UpdateSubnetDetails": UpdateSubnetDetails,
"UpdateVcnDetails": UpdateVcnDetails,
"UpdateVirtualCircuitDetails": UpdateVirtualCircuitDetails,
Expand Down
Loading