diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 54360ce30a..f5e5bba188 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -5,7 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog `_.
====================
-2.0.3 -2018-09-06
+2.0.4 - 2018-09-27
+====================
+
+Added
+-----
+* Support for paravirtualized launch mode when importing images in the Compute service
+* Support for Key Management service
+* Support for encrypting the contents of an Object Storage bucket using a Key Management service key
+* Support for specifying a Key Management service key when launching a compute instance in the Compute service
+* Support for specifying a Key Management service key when backing up or restoring a block storage volume in the Block Volume service
+
+Fixed
+-----
+* ObjectStorageClient requires int value for content_length keyword agruement to put_object and upload_part, but the SDK was not converting the type for the Requests library.
+
+====================
+2.0.3 - 2018-09-06
====================
Added
@@ -13,7 +29,7 @@ Added
* Added support for updating metadata fields on an instance in the Compute service
Fixed
--------
+-----
* Fixed example wait_for_resource_in_state.py to use existing response objects. The updated example can be found on `GitHub `__.
====================
diff --git a/docs/api/core.rst b/docs/api/core.rst
index d13e99db0d..7e3971e8d3 100644
--- a/docs/api/core.rst
+++ b/docs/api/core.rst
@@ -30,6 +30,7 @@ Core Services
oci.core.models.BootVolume
oci.core.models.BootVolumeAttachment
oci.core.models.BootVolumeBackup
+ oci.core.models.BootVolumeKmsKey
oci.core.models.BootVolumeSourceDetails
oci.core.models.BootVolumeSourceFromBootVolumeBackupDetails
oci.core.models.BootVolumeSourceFromBootVolumeDetails
@@ -131,6 +132,7 @@ Core Services
oci.core.models.UdpOptions
oci.core.models.UpdateBootVolumeBackupDetails
oci.core.models.UpdateBootVolumeDetails
+ oci.core.models.UpdateBootVolumeKmsKeyDetails
oci.core.models.UpdateConsoleHistoryDetails
oci.core.models.UpdateCpeDetails
oci.core.models.UpdateCrossConnectDetails
@@ -157,6 +159,7 @@ Core Services
oci.core.models.UpdateVolumeDetails
oci.core.models.UpdateVolumeGroupBackupDetails
oci.core.models.UpdateVolumeGroupDetails
+ oci.core.models.UpdateVolumeKmsKeyDetails
oci.core.models.Vcn
oci.core.models.VirtualCircuit
oci.core.models.VirtualCircuitBandwidthShape
@@ -175,6 +178,7 @@ Core Services
oci.core.models.VolumeGroupSourceFromVolumeGroupBackupDetails
oci.core.models.VolumeGroupSourceFromVolumeGroupDetails
oci.core.models.VolumeGroupSourceFromVolumesDetails
+ oci.core.models.VolumeKmsKey
oci.core.models.VolumeSourceDetails
oci.core.models.VolumeSourceFromVolumeBackupDetails
oci.core.models.VolumeSourceFromVolumeDetails
diff --git a/docs/api/core/models/oci.core.models.BootVolumeKmsKey.rst b/docs/api/core/models/oci.core.models.BootVolumeKmsKey.rst
new file mode 100644
index 0000000000..1e09f7fb19
--- /dev/null
+++ b/docs/api/core/models/oci.core.models.BootVolumeKmsKey.rst
@@ -0,0 +1,11 @@
+BootVolumeKmsKey
+================
+
+.. currentmodule:: oci.core.models
+
+.. autoclass:: BootVolumeKmsKey
+ :show-inheritance:
+ :special-members: __init__
+ :members:
+ :undoc-members:
+ :inherited-members:
\ No newline at end of file
diff --git a/docs/api/core/models/oci.core.models.UpdateBootVolumeKmsKeyDetails.rst b/docs/api/core/models/oci.core.models.UpdateBootVolumeKmsKeyDetails.rst
new file mode 100644
index 0000000000..aebc832971
--- /dev/null
+++ b/docs/api/core/models/oci.core.models.UpdateBootVolumeKmsKeyDetails.rst
@@ -0,0 +1,11 @@
+UpdateBootVolumeKmsKeyDetails
+=============================
+
+.. currentmodule:: oci.core.models
+
+.. autoclass:: UpdateBootVolumeKmsKeyDetails
+ :show-inheritance:
+ :special-members: __init__
+ :members:
+ :undoc-members:
+ :inherited-members:
\ No newline at end of file
diff --git a/docs/api/core/models/oci.core.models.UpdateVolumeKmsKeyDetails.rst b/docs/api/core/models/oci.core.models.UpdateVolumeKmsKeyDetails.rst
new file mode 100644
index 0000000000..2c05bb47c9
--- /dev/null
+++ b/docs/api/core/models/oci.core.models.UpdateVolumeKmsKeyDetails.rst
@@ -0,0 +1,11 @@
+UpdateVolumeKmsKeyDetails
+=========================
+
+.. currentmodule:: oci.core.models
+
+.. autoclass:: UpdateVolumeKmsKeyDetails
+ :show-inheritance:
+ :special-members: __init__
+ :members:
+ :undoc-members:
+ :inherited-members:
\ No newline at end of file
diff --git a/docs/api/core/models/oci.core.models.VolumeKmsKey.rst b/docs/api/core/models/oci.core.models.VolumeKmsKey.rst
new file mode 100644
index 0000000000..43468622fd
--- /dev/null
+++ b/docs/api/core/models/oci.core.models.VolumeKmsKey.rst
@@ -0,0 +1,11 @@
+VolumeKmsKey
+============
+
+.. currentmodule:: oci.core.models
+
+.. autoclass:: VolumeKmsKey
+ :show-inheritance:
+ :special-members: __init__
+ :members:
+ :undoc-members:
+ :inherited-members:
\ No newline at end of file
diff --git a/docs/upload-manager.rst b/docs/upload-manager.rst
index 2f17c3b8f3..9d9686911c 100644
--- a/docs/upload-manager.rst
+++ b/docs/upload-manager.rst
@@ -12,6 +12,6 @@
Uploading Large Objects
~~~~~~~~~~~~~~~~~~~~~~~~
-The Object Storage service supports multipart uploads to make large object uploads easier by splitting the large object into parts. The Python SDK supports raw multipart upload operations for advanced use cases, as well as a higher-level upload class that uses the multipart upload APIs. `Managing Multipart Uploads `_ provides links to the APIs used for raw multipart upload operations. Higher-level uploads can be performed using the :py:class:`~oci.object_storage.UploadManager`. The :py:class:`~oci.object_storage.UploadManager` will: split a large object into parts for you, upload the parts in parallel, and then recombine and commit the parts as a single object in Object Storage.
+The Object Storage service supports multipart uploads to make large object uploads easier by splitting the large object into parts. The Python SDK supports raw multipart upload operations for advanced use cases, as well as a higher-level upload class that uses the multipart upload APIs. `Using Multipart Uploads `_ provides links to the APIs used for raw multipart upload operations. Higher-level uploads can be performed using the :py:class:`~oci.object_storage.UploadManager`. The :py:class:`~oci.object_storage.UploadManager` will: split a large object into parts for you, upload the parts in parallel, and then recombine and commit the parts as a single object in Object Storage.
The `UploadObject `_ example shows how :py:class:`~oci.object_storage.UploadManager` can be used to upload files to object storage.
\ No newline at end of file
diff --git a/docs/waiters.rst b/docs/waiters.rst
index e0f2441497..51a564705a 100644
--- a/docs/waiters.rst
+++ b/docs/waiters.rst
@@ -7,9 +7,22 @@
}
+Composite Operations and Waiters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To wait until an attribute of a resource reaches a certain state, you can use composite operations or waiters.
+
+Composite Operations
+---------------------
+You can use the ``CompositeOperation`` classes in the SDK (e.g. :py:class:`~oci.core.ComputeClientCompositeOperations`)
+to perform an action on a resource and wait for it to enter a particular state (or states). The ``CompositeOperation`` classes provide
+convenience methods so that you do not have to invoke an operation and then separately invoke a waiter.
+
+An example of using ``CompositeOperation`` classes can be found on `GitHub `__.
+
Waiters
-~~~~~~~
-Sometimes you may need to wait until an attribute of a resource, such as an instance or a VCN, reaches a certain state. An example of this would be launching an instance and then waiting for the instance to become available, or waiting until a subnet in a VCN has been terminated. This waiting can be accomplished by using the :py:func:`~oci.wait_until` function. As an example:
+-------
+You can also use the :py:func:`~oci.wait_until` function to wait for a resource to enter a particular state. As an example:
.. code-block:: python
@@ -34,33 +47,33 @@ Sometimes you may need to wait until an attribute of a resource, such as an inst
# - The fourth parameter is the desired value. An equality (==) comparison is done
get_instance_response = oci.wait_until(client, client.get_instance(instance_ocid), 'lifecycle_state', 'RUNNING')
-Instead of waiting for a single attribute to equal a given value, you can also provide a function reference (either a lambda or a reference to an already defined function) that
-can be used to evaluate the response received from the service call. This function should return a truthy value if the waiter should stop waiting, and a falsey value if the waiter
-should continue waiting.
+Passing a Function Reference
+``````````````````````````````
-For example, to wait until a volume backup reaches either the "AVAILABLE" or "FAULTY" state :
+Instead of waiting for a single attribute to reach a given value, you can use a function reference, such as a Lambda expression or a reference to a defined function, to evaluate the response received from the service call. If this function returns a truthy value, the waiter stops waiting.
-.. code-block:: python
+For example, to wait until a volume backup reaches either the AVAILABLE or FAULTY state :
- oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=lambda r: r.data.lifecycle_state in ['AVAILABLE', 'FAULTY'])
+* Using a Lambda expression:
-Instead of using a lambda, an already defined function can be used:
+ .. code-block:: python
-.. code-block:: python
+ oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=lambda r: r.data.lifecycle_state in ['AVAILABLE', 'FAULTY'])
- def should_stop_waiting_volume_backup(response):
- return response.data.lifecycle_state in ['AVAILABLE', 'FAULTY']
+* Using a defined function:
- oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=should_stop_waiting_volume_backup)
+ .. code-block:: python
-In addition to the base parameters shown above, the function can accept optional attributes to control the maximum amount of time it will wait for and the time between calls to the service. For more information on the optional parameters, see the documentation on the :py:func:`~oci.wait_until` function.
+ def should_stop_waiting_volume_backup(response):
+ return response.data.lifecycle_state in ['AVAILABLE', 'FAULTY']
-For a more comprehensive sample, please see our `examples `_ on GitHub.
+ oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=should_stop_waiting_volume_backup)
-Composite Operations
----------------------
-In addition to using waiters, you can use the ``CompositeOperation`` classes in the SDK (e.g. :py:class:`~oci.core.ComputeClientCompositeOperations`)
-to perform an action on a resource and wait for it to enter a particular state (or states). The ``CompositeOperation`` classes provide
-convenience methods so that you yourself do not have to invoke an operation and then separately invoke a waiter.
+Be aware that if the inner function raises an exception, ``oci.wait_until()`` will not be called. In the preceding example, if ``client.get_volume_backup(volume_backup_id)`` raises an exception, ``oci.wait_until()`` will not be called. This happens even if the inner function raises a Not Found exception and ``succeed_on_not_found=True`` is passed to ``oci.wait_until()``.
+
+Optional Attributes
+``````````````````````
-An example of using ``CompositeOperation`` classes can be found on `GitHub `__.
\ No newline at end of file
+In addition to these base parameters, ``wait_until()`` can accept optional attributes to control the maximum amount of time it will wait and the time between calls to the service. For more information on the optional parameters, see the documentation on the :py:func:`~oci.wait_until` function.
+
+For a more comprehensive sample, please see our `examples `_ on GitHub.
diff --git a/examples/container_engine.py b/examples/container_engine.py
index ca6574ed96..2fb132634e 100644
--- a/examples/container_engine.py
+++ b/examples/container_engine.py
@@ -482,7 +482,7 @@ def delete_vcn(vn_client, vcn_resources):
# VCNs have default security lists, route tables which cannot be deleted.
# Get the details of the VCN to get the default security list and default route table ids so
- # they can be skipped when getting the security lists ans route tables
+ # they can be skipped when getting the security lists and route tables
response = vn_client.get_vcn(vcn_resources['id'])
default_security_list_id = response.data.default_security_list_id
default_route_table_id = response.data.default_route_table_id
diff --git a/src/oci/__init__.py b/src/oci/__init__.py
index a2faf9f2f9..28e3646924 100644
--- a/src/oci/__init__.py
+++ b/src/oci/__init__.py
@@ -1,7 +1,7 @@
# coding: utf-8
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
-from . import audit, container_engine, core, database, dns, email, file_storage, identity, load_balancer, object_storage, resource_search
+from . import audit, container_engine, core, database, dns, email, file_storage, identity, key_management, load_balancer, object_storage, resource_search
from . import auth, config, constants, decorators, exceptions, regions, pagination, retry
from .base_client import BaseClient
from .request import Request
@@ -13,5 +13,5 @@
__all__ = [
"BaseClient", "Error", "Request", "Response", "Signer", "config", "constants", "decorators", "exceptions", "regions", "wait_until", "pagination", "auth", "retry",
- "audit", "container_engine", "core", "database", "dns", "email", "file_storage", "identity", "load_balancer", "object_storage", "resource_search"
+ "audit", "container_engine", "core", "database", "dns", "email", "file_storage", "identity", "key_management", "load_balancer", "object_storage", "resource_search"
]
diff --git a/src/oci/base_client.py b/src/oci/base_client.py
index 74c0d470a4..ec80df7cf2 100644
--- a/src/oci/base_client.py
+++ b/src/oci/base_client.py
@@ -88,6 +88,7 @@ def __init__(self, service, config, signer, type_mapping, **kwargs):
self._endpoint = None
self._base_path = kwargs.get('base_path')
+ self.service_endpoint_template = kwargs.get('service_endpoint_template')
if self.regional_client:
if kwargs.get('service_endpoint'):
@@ -101,11 +102,12 @@ def __init__(self, service, config, signer, type_mapping, **kwargs):
self.endpoint = regions.endpoint_for(
service,
+ service_endpoint_template=self.service_endpoint_template,
region=region_to_use,
endpoint=config.get('endpoint'))
else:
if not kwargs.get('service_endpoint'):
- raise ValueError('An endpoint must be provided for a non-regional service client')
+ raise exceptions.MissingEndpointForNonRegionalServiceClientError('An endpoint must be provided for a non-regional service client')
self.endpoint = kwargs.get('service_endpoint')
self.service = service
@@ -141,7 +143,7 @@ def endpoint(self, endpoint):
def set_region(self, region):
if self.regional_client:
- self.endpoint = regions.endpoint_for(self.service, region=region)
+ self.endpoint = regions.endpoint_for(self.service, service_endpoint_template=self.service_endpoint_template, region=region)
else:
raise TypeError('Setting the region is not allowed for non-regional service clients. You must instead set the endpoint')
@@ -173,6 +175,12 @@ def call_api(self, resource_path, method,
header_params = header_params or {}
+ # ObjectStorage PutObject and UploadPart require Content-Length as
+ # int, but requests requires it as a string. All the headers
+ # have been prepared for serialization at this point
+ if header_params.get('Content-Length', missing) is not missing:
+ header_params['Content-Length'] = str(header_params['Content-Length'])
+
header_params[constants.HEADER_CLIENT_INFO] = USER_INFO
header_params[constants.HEADER_USER_AGENT] = self.user_agent
diff --git a/src/oci/core/blockstorage_client.py b/src/oci/core/blockstorage_client.py
index ecbe2e6623..88af79f550 100644
--- a/src/oci/core/blockstorage_client.py
+++ b/src/oci/core/blockstorage_client.py
@@ -746,6 +746,79 @@ def delete_boot_volume_backup(self, boot_volume_backup_id, **kwargs):
path_params=path_params,
header_params=header_params)
+ def delete_boot_volume_kms_key(self, boot_volume_id, **kwargs):
+ """
+ DeleteBootVolumeKmsKey
+ Remove kms for the specific boot volume. If the volume doesn't use KMS, then do nothing.
+
+
+ :param str boot_volume_id: (required)
+ The OCID of the boot volume.
+
+ :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 `__.
+
+ 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 None
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/bootVolumes/{bootVolumeId}/kmsKey"
+ method = "DELETE"
+
+ # 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(
+ "delete_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "bootVolumeId": boot_volume_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)
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params)
+
def delete_volume(self, volume_id, **kwargs):
"""
DeleteVolume
@@ -1121,6 +1194,79 @@ def delete_volume_group_backup(self, volume_group_backup_id, **kwargs):
path_params=path_params,
header_params=header_params)
+ def delete_volume_kms_key(self, volume_id, **kwargs):
+ """
+ DeleteVolumeKmsKey
+ Remove kms for the specific volume. If the volume doesn't use KMS, then do nothing.
+
+
+ :param str volume_id: (required)
+ The OCID of the volume.
+
+ :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 `__.
+
+ 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 None
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/volumes/{volumeId}/kmsKey"
+ method = "DELETE"
+
+ # 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(
+ "delete_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "volumeId": volume_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)
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params)
+
def get_boot_volume(self, boot_volume_id, **kwargs):
"""
GetBootVolume
@@ -1249,6 +1395,81 @@ def get_boot_volume_backup(self, boot_volume_backup_id, **kwargs):
header_params=header_params,
response_type="BootVolumeBackup")
+ def get_boot_volume_kms_key(self, boot_volume_id, **kwargs):
+ """
+ GetBootVolumeKmsKey
+ Gets kms key id for the specified boot volume.
+
+
+ :param str boot_volume_id: (required)
+ The OCID of the boot volume.
+
+ :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 `__.
+
+ 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.core.models.BootVolumeKmsKey`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/bootVolumes/{bootVolumeId}/kmsKey"
+ method = "GET"
+
+ # 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(
+ "get_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "bootVolumeId": boot_volume_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="BootVolumeKmsKey")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="BootVolumeKmsKey")
+
def get_volume(self, volume_id, **kwargs):
"""
GetVolume
@@ -1713,6 +1934,81 @@ def get_volume_group_backup(self, volume_group_backup_id, **kwargs):
header_params=header_params,
response_type="VolumeGroupBackup")
+ def get_volume_kms_key(self, volume_id, **kwargs):
+ """
+ GetVolumeKmsKey
+ Gets kms key id for the specified volume.
+
+
+ :param str volume_id: (required)
+ The OCID of the volume.
+
+ :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 `__.
+
+ 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.core.models.VolumeKmsKey`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/volumes/{volumeId}/kmsKey"
+ method = "GET"
+
+ # 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(
+ "get_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "volumeId": volume_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="VolumeKmsKey")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="VolumeKmsKey")
+
def list_boot_volume_backups(self, compartment_id, **kwargs):
"""
ListBootVolumeBackups
@@ -2700,6 +2996,86 @@ def update_boot_volume_backup(self, boot_volume_backup_id, update_boot_volume_ba
body=update_boot_volume_backup_details,
response_type="BootVolumeBackup")
+ def update_boot_volume_kms_key(self, boot_volume_id, update_boot_volume_kms_key_details, **kwargs):
+ """
+ UpdateBootVolumeKmsKey
+ Update kms key id for the specific volume.
+
+
+ :param str boot_volume_id: (required)
+ The OCID of the boot volume.
+
+ :param UpdateBootVolumeKmsKeyDetails update_boot_volume_kms_key_details: (required)
+ Update kms key id for the specific boot volume.
+
+ :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 `__.
+
+ 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.core.models.BootVolumeKmsKey`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/bootVolumes/{bootVolumeId}/kmsKey"
+ method = "PUT"
+
+ # 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(
+ "update_boot_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "bootVolumeId": boot_volume_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,
+ body=update_boot_volume_kms_key_details,
+ response_type="BootVolumeKmsKey")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ body=update_boot_volume_kms_key_details,
+ response_type="BootVolumeKmsKey")
+
def update_volume(self, volume_id, update_volume_details, **kwargs):
"""
UpdateVolume
@@ -3030,3 +3406,83 @@ def update_volume_group_backup(self, volume_group_backup_id, update_volume_group
header_params=header_params,
body=update_volume_group_backup_details,
response_type="VolumeGroupBackup")
+
+ def update_volume_kms_key(self, volume_id, update_volume_kms_key_details, **kwargs):
+ """
+ UpdateVolumeKmsKey
+ Update kms key id for the specific volume.
+
+
+ :param str volume_id: (required)
+ The OCID of the volume.
+
+ :param UpdateVolumeKmsKeyDetails update_volume_kms_key_details: (required)
+ Update kms key id for the specific volume.
+
+ :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 `__.
+
+ 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.core.models.VolumeKmsKey`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/volumes/{volumeId}/kmsKey"
+ method = "PUT"
+
+ # 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(
+ "update_volume_kms_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "volumeId": volume_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,
+ body=update_volume_kms_key_details,
+ response_type="VolumeKmsKey")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ body=update_volume_kms_key_details,
+ response_type="VolumeKmsKey")
diff --git a/src/oci/core/models/__init__.py b/src/oci/core/models/__init__.py
index 590692e9ad..606d4e47e9 100644
--- a/src/oci/core/models/__init__.py
+++ b/src/oci/core/models/__init__.py
@@ -11,6 +11,7 @@
from .boot_volume import BootVolume
from .boot_volume_attachment import BootVolumeAttachment
from .boot_volume_backup import BootVolumeBackup
+from .boot_volume_kms_key import BootVolumeKmsKey
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
@@ -112,6 +113,7 @@
from .udp_options import UdpOptions
from .update_boot_volume_backup_details import UpdateBootVolumeBackupDetails
from .update_boot_volume_details import UpdateBootVolumeDetails
+from .update_boot_volume_kms_key_details import UpdateBootVolumeKmsKeyDetails
from .update_console_history_details import UpdateConsoleHistoryDetails
from .update_cpe_details import UpdateCpeDetails
from .update_cross_connect_details import UpdateCrossConnectDetails
@@ -138,6 +140,7 @@
from .update_volume_details import UpdateVolumeDetails
from .update_volume_group_backup_details import UpdateVolumeGroupBackupDetails
from .update_volume_group_details import UpdateVolumeGroupDetails
+from .update_volume_kms_key_details import UpdateVolumeKmsKeyDetails
from .vcn import Vcn
from .virtual_circuit import VirtualCircuit
from .virtual_circuit_bandwidth_shape import VirtualCircuitBandwidthShape
@@ -156,6 +159,7 @@
from .volume_group_source_from_volume_group_backup_details import VolumeGroupSourceFromVolumeGroupBackupDetails
from .volume_group_source_from_volume_group_details import VolumeGroupSourceFromVolumeGroupDetails
from .volume_group_source_from_volumes_details import VolumeGroupSourceFromVolumesDetails
+from .volume_kms_key import VolumeKmsKey
from .volume_source_details import VolumeSourceDetails
from .volume_source_from_volume_backup_details import VolumeSourceFromVolumeBackupDetails
from .volume_source_from_volume_details import VolumeSourceFromVolumeDetails
@@ -170,6 +174,7 @@
"BootVolume": BootVolume,
"BootVolumeAttachment": BootVolumeAttachment,
"BootVolumeBackup": BootVolumeBackup,
+ "BootVolumeKmsKey": BootVolumeKmsKey,
"BootVolumeSourceDetails": BootVolumeSourceDetails,
"BootVolumeSourceFromBootVolumeBackupDetails": BootVolumeSourceFromBootVolumeBackupDetails,
"BootVolumeSourceFromBootVolumeDetails": BootVolumeSourceFromBootVolumeDetails,
@@ -271,6 +276,7 @@
"UdpOptions": UdpOptions,
"UpdateBootVolumeBackupDetails": UpdateBootVolumeBackupDetails,
"UpdateBootVolumeDetails": UpdateBootVolumeDetails,
+ "UpdateBootVolumeKmsKeyDetails": UpdateBootVolumeKmsKeyDetails,
"UpdateConsoleHistoryDetails": UpdateConsoleHistoryDetails,
"UpdateCpeDetails": UpdateCpeDetails,
"UpdateCrossConnectDetails": UpdateCrossConnectDetails,
@@ -297,6 +303,7 @@
"UpdateVolumeDetails": UpdateVolumeDetails,
"UpdateVolumeGroupBackupDetails": UpdateVolumeGroupBackupDetails,
"UpdateVolumeGroupDetails": UpdateVolumeGroupDetails,
+ "UpdateVolumeKmsKeyDetails": UpdateVolumeKmsKeyDetails,
"Vcn": Vcn,
"VirtualCircuit": VirtualCircuit,
"VirtualCircuitBandwidthShape": VirtualCircuitBandwidthShape,
@@ -315,6 +322,7 @@
"VolumeGroupSourceFromVolumeGroupBackupDetails": VolumeGroupSourceFromVolumeGroupBackupDetails,
"VolumeGroupSourceFromVolumeGroupDetails": VolumeGroupSourceFromVolumeGroupDetails,
"VolumeGroupSourceFromVolumesDetails": VolumeGroupSourceFromVolumesDetails,
+ "VolumeKmsKey": VolumeKmsKey,
"VolumeSourceDetails": VolumeSourceDetails,
"VolumeSourceFromVolumeBackupDetails": VolumeSourceFromVolumeBackupDetails,
"VolumeSourceFromVolumeDetails": VolumeSourceFromVolumeDetails
diff --git a/src/oci/core/models/boot_volume.py b/src/oci/core/models/boot_volume.py
index cce5a2d852..6af4dccc7b 100644
--- a/src/oci/core/models/boot_volume.py
+++ b/src/oci/core/models/boot_volume.py
@@ -110,6 +110,10 @@ def __init__(self, **kwargs):
The value to assign to the volume_group_id property of this BootVolume.
:type volume_group_id: str
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this BootVolume.
+ :type kms_key_id: str
+
"""
self.swagger_types = {
'availability_domain': 'str',
@@ -125,7 +129,8 @@ def __init__(self, **kwargs):
'size_in_mbs': 'int',
'source_details': 'BootVolumeSourceDetails',
'time_created': 'datetime',
- 'volume_group_id': 'str'
+ 'volume_group_id': 'str',
+ 'kms_key_id': 'str'
}
self.attribute_map = {
@@ -142,7 +147,8 @@ def __init__(self, **kwargs):
'size_in_mbs': 'sizeInMBs',
'source_details': 'sourceDetails',
'time_created': 'timeCreated',
- 'volume_group_id': 'volumeGroupId'
+ 'volume_group_id': 'volumeGroupId',
+ 'kms_key_id': 'kmsKeyId'
}
self._availability_domain = None
@@ -159,6 +165,7 @@ def __init__(self, **kwargs):
self._source_details = None
self._time_created = None
self._volume_group_id = None
+ self._kms_key_id = None
@property
def availability_domain(self):
@@ -534,6 +541,30 @@ def volume_group_id(self, volume_group_id):
"""
self._volume_group_id = volume_group_id
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this BootVolume.
+ The OCID of the KMS key which is the master encryption key for the boot volume.
+
+
+ :return: The kms_key_id of this BootVolume.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this BootVolume.
+ The OCID of the KMS key which is the master encryption key for the boot volume.
+
+
+ :param kms_key_id: The kms_key_id of this BootVolume.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
def __repr__(self):
return formatted_flat_dict(self)
diff --git a/src/oci/core/models/boot_volume_kms_key.py b/src/oci/core/models/boot_volume_kms_key.py
new file mode 100644
index 0000000000..6660bcb394
--- /dev/null
+++ b/src/oci/core/models/boot_volume_kms_key.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class BootVolumeKmsKey(object):
+ """
+ Kms key id associated with this volume.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new BootVolumeKmsKey object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this BootVolumeKmsKey.
+ :type kms_key_id: str
+
+ """
+ self.swagger_types = {
+ 'kms_key_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'kms_key_id': 'kmsKeyId'
+ }
+
+ self._kms_key_id = None
+
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this BootVolumeKmsKey.
+ Kms key id associated with this volume. If volume is not using KMS, then kmsKeyId will be null string.
+
+
+ :return: The kms_key_id of this BootVolumeKmsKey.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this BootVolumeKmsKey.
+ Kms key id associated with this volume. If volume is not using KMS, then kmsKeyId will be null string.
+
+
+ :param kms_key_id: The kms_key_id of this BootVolumeKmsKey.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/core/models/create_boot_volume_details.py b/src/oci/core/models/create_boot_volume_details.py
index ad7b97ef4a..74a39d7038 100644
--- a/src/oci/core/models/create_boot_volume_details.py
+++ b/src/oci/core/models/create_boot_volume_details.py
@@ -41,6 +41,10 @@ def __init__(self, **kwargs):
The value to assign to the freeform_tags property of this CreateBootVolumeDetails.
:type freeform_tags: dict(str, str)
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this CreateBootVolumeDetails.
+ :type kms_key_id: str
+
:param size_in_gbs:
The value to assign to the size_in_gbs property of this CreateBootVolumeDetails.
:type size_in_gbs: int
@@ -57,6 +61,7 @@ def __init__(self, **kwargs):
'defined_tags': 'dict(str, dict(str, object))',
'display_name': 'str',
'freeform_tags': 'dict(str, str)',
+ 'kms_key_id': 'str',
'size_in_gbs': 'int',
'source_details': 'BootVolumeSourceDetails'
}
@@ -68,6 +73,7 @@ def __init__(self, **kwargs):
'defined_tags': 'definedTags',
'display_name': 'displayName',
'freeform_tags': 'freeformTags',
+ 'kms_key_id': 'kmsKeyId',
'size_in_gbs': 'sizeInGBs',
'source_details': 'sourceDetails'
}
@@ -78,6 +84,7 @@ def __init__(self, **kwargs):
self._defined_tags = None
self._display_name = None
self._freeform_tags = None
+ self._kms_key_id = None
self._size_in_gbs = None
self._source_details = None
@@ -255,6 +262,30 @@ def freeform_tags(self, freeform_tags):
"""
self._freeform_tags = freeform_tags
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this CreateBootVolumeDetails.
+ The OCID of the KMS key to be used as the master encryption key for the boot volume.
+
+
+ :return: The kms_key_id of this CreateBootVolumeDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this CreateBootVolumeDetails.
+ The OCID of the KMS key to be used as the master encryption key for the boot volume.
+
+
+ :param kms_key_id: The kms_key_id of this CreateBootVolumeDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
@property
def size_in_gbs(self):
"""
diff --git a/src/oci/core/models/create_image_details.py b/src/oci/core/models/create_image_details.py
index 8680bc9934..a9ba74653f 100644
--- a/src/oci/core/models/create_image_details.py
+++ b/src/oci/core/models/create_image_details.py
@@ -20,6 +20,10 @@ class CreateImageDetails(object):
#: This constant has a value of "EMULATED"
LAUNCH_MODE_EMULATED = "EMULATED"
+ #: A constant which can be used with the launch_mode property of a CreateImageDetails.
+ #: This constant has a value of "PARAVIRTUALIZED"
+ LAUNCH_MODE_PARAVIRTUALIZED = "PARAVIRTUALIZED"
+
#: A constant which can be used with the launch_mode property of a CreateImageDetails.
#: This constant has a value of "CUSTOM"
LAUNCH_MODE_CUSTOM = "CUSTOM"
@@ -55,7 +59,7 @@ def __init__(self, **kwargs):
:param launch_mode:
The value to assign to the launch_mode property of this CreateImageDetails.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM"
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM"
:type launch_mode: str
"""
@@ -270,9 +274,10 @@ def launch_mode(self):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM"
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM"
:return: The launch_mode of this CreateImageDetails.
@@ -287,13 +292,14 @@ def launch_mode(self, launch_mode):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
:param launch_mode: The launch_mode of this CreateImageDetails.
:type: str
"""
- allowed_values = ["NATIVE", "EMULATED", "CUSTOM"]
+ allowed_values = ["NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM"]
if not value_allowed_none_or_none_sentinel(launch_mode, allowed_values):
raise ValueError(
"Invalid value for `launch_mode`, must be None or one of {0}"
diff --git a/src/oci/core/models/create_volume_details.py b/src/oci/core/models/create_volume_details.py
index 6f4066cfca..fd5a14c2fa 100644
--- a/src/oci/core/models/create_volume_details.py
+++ b/src/oci/core/models/create_volume_details.py
@@ -41,6 +41,10 @@ def __init__(self, **kwargs):
The value to assign to the freeform_tags property of this CreateVolumeDetails.
:type freeform_tags: dict(str, str)
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this CreateVolumeDetails.
+ :type kms_key_id: str
+
:param size_in_gbs:
The value to assign to the size_in_gbs property of this CreateVolumeDetails.
:type size_in_gbs: int
@@ -65,6 +69,7 @@ def __init__(self, **kwargs):
'defined_tags': 'dict(str, dict(str, object))',
'display_name': 'str',
'freeform_tags': 'dict(str, str)',
+ 'kms_key_id': 'str',
'size_in_gbs': 'int',
'size_in_mbs': 'int',
'source_details': 'VolumeSourceDetails',
@@ -78,6 +83,7 @@ def __init__(self, **kwargs):
'defined_tags': 'definedTags',
'display_name': 'displayName',
'freeform_tags': 'freeformTags',
+ 'kms_key_id': 'kmsKeyId',
'size_in_gbs': 'sizeInGBs',
'size_in_mbs': 'sizeInMBs',
'source_details': 'sourceDetails',
@@ -90,6 +96,7 @@ def __init__(self, **kwargs):
self._defined_tags = None
self._display_name = None
self._freeform_tags = None
+ self._kms_key_id = None
self._size_in_gbs = None
self._size_in_mbs = None
self._source_details = None
@@ -269,6 +276,30 @@ def freeform_tags(self, freeform_tags):
"""
self._freeform_tags = freeform_tags
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this CreateVolumeDetails.
+ The OCID of the KMS key to be used as the master encryption key for the volume.
+
+
+ :return: The kms_key_id of this CreateVolumeDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this CreateVolumeDetails.
+ The OCID of the KMS key to be used as the master encryption key for the volume.
+
+
+ :param kms_key_id: The kms_key_id of this CreateVolumeDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
@property
def size_in_gbs(self):
"""
diff --git a/src/oci/core/models/image.py b/src/oci/core/models/image.py
index 3bae9cd0a6..c4aba0428d 100644
--- a/src/oci/core/models/image.py
+++ b/src/oci/core/models/image.py
@@ -31,6 +31,10 @@ class Image(object):
#: This constant has a value of "EMULATED"
LAUNCH_MODE_EMULATED = "EMULATED"
+ #: A constant which can be used with the launch_mode property of a Image.
+ #: This constant has a value of "PARAVIRTUALIZED"
+ LAUNCH_MODE_PARAVIRTUALIZED = "PARAVIRTUALIZED"
+
#: A constant which can be used with the launch_mode property of a Image.
#: This constant has a value of "CUSTOM"
LAUNCH_MODE_CUSTOM = "CUSTOM"
@@ -94,7 +98,7 @@ def __init__(self, **kwargs):
:param launch_mode:
The value to assign to the launch_mode property of this Image.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:type launch_mode: str
@@ -383,9 +387,10 @@ def launch_mode(self):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
@@ -401,13 +406,14 @@ def launch_mode(self, launch_mode):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
:param launch_mode: The launch_mode of this Image.
:type: str
"""
- allowed_values = ["NATIVE", "EMULATED", "CUSTOM"]
+ allowed_values = ["NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM"]
if not value_allowed_none_or_none_sentinel(launch_mode, allowed_values):
launch_mode = 'UNKNOWN_ENUM_VALUE'
self._launch_mode = launch_mode
diff --git a/src/oci/core/models/instance.py b/src/oci/core/models/instance.py
index 26ad7dd597..2d1172606f 100644
--- a/src/oci/core/models/instance.py
+++ b/src/oci/core/models/instance.py
@@ -33,6 +33,10 @@ class Instance(object):
#: This constant has a value of "EMULATED"
LAUNCH_MODE_EMULATED = "EMULATED"
+ #: A constant which can be used with the launch_mode property of a Instance.
+ #: This constant has a value of "PARAVIRTUALIZED"
+ LAUNCH_MODE_PARAVIRTUALIZED = "PARAVIRTUALIZED"
+
#: A constant which can be used with the launch_mode property of a Instance.
#: This constant has a value of "CUSTOM"
LAUNCH_MODE_CUSTOM = "CUSTOM"
@@ -116,7 +120,7 @@ def __init__(self, **kwargs):
:param launch_mode:
The value to assign to the launch_mode property of this Instance.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:type launch_mode: str
@@ -563,9 +567,10 @@ def launch_mode(self):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
- Allowed values for this property are: "NATIVE", "EMULATED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
@@ -581,13 +586,14 @@ def launch_mode(self, launch_mode):
Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
:param launch_mode: The launch_mode of this Instance.
:type: str
"""
- allowed_values = ["NATIVE", "EMULATED", "CUSTOM"]
+ allowed_values = ["NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM"]
if not value_allowed_none_or_none_sentinel(launch_mode, allowed_values):
launch_mode = 'UNKNOWN_ENUM_VALUE'
self._launch_mode = launch_mode
diff --git a/src/oci/core/models/instance_source_via_image_details.py b/src/oci/core/models/instance_source_via_image_details.py
index 400d5a84e0..eb855330bd 100644
--- a/src/oci/core/models/instance_source_via_image_details.py
+++ b/src/oci/core/models/instance_source_via_image_details.py
@@ -30,22 +30,29 @@ def __init__(self, **kwargs):
The value to assign to the image_id property of this InstanceSourceViaImageDetails.
:type image_id: str
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this InstanceSourceViaImageDetails.
+ :type kms_key_id: str
+
"""
self.swagger_types = {
'source_type': 'str',
'boot_volume_size_in_gbs': 'int',
- 'image_id': 'str'
+ 'image_id': 'str',
+ 'kms_key_id': 'str'
}
self.attribute_map = {
'source_type': 'sourceType',
'boot_volume_size_in_gbs': 'bootVolumeSizeInGBs',
- 'image_id': 'imageId'
+ 'image_id': 'imageId',
+ 'kms_key_id': 'kmsKeyId'
}
self._source_type = None
self._boot_volume_size_in_gbs = None
self._image_id = None
+ self._kms_key_id = None
self._source_type = 'image'
@property
@@ -96,6 +103,30 @@ def image_id(self, image_id):
"""
self._image_id = image_id
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this InstanceSourceViaImageDetails.
+ The OCID of the KMS key to be used as the master encryption key for the boot volume.
+
+
+ :return: The kms_key_id of this InstanceSourceViaImageDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this InstanceSourceViaImageDetails.
+ The OCID of the KMS key to be used as the master encryption key for the boot volume.
+
+
+ :param kms_key_id: The kms_key_id of this InstanceSourceViaImageDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
def __repr__(self):
return formatted_flat_dict(self)
diff --git a/src/oci/core/models/launch_options.py b/src/oci/core/models/launch_options.py
index eb4897780b..d93860c79f 100644
--- a/src/oci/core/models/launch_options.py
+++ b/src/oci/core/models/launch_options.py
@@ -48,6 +48,10 @@ class LaunchOptions(object):
#: This constant has a value of "VFIO"
NETWORK_TYPE_VFIO = "VFIO"
+ #: A constant which can be used with the network_type property of a LaunchOptions.
+ #: This constant has a value of "PARAVIRTUALIZED"
+ NETWORK_TYPE_PARAVIRTUALIZED = "PARAVIRTUALIZED"
+
#: A constant which can be used with the remote_data_volume_type property of a LaunchOptions.
#: This constant has a value of "ISCSI"
REMOTE_DATA_VOLUME_TYPE_ISCSI = "ISCSI"
@@ -87,7 +91,7 @@ def __init__(self, **kwargs):
:param network_type:
The value to assign to the network_type property of this LaunchOptions.
- Allowed values for this property are: "E1000", "VFIO", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "E1000", "VFIO", "PARAVIRTUALIZED", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:type network_type: str
@@ -206,8 +210,9 @@ def network_type(self):
Emulation type for NIC.
* `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver.
* `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
- Allowed values for this property are: "E1000", "VFIO", 'UNKNOWN_ENUM_VALUE'.
+ Allowed values for this property are: "E1000", "VFIO", "PARAVIRTUALIZED", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
@@ -223,12 +228,13 @@ def network_type(self, network_type):
Emulation type for NIC.
* `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver.
* `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.
+ * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
:param network_type: The network_type of this LaunchOptions.
:type: str
"""
- allowed_values = ["E1000", "VFIO"]
+ allowed_values = ["E1000", "VFIO", "PARAVIRTUALIZED"]
if not value_allowed_none_or_none_sentinel(network_type, allowed_values):
network_type = 'UNKNOWN_ENUM_VALUE'
self._network_type = network_type
diff --git a/src/oci/core/models/update_boot_volume_kms_key_details.py b/src/oci/core/models/update_boot_volume_kms_key_details.py
new file mode 100644
index 0000000000..e385f6f5cd
--- /dev/null
+++ b/src/oci/core/models/update_boot_volume_kms_key_details.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class UpdateBootVolumeKmsKeyDetails(object):
+ """
+ UpdateBootVolumeKmsKeyDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new UpdateBootVolumeKmsKeyDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this UpdateBootVolumeKmsKeyDetails.
+ :type kms_key_id: str
+
+ """
+ self.swagger_types = {
+ 'kms_key_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'kms_key_id': 'kmsKeyId'
+ }
+
+ self._kms_key_id = None
+
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this UpdateBootVolumeKmsKeyDetails.
+ The new kms key which will be used to protect the specific volume.
+ This key has to be a valid kms key ocid, and user must have key delegation policy to allow them to access this key.
+ Even if this new kms key is the same as the previous kms key id, block storage service will use it to regenerate a new volume encryption key.
+ Example: `{\"kmsKeyId\": \"ocid1.key.region1.sea.afnl2n7daag4s.abzwkljs6uevhlgcznhmh7oiatyrxngrywc3tje3uk3g77hzmewqiieuk75f\"}`
+
+
+ :return: The kms_key_id of this UpdateBootVolumeKmsKeyDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this UpdateBootVolumeKmsKeyDetails.
+ The new kms key which will be used to protect the specific volume.
+ This key has to be a valid kms key ocid, and user must have key delegation policy to allow them to access this key.
+ Even if this new kms key is the same as the previous kms key id, block storage service will use it to regenerate a new volume encryption key.
+ Example: `{\"kmsKeyId\": \"ocid1.key.region1.sea.afnl2n7daag4s.abzwkljs6uevhlgcznhmh7oiatyrxngrywc3tje3uk3g77hzmewqiieuk75f\"}`
+
+
+ :param kms_key_id: The kms_key_id of this UpdateBootVolumeKmsKeyDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/core/models/update_volume_kms_key_details.py b/src/oci/core/models/update_volume_kms_key_details.py
new file mode 100644
index 0000000000..a1309e1417
--- /dev/null
+++ b/src/oci/core/models/update_volume_kms_key_details.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class UpdateVolumeKmsKeyDetails(object):
+ """
+ UpdateVolumeKmsKeyDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new UpdateVolumeKmsKeyDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this UpdateVolumeKmsKeyDetails.
+ :type kms_key_id: str
+
+ """
+ self.swagger_types = {
+ 'kms_key_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'kms_key_id': 'kmsKeyId'
+ }
+
+ self._kms_key_id = None
+
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this UpdateVolumeKmsKeyDetails.
+ The new kms key which will be used to protect the specific volume.
+ This key has to be a valid kms key ocid, and user must have key delegation policy to allow them to access this key.
+ Even if this new kms key is the same as the previous kms key id, block storage service will use it to regenerate a new volume encryption key.
+ Example: `{\"kmsKeyId\": \"ocid1.key.region1.sea.afnl2n7daag4s.abzwkljs6uevhlgcznhmh7oiatyrxngrywc3tje3uk3g77hzmewqiieuk75f\"}`
+
+
+ :return: The kms_key_id of this UpdateVolumeKmsKeyDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this UpdateVolumeKmsKeyDetails.
+ The new kms key which will be used to protect the specific volume.
+ This key has to be a valid kms key ocid, and user must have key delegation policy to allow them to access this key.
+ Even if this new kms key is the same as the previous kms key id, block storage service will use it to regenerate a new volume encryption key.
+ Example: `{\"kmsKeyId\": \"ocid1.key.region1.sea.afnl2n7daag4s.abzwkljs6uevhlgcznhmh7oiatyrxngrywc3tje3uk3g77hzmewqiieuk75f\"}`
+
+
+ :param kms_key_id: The kms_key_id of this UpdateVolumeKmsKeyDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/core/models/volume.py b/src/oci/core/models/volume.py
index cf87cbc25a..8fb6e1975e 100644
--- a/src/oci/core/models/volume.py
+++ b/src/oci/core/models/volume.py
@@ -81,6 +81,10 @@ def __init__(self, **kwargs):
The value to assign to the is_hydrated property of this Volume.
:type is_hydrated: bool
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this Volume.
+ :type kms_key_id: str
+
:param lifecycle_state:
The value to assign to the lifecycle_state property of this Volume.
Allowed values for this property are: "PROVISIONING", "RESTORING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", 'UNKNOWN_ENUM_VALUE'.
@@ -116,6 +120,7 @@ def __init__(self, **kwargs):
'freeform_tags': 'dict(str, str)',
'id': 'str',
'is_hydrated': 'bool',
+ 'kms_key_id': 'str',
'lifecycle_state': 'str',
'size_in_gbs': 'int',
'size_in_mbs': 'int',
@@ -132,6 +137,7 @@ def __init__(self, **kwargs):
'freeform_tags': 'freeformTags',
'id': 'id',
'is_hydrated': 'isHydrated',
+ 'kms_key_id': 'kmsKeyId',
'lifecycle_state': 'lifecycleState',
'size_in_gbs': 'sizeInGBs',
'size_in_mbs': 'sizeInMBs',
@@ -147,6 +153,7 @@ def __init__(self, **kwargs):
self._freeform_tags = None
self._id = None
self._is_hydrated = None
+ self._kms_key_id = None
self._lifecycle_state = None
self._size_in_gbs = None
self._size_in_mbs = None
@@ -350,6 +357,30 @@ def is_hydrated(self, is_hydrated):
"""
self._is_hydrated = is_hydrated
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this Volume.
+ The OCID of the KMS key which is the master encryption key for the volume.
+
+
+ :return: The kms_key_id of this Volume.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this Volume.
+ The OCID of the KMS key which is the master encryption key for the volume.
+
+
+ :param kms_key_id: The kms_key_id of this Volume.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
@property
def lifecycle_state(self):
"""
diff --git a/src/oci/core/models/volume_kms_key.py b/src/oci/core/models/volume_kms_key.py
new file mode 100644
index 0000000000..ce0bb3fef1
--- /dev/null
+++ b/src/oci/core/models/volume_kms_key.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class VolumeKmsKey(object):
+ """
+ Kms key id associated with this volume.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new VolumeKmsKey object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this VolumeKmsKey.
+ :type kms_key_id: str
+
+ """
+ self.swagger_types = {
+ 'kms_key_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'kms_key_id': 'kmsKeyId'
+ }
+
+ self._kms_key_id = None
+
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this VolumeKmsKey.
+ Kms key id associated with this volume. If volume is not using KMS, then kmsKeyId will be null string.
+
+
+ :return: The kms_key_id of this VolumeKmsKey.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this VolumeKmsKey.
+ Kms key id associated with this volume. If volume is not using KMS, then kmsKeyId will be null string.
+
+
+ :param kms_key_id: The kms_key_id of this VolumeKmsKey.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/exceptions.py b/src/oci/exceptions.py
index ae60ecd5e1..8ca8663665 100644
--- a/src/oci/exceptions.py
+++ b/src/oci/exceptions.py
@@ -123,3 +123,8 @@ class ConnectTimeout(BaseConnectTimeout):
Requests that produced this error are safe to retry.
"""
+
+
+class MissingEndpointForNonRegionalServiceClientError(ValueError):
+ """No endpoint value was provided when trying to create a non-regional service client.
+ """
diff --git a/src/oci/key_management/__init__.py b/src/oci/key_management/__init__.py
new file mode 100644
index 0000000000..26f4b699f0
--- /dev/null
+++ b/src/oci/key_management/__init__.py
@@ -0,0 +1,15 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+from __future__ import absolute_import
+
+
+from .kms_crypto_client import KmsCryptoClient
+from .kms_crypto_client_composite_operations import KmsCryptoClientCompositeOperations
+from .kms_management_client import KmsManagementClient
+from .kms_management_client_composite_operations import KmsManagementClientCompositeOperations
+from .kms_vault_client import KmsVaultClient
+from .kms_vault_client_composite_operations import KmsVaultClientCompositeOperations
+from . import models
+
+__all__ = ["KmsCryptoClient", "KmsCryptoClientCompositeOperations", "KmsManagementClient", "KmsManagementClientCompositeOperations", "KmsVaultClient", "KmsVaultClientCompositeOperations", "models"]
diff --git a/src/oci/key_management/kms_crypto_client.py b/src/oci/key_management/kms_crypto_client.py
new file mode 100644
index 0000000000..85e5c0e8bc
--- /dev/null
+++ b/src/oci/key_management/kms_crypto_client.py
@@ -0,0 +1,276 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+from __future__ import absolute_import
+
+from oci._vendor import requests # noqa: F401
+from oci._vendor import six
+
+from oci import retry # noqa: F401
+from oci.base_client import BaseClient
+from oci.config import get_config_value_or_default, validate_config
+from oci.signer import Signer
+from oci.util import Sentinel
+from .models import key_management_type_mapping
+missing = Sentinel("Missing")
+
+
+class KmsCryptoClient(object):
+ """
+ API for managing and performing operations with keys and vaults.
+ """
+
+ def __init__(self, config, **kwargs):
+ """
+ Creates a new service client
+
+ :param dict config:
+ Configuration keys and values as per `SDK and Tool Configuration `__.
+ The :py:meth:`~oci.config.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 :py:meth:`~oci.config.validate_config`
+
+ :param str service_endpoint: (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.
+
+ :param timeout: (optional)
+ The connection and read timeouts for the client. The default is that the client never times out. 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.
+ :type timeout: float or tuple(float, float)
+
+ :param signer: (optional)
+ The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.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 :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument
+ :type signer: :py:class:`~oci.signer.AbstractBaseSigner`
+
+ :param obj retry_strategy: (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 :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 `__.
+ """
+ validate_config(config, signer=kwargs.get('signer'))
+ if 'signer' in kwargs:
+ signer = kwargs['signer']
+ else:
+ signer = Signer(
+ tenancy=config["tenancy"],
+ user=config["user"],
+ fingerprint=config["fingerprint"],
+ private_key_file_location=config.get("key_file"),
+ pass_phrase=get_config_value_or_default(config, "pass_phrase"),
+ private_key_content=config.get("key_content")
+ )
+
+ base_client_init_kwargs = {
+ 'regional_client': False,
+ 'service_endpoint': kwargs.get('service_endpoint'),
+ 'timeout': kwargs.get('timeout'),
+ 'base_path': '/20180608'
+ }
+ self.base_client = BaseClient("kms_crypto", config, signer, key_management_type_mapping, **base_client_init_kwargs)
+ self.retry_strategy = kwargs.get('retry_strategy')
+
+ def decrypt(self, decrypt_data_details, **kwargs):
+ """
+ Decrypt
+ Decrypts data using the given DecryptDataDetails resource.
+
+
+ :param DecryptDataDetails decrypt_data_details: (required)
+ DecryptDataDetails
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.DecryptedData`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/decrypt"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "decrypt got unknown kwargs: {!r}".format(extra_kwargs))
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ header_params=header_params,
+ body=decrypt_data_details,
+ response_type="DecryptedData")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=decrypt_data_details,
+ response_type="DecryptedData")
+
+ def encrypt(self, encrypt_data_details, **kwargs):
+ """
+ Encrypt
+ Encrypts data using the given EncryptDataDetails resource.
+ Plaintext included in the example request is a base64-encoded value
+ of a UTF-8 string.
+
+
+ :param EncryptDataDetails encrypt_data_details: (required)
+ EncryptDataDetails
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.EncryptedData`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/encrypt"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "encrypt got unknown kwargs: {!r}".format(extra_kwargs))
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ header_params=header_params,
+ body=encrypt_data_details,
+ response_type="EncryptedData")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=encrypt_data_details,
+ response_type="EncryptedData")
+
+ def generate_data_encryption_key(self, generate_key_details, **kwargs):
+ """
+ GenerateDataEncryptionKey
+ Generates a key that you can use to encrypt or decrypt data.
+
+
+ :param GenerateKeyDetails generate_key_details: (required)
+ GenerateKeyDetails
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.GeneratedKey`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/generateDataEncryptionKey"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "generate_data_encryption_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ header_params=header_params,
+ body=generate_key_details,
+ response_type="GeneratedKey")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=generate_key_details,
+ response_type="GeneratedKey")
diff --git a/src/oci/key_management/kms_crypto_client_composite_operations.py b/src/oci/key_management/kms_crypto_client_composite_operations.py
new file mode 100644
index 0000000000..9ca07f5098
--- /dev/null
+++ b/src/oci/key_management/kms_crypto_client_composite_operations.py
@@ -0,0 +1,22 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+import oci # noqa: F401
+
+
+class KmsCryptoClientCompositeOperations(object):
+ """
+ This class provides a wrapper around :py:class:`~oci.key_management.KmsCryptoClient` and offers convenience methods
+ for operations that would otherwise need to be chained together. For example, instead of performing an action
+ on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
+ to enter a given state, you can call a single method in this class to accomplish the same functionality
+ """
+
+ def __init__(self, client, **kwargs):
+ """
+ Creates a new KmsCryptoClientCompositeOperations object
+
+ :param KmsCryptoClient client:
+ The service client which will be wrapped by this object
+ """
+ self.client = client
diff --git a/src/oci/key_management/kms_management_client.py b/src/oci/key_management/kms_management_client.py
new file mode 100644
index 0000000000..44eebcbe16
--- /dev/null
+++ b/src/oci/key_management/kms_management_client.py
@@ -0,0 +1,916 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+from __future__ import absolute_import
+
+from oci._vendor import requests # noqa: F401
+from oci._vendor import six
+
+from oci import retry # noqa: F401
+from oci.base_client import BaseClient
+from oci.config import get_config_value_or_default, validate_config
+from oci.signer import Signer
+from oci.util import Sentinel
+from .models import key_management_type_mapping
+missing = Sentinel("Missing")
+
+
+class KmsManagementClient(object):
+ """
+ API for managing and performing operations with keys and vaults.
+ """
+
+ def __init__(self, config, **kwargs):
+ """
+ Creates a new service client
+
+ :param dict config:
+ Configuration keys and values as per `SDK and Tool Configuration `__.
+ The :py:meth:`~oci.config.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 :py:meth:`~oci.config.validate_config`
+
+ :param str service_endpoint: (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.
+
+ :param timeout: (optional)
+ The connection and read timeouts for the client. The default is that the client never times out. 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.
+ :type timeout: float or tuple(float, float)
+
+ :param signer: (optional)
+ The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.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 :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument
+ :type signer: :py:class:`~oci.signer.AbstractBaseSigner`
+
+ :param obj retry_strategy: (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 :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 `__.
+ """
+ validate_config(config, signer=kwargs.get('signer'))
+ if 'signer' in kwargs:
+ signer = kwargs['signer']
+ else:
+ signer = Signer(
+ tenancy=config["tenancy"],
+ user=config["user"],
+ fingerprint=config["fingerprint"],
+ private_key_file_location=config.get("key_file"),
+ pass_phrase=get_config_value_or_default(config, "pass_phrase"),
+ private_key_content=config.get("key_content")
+ )
+
+ base_client_init_kwargs = {
+ 'regional_client': False,
+ 'service_endpoint': kwargs.get('service_endpoint'),
+ 'timeout': kwargs.get('timeout'),
+ 'base_path': '/20180608'
+ }
+ self.base_client = BaseClient("kms_management", config, signer, key_management_type_mapping, **base_client_init_kwargs)
+ self.retry_strategy = kwargs.get('retry_strategy')
+
+ def create_key(self, create_key_details, **kwargs):
+ """
+ CreateKey
+ Creates a new key.
+
+
+ :param CreateKeyDetails create_key_details: (required)
+ CreateKeyDetails
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Key`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "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(
+ "create_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ return retry_strategy.make_retrying_call(
+ self.base_client.call_api,
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=create_key_details,
+ response_type="Key")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=create_key_details,
+ response_type="Key")
+
+ def create_key_version(self, key_id, **kwargs):
+ """
+ Create new KeyVersion and rotate the key to use it for encryption.
+ Generates new cryptographic material for a key. Key must be in an `ENABLED` state to be
+ rotated.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.KeyVersion`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}/keyVersions"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "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(
+ "create_key_version got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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",
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ 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="KeyVersion")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="KeyVersion")
+
+ def disable_key(self, key_id, **kwargs):
+ """
+ DisableKey
+ Disables a key to make it unavailable for encryption
+ or decryption.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Key`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}/actions/disable"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "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(
+ "disable_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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),
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ 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="Key")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="Key")
+
+ def enable_key(self, key_id, **kwargs):
+ """
+ EnableKey
+ Enables a key to make it available for encryption or
+ decryption.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Key`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}/actions/enable"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "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(
+ "enable_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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),
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ 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="Key")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="Key")
+
+ def get_key(self, key_id, **kwargs):
+ """
+ GetKey
+ Gets information about the specified key.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.Key`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "get_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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",
+ "opc-request-id": kwargs.get("opc_request_id", 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="Key")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="Key")
+
+ def get_key_version(self, key_id, key_version_id, **kwargs):
+ """
+ GetKeyVersion
+ Gets information about the specified key version.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param str key_version_id: (required)
+ The OCID of the key version.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.KeyVersion`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}/keyVersions/{keyVersionId}"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "get_key_version got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_id,
+ "keyVersionId": key_version_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",
+ "opc-request-id": kwargs.get("opc_request_id", 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="KeyVersion")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="KeyVersion")
+
+ def list_key_versions(self, key_id, **kwargs):
+ """
+ ListKeyVersions
+ Lists all key versions for the specified key.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param int limit: (optional)
+ The maximum number of items to return in a paginated \"List\" call.
+
+ :param str page: (optional)
+ The value of the `opc-next-page` response header
+ from the previous \"List\" call.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :param str sort_by: (optional)
+ The field to sort by. You can specify only one sort order. The default
+ order for TIMECREATED is descending. The default order for DISPLAYNAME
+ is ascending.
+
+ Allowed values are: "TIMECREATED", "DISPLAYNAME"
+
+ :param str sort_order: (optional)
+ The sort order to use, either ascending (`ASC`) or descending (`DESC`).
+
+ Allowed values are: "ASC", "DESC"
+
+ :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 `__.
+
+ 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 list of :class:`~oci.key_management.models.KeyVersionSummary`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}/keyVersions"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "limit",
+ "page",
+ "opc_request_id",
+ "sort_by",
+ "sort_order"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "list_key_versions got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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))
+
+ if 'sort_by' in kwargs:
+ sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"]
+ if kwargs['sort_by'] not in sort_by_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values)
+ )
+
+ if 'sort_order' in kwargs:
+ sort_order_allowed_values = ["ASC", "DESC"]
+ if kwargs['sort_order'] not in sort_order_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values)
+ )
+
+ query_params = {
+ "limit": kwargs.get("limit", missing),
+ "page": kwargs.get("page", missing),
+ "sortBy": kwargs.get("sort_by", missing),
+ "sortOrder": kwargs.get("sort_order", missing)
+ }
+ query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[KeyVersionSummary]")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[KeyVersionSummary]")
+
+ def list_keys(self, compartment_id, **kwargs):
+ """
+ ListKeys
+ Lists the keys in the specified vault and compartment.
+
+
+ :param str compartment_id: (required)
+ The OCID of the compartment.
+
+ :param int limit: (optional)
+ The maximum number of items to return in a paginated \"List\" call.
+
+ :param str page: (optional)
+ The value of the `opc-next-page` response header
+ from the previous \"List\" call.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :param str sort_by: (optional)
+ The field to sort by. You can specify only one sort order. The default
+ order for TIMECREATED is descending. The default order for DISPLAYNAME
+ is ascending.
+
+ Allowed values are: "TIMECREATED", "DISPLAYNAME"
+
+ :param str sort_order: (optional)
+ The sort order to use, either ascending (`ASC`) or descending (`DESC`).
+
+ Allowed values are: "ASC", "DESC"
+
+ :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 `__.
+
+ 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 list of :class:`~oci.key_management.models.KeySummary`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "limit",
+ "page",
+ "opc_request_id",
+ "sort_by",
+ "sort_order"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "list_keys got unknown kwargs: {!r}".format(extra_kwargs))
+
+ if 'sort_by' in kwargs:
+ sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"]
+ if kwargs['sort_by'] not in sort_by_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values)
+ )
+
+ if 'sort_order' in kwargs:
+ sort_order_allowed_values = ["ASC", "DESC"]
+ if kwargs['sort_order'] not in sort_order_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values)
+ )
+
+ query_params = {
+ "compartmentId": compartment_id,
+ "limit": kwargs.get("limit", missing),
+ "page": kwargs.get("page", missing),
+ "sortBy": kwargs.get("sort_by", missing),
+ "sortOrder": kwargs.get("sort_order", missing)
+ }
+ query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[KeySummary]")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[KeySummary]")
+
+ def update_key(self, key_id, update_key_details, **kwargs):
+ """
+ UpdateKey
+ Updates the properties of a key. Specifically, you can
+ only update the `displayName` property. Furthermore, the
+ key must in an `ACTIVE` or `CREATING` state.
+
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param UpdateKeyDetails update_key_details: (required)
+ UpdateKeyDetails
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.Key`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/keys/{keyId}"
+ method = "PUT"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "if_match",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "update_key got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "keyId": key_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),
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ body=update_key_details,
+ response_type="Key")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ body=update_key_details,
+ response_type="Key")
diff --git a/src/oci/key_management/kms_management_client_composite_operations.py b/src/oci/key_management/kms_management_client_composite_operations.py
new file mode 100644
index 0000000000..ebdc499683
--- /dev/null
+++ b/src/oci/key_management/kms_management_client_composite_operations.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+import oci # noqa: F401
+
+
+class KmsManagementClientCompositeOperations(object):
+ """
+ This class provides a wrapper around :py:class:`~oci.key_management.KmsManagementClient` and offers convenience methods
+ for operations that would otherwise need to be chained together. For example, instead of performing an action
+ on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
+ to enter a given state, you can call a single method in this class to accomplish the same functionality
+ """
+
+ def __init__(self, client, **kwargs):
+ """
+ Creates a new KmsManagementClientCompositeOperations object
+
+ :param KmsManagementClient client:
+ The service client which will be wrapped by this object
+ """
+ self.client = client
+
+ def create_key_and_wait_for_state(self, create_key_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
+ """
+ Calls :py:func:`~oci.key_management.KmsManagementClient.create_key` and waits for the :py:class:`~oci.key_management.models.Key` acted upon
+ to enter the given state(s).
+
+ :param CreateKeyDetails create_key_details: (required)
+ CreateKeyDetails
+
+ :param list[str] wait_for_states:
+ An array of states to wait on. These should be valid values for :py:attr:`~oci.key_management.models.Key.lifecycle_state`
+
+ :param dict operation_kwargs:
+ A dictionary of keyword arguments to pass to :py:func:`~oci.key_management.KmsManagementClient.create_key`
+
+ :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_key(create_key_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_key(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_key_and_wait_for_state(self, key_id, update_key_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
+ """
+ Calls :py:func:`~oci.key_management.KmsManagementClient.update_key` and waits for the :py:class:`~oci.key_management.models.Key` acted upon
+ to enter the given state(s).
+
+ :param str key_id: (required)
+ The OCID of the key.
+
+ :param UpdateKeyDetails update_key_details: (required)
+ UpdateKeyDetails
+
+ :param list[str] wait_for_states:
+ An array of states to wait on. These should be valid values for :py:attr:`~oci.key_management.models.Key.lifecycle_state`
+
+ :param dict operation_kwargs:
+ A dictionary of keyword arguments to pass to :py:func:`~oci.key_management.KmsManagementClient.update_key`
+
+ :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_key(key_id, update_key_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_key(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)
diff --git a/src/oci/key_management/kms_vault_client.py b/src/oci/key_management/kms_vault_client.py
new file mode 100644
index 0000000000..e70acc9462
--- /dev/null
+++ b/src/oci/key_management/kms_vault_client.py
@@ -0,0 +1,636 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+from __future__ import absolute_import
+
+from oci._vendor import requests # noqa: F401
+from oci._vendor import six
+
+from oci import retry # noqa: F401
+from oci.base_client import BaseClient
+from oci.config import get_config_value_or_default, validate_config
+from oci.signer import Signer
+from oci.util import Sentinel
+from .models import key_management_type_mapping
+missing = Sentinel("Missing")
+
+
+class KmsVaultClient(object):
+ """
+ API for managing and performing operations with keys and vaults.
+ """
+
+ def __init__(self, config, **kwargs):
+ """
+ Creates a new service client
+
+ :param dict config:
+ Configuration keys and values as per `SDK and Tool Configuration `__.
+ The :py:meth:`~oci.config.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 :py:meth:`~oci.config.validate_config`
+
+ :param str service_endpoint: (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.
+
+ :param timeout: (optional)
+ The connection and read timeouts for the client. The default is that the client never times out. 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.
+ :type timeout: float or tuple(float, float)
+
+ :param signer: (optional)
+ The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.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 :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument
+ :type signer: :py:class:`~oci.signer.AbstractBaseSigner`
+
+ :param obj retry_strategy: (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 :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 `__.
+ """
+ validate_config(config, signer=kwargs.get('signer'))
+ if 'signer' in kwargs:
+ signer = kwargs['signer']
+ else:
+ signer = Signer(
+ tenancy=config["tenancy"],
+ user=config["user"],
+ fingerprint=config["fingerprint"],
+ private_key_file_location=config.get("key_file"),
+ pass_phrase=get_config_value_or_default(config, "pass_phrase"),
+ private_key_content=config.get("key_content")
+ )
+
+ base_client_init_kwargs = {
+ 'regional_client': True,
+ 'service_endpoint': kwargs.get('service_endpoint'),
+ 'timeout': kwargs.get('timeout'),
+ 'base_path': '/20180608'
+ }
+ self.base_client = BaseClient("kms_vault", config, signer, key_management_type_mapping, **base_client_init_kwargs)
+ self.retry_strategy = kwargs.get('retry_strategy')
+
+ def cancel_vault_deletion(self, vault_id, **kwargs):
+ """
+ CancelVaultDeletion
+ Cancels the scheduled deletion of the specified Vault, which must be in PendingDeletion
+ state. The Vault and all Keys in it will be moved back to their previous states before
+ the deletion was scheduled.
+
+
+ :param str vault_id: (required)
+ The OCID of the vault.
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Vault`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults/{vaultId}/actions/cancelDeletion"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "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(
+ "cancel_vault_deletion got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "vaultId": vault_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),
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ 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="Vault")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="Vault")
+
+ def create_vault(self, create_vault_details, **kwargs):
+ """
+ CreateVault
+ Creates a new vault. The type of vault you create determines key
+ placement, pricing, and available options. Options include storage
+ isolation, a dedicated service endpoint instead of a shared service
+ endpoint for API calls, and a dedicated HSM or a multitenant HSM.
+
+
+ :param CreateVaultDetails create_vault_details: (required)
+ CreateVaultDetails
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Vault`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "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(
+ "create_vault got unknown kwargs: {!r}".format(extra_kwargs))
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ return retry_strategy.make_retrying_call(
+ self.base_client.call_api,
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=create_vault_details,
+ response_type="Vault")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ header_params=header_params,
+ body=create_vault_details,
+ response_type="Vault")
+
+ def get_vault(self, vault_id, **kwargs):
+ """
+ GetVault
+ Gets the specified vault's configuration information.
+
+
+ :param str vault_id: (required)
+ The OCID of the vault.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.Vault`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults/{vaultId}"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "get_vault got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "vaultId": vault_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",
+ "opc-request-id": kwargs.get("opc_request_id", 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="Vault")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ response_type="Vault")
+
+ def list_vaults(self, compartment_id, **kwargs):
+ """
+ ListVaults
+ Lists vaults in the specified compartment.
+
+
+ :param str compartment_id: (required)
+ The OCID of the compartment.
+
+ :param int limit: (optional)
+ The maximum number of items to return in a paginated \"List\" call.
+
+ :param str page: (optional)
+ The value of the `opc-next-page` response header
+ from the previous \"List\" call.
+
+ :param str opc_request_id: (optional)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :param str sort_by: (optional)
+ The field to sort by. You can specify only one sort order. The default
+ order for TIMECREATED is descending. The default order for DISPLAYNAME
+ is ascending.
+
+ Allowed values are: "TIMECREATED", "DISPLAYNAME"
+
+ :param str sort_order: (optional)
+ The sort order to use, either ascending (`ASC`) or descending (`DESC`).
+
+ Allowed values are: "ASC", "DESC"
+
+ :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 `__.
+
+ 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 list of :class:`~oci.key_management.models.VaultSummary`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults"
+ method = "GET"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "limit",
+ "page",
+ "opc_request_id",
+ "sort_by",
+ "sort_order"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "list_vaults got unknown kwargs: {!r}".format(extra_kwargs))
+
+ if 'sort_by' in kwargs:
+ sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"]
+ if kwargs['sort_by'] not in sort_by_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values)
+ )
+
+ if 'sort_order' in kwargs:
+ sort_order_allowed_values = ["ASC", "DESC"]
+ if kwargs['sort_order'] not in sort_order_allowed_values:
+ raise ValueError(
+ "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values)
+ )
+
+ query_params = {
+ "compartmentId": compartment_id,
+ "limit": kwargs.get("limit", missing),
+ "page": kwargs.get("page", missing),
+ "sortBy": kwargs.get("sort_by", missing),
+ "sortOrder": kwargs.get("sort_order", missing)
+ }
+ query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
+
+ header_params = {
+ "accept": "application/json",
+ "content-type": "application/json",
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[VaultSummary]")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ query_params=query_params,
+ header_params=header_params,
+ response_type="list[VaultSummary]")
+
+ def schedule_vault_deletion(self, vault_id, schedule_vault_deletion_details, **kwargs):
+ """
+ ScheduleVaultDeletion
+ Schedules the deletion of the specified Vault. The Vault and all Keys in it
+ will be moved to PendingDeletion state and deleted after the retention period.
+
+
+ :param str vault_id: (required)
+ The OCID of the vault.
+
+ :param ScheduleVaultDeletionDetails schedule_vault_deletion_details: (required)
+ ScheduleVaultDeletionDetails
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 (e.g., if a resource has been
+ deleted and purged from the system, then a retry of the original
+ creation request may 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. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
+ is also available. The specifics of the default retry strategy are described `here `__.
+
+ 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.key_management.models.Vault`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults/{vaultId}/actions/scheduleDeletion"
+ method = "POST"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "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(
+ "schedule_vault_deletion got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "vaultId": vault_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),
+ "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.retry_strategy
+ if kwargs.get('retry_strategy'):
+ retry_strategy = kwargs.get('retry_strategy')
+
+ if retry_strategy:
+ if not isinstance(retry_strategy, retry.NoneRetryStrategy):
+ self.base_client.add_opc_retry_token_if_needed(header_params)
+ 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,
+ body=schedule_vault_deletion_details,
+ response_type="Vault")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ body=schedule_vault_deletion_details,
+ response_type="Vault")
+
+ def update_vault(self, vault_id, update_vault_details, **kwargs):
+ """
+ UpdateVault
+ Updates the properties of a vault. Specifically, you can
+ only update the `displayName` property. Furthermore, the vault
+ must be in an `ACTIVE` or `CREATING` state.
+
+
+ :param str vault_id: (required)
+ The OCID of the vault.
+
+ :param UpdateVaultDetails update_vault_details: (required)
+ UpdateVaultDetails
+
+ :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)
+ Unique identifier for the request. If provided, the returned request ID
+ will include this value. Otherwise, a random request ID will be
+ generated by the service.
+
+ :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 `__.
+
+ 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.key_management.models.Vault`
+ :rtype: :class:`~oci.response.Response`
+ """
+ resource_path = "/vaults/{vaultId}"
+ method = "PUT"
+
+ # Don't accept unknown kwargs
+ expected_kwargs = [
+ "retry_strategy",
+ "if_match",
+ "opc_request_id"
+ ]
+ extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
+ if extra_kwargs:
+ raise ValueError(
+ "update_vault got unknown kwargs: {!r}".format(extra_kwargs))
+
+ path_params = {
+ "vaultId": vault_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),
+ "opc-request-id": kwargs.get("opc_request_id", 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,
+ body=update_vault_details,
+ response_type="Vault")
+ else:
+ return self.base_client.call_api(
+ resource_path=resource_path,
+ method=method,
+ path_params=path_params,
+ header_params=header_params,
+ body=update_vault_details,
+ response_type="Vault")
diff --git a/src/oci/key_management/kms_vault_client_composite_operations.py b/src/oci/key_management/kms_vault_client_composite_operations.py
new file mode 100644
index 0000000000..72f5ba8bc1
--- /dev/null
+++ b/src/oci/key_management/kms_vault_client_composite_operations.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+import oci # noqa: F401
+
+
+class KmsVaultClientCompositeOperations(object):
+ """
+ This class provides a wrapper around :py:class:`~oci.key_management.KmsVaultClient` and offers convenience methods
+ for operations that would otherwise need to be chained together. For example, instead of performing an action
+ on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
+ to enter a given state, you can call a single method in this class to accomplish the same functionality
+ """
+
+ def __init__(self, client, **kwargs):
+ """
+ Creates a new KmsVaultClientCompositeOperations object
+
+ :param KmsVaultClient client:
+ The service client which will be wrapped by this object
+ """
+ self.client = client
+
+ def create_vault_and_wait_for_state(self, create_vault_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
+ """
+ Calls :py:func:`~oci.key_management.KmsVaultClient.create_vault` and waits for the :py:class:`~oci.key_management.models.Vault` acted upon
+ to enter the given state(s).
+
+ :param CreateVaultDetails create_vault_details: (required)
+ CreateVaultDetails
+
+ :param list[str] wait_for_states:
+ An array of states to wait on. These should be valid values for :py:attr:`~oci.key_management.models.Vault.lifecycle_state`
+
+ :param dict operation_kwargs:
+ A dictionary of keyword arguments to pass to :py:func:`~oci.key_management.KmsVaultClient.create_vault`
+
+ :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_vault(create_vault_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_vault(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_vault_and_wait_for_state(self, vault_id, update_vault_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
+ """
+ Calls :py:func:`~oci.key_management.KmsVaultClient.update_vault` and waits for the :py:class:`~oci.key_management.models.Vault` acted upon
+ to enter the given state(s).
+
+ :param str vault_id: (required)
+ The OCID of the vault.
+
+ :param UpdateVaultDetails update_vault_details: (required)
+ UpdateVaultDetails
+
+ :param list[str] wait_for_states:
+ An array of states to wait on. These should be valid values for :py:attr:`~oci.key_management.models.Vault.lifecycle_state`
+
+ :param dict operation_kwargs:
+ A dictionary of keyword arguments to pass to :py:func:`~oci.key_management.KmsVaultClient.update_vault`
+
+ :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_vault(vault_id, update_vault_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_vault(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)
diff --git a/src/oci/key_management/models/__init__.py b/src/oci/key_management/models/__init__.py
new file mode 100644
index 0000000000..ebb68eec7e
--- /dev/null
+++ b/src/oci/key_management/models/__init__.py
@@ -0,0 +1,45 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+from __future__ import absolute_import
+
+from .create_key_details import CreateKeyDetails
+from .create_vault_details import CreateVaultDetails
+from .decrypt_data_details import DecryptDataDetails
+from .decrypted_data import DecryptedData
+from .encrypt_data_details import EncryptDataDetails
+from .encrypted_data import EncryptedData
+from .generate_key_details import GenerateKeyDetails
+from .generated_key import GeneratedKey
+from .key import Key
+from .key_shape import KeyShape
+from .key_summary import KeySummary
+from .key_version import KeyVersion
+from .key_version_summary import KeyVersionSummary
+from .schedule_vault_deletion_details import ScheduleVaultDeletionDetails
+from .update_key_details import UpdateKeyDetails
+from .update_vault_details import UpdateVaultDetails
+from .vault import Vault
+from .vault_summary import VaultSummary
+
+# Maps type names to classes for key_management services.
+key_management_type_mapping = {
+ "CreateKeyDetails": CreateKeyDetails,
+ "CreateVaultDetails": CreateVaultDetails,
+ "DecryptDataDetails": DecryptDataDetails,
+ "DecryptedData": DecryptedData,
+ "EncryptDataDetails": EncryptDataDetails,
+ "EncryptedData": EncryptedData,
+ "GenerateKeyDetails": GenerateKeyDetails,
+ "GeneratedKey": GeneratedKey,
+ "Key": Key,
+ "KeyShape": KeyShape,
+ "KeySummary": KeySummary,
+ "KeyVersion": KeyVersion,
+ "KeyVersionSummary": KeyVersionSummary,
+ "ScheduleVaultDeletionDetails": ScheduleVaultDeletionDetails,
+ "UpdateKeyDetails": UpdateKeyDetails,
+ "UpdateVaultDetails": UpdateVaultDetails,
+ "Vault": Vault,
+ "VaultSummary": VaultSummary
+}
diff --git a/src/oci/key_management/models/create_key_details.py b/src/oci/key_management/models/create_key_details.py
new file mode 100644
index 0000000000..73c58d8e94
--- /dev/null
+++ b/src/oci/key_management/models/create_key_details.py
@@ -0,0 +1,129 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class CreateKeyDetails(object):
+ """
+ CreateKeyDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new CreateKeyDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this CreateKeyDetails.
+ :type compartment_id: str
+
+ :param display_name:
+ The value to assign to the display_name property of this CreateKeyDetails.
+ :type display_name: str
+
+ :param key_shape:
+ The value to assign to the key_shape property of this CreateKeyDetails.
+ :type key_shape: KeyShape
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'display_name': 'str',
+ 'key_shape': 'KeyShape'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'display_name': 'displayName',
+ 'key_shape': 'keyShape'
+ }
+
+ self._compartment_id = None
+ self._display_name = None
+ self._key_shape = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this CreateKeyDetails.
+ The OCID of the compartment that contains this key.
+
+
+ :return: The compartment_id of this CreateKeyDetails.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this CreateKeyDetails.
+ The OCID of the compartment that contains this key.
+
+
+ :param compartment_id: The compartment_id of this CreateKeyDetails.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this CreateKeyDetails.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this CreateKeyDetails.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this CreateKeyDetails.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this CreateKeyDetails.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def key_shape(self):
+ """
+ **[Required]** Gets the key_shape of this CreateKeyDetails.
+
+ :return: The key_shape of this CreateKeyDetails.
+ :rtype: KeyShape
+ """
+ return self._key_shape
+
+ @key_shape.setter
+ def key_shape(self, key_shape):
+ """
+ Sets the key_shape of this CreateKeyDetails.
+
+ :param key_shape: The key_shape of this CreateKeyDetails.
+ :type: KeyShape
+ """
+ self._key_shape = key_shape
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/create_vault_details.py b/src/oci/key_management/models/create_vault_details.py
new file mode 100644
index 0000000000..6e84abaead
--- /dev/null
+++ b/src/oci/key_management/models/create_vault_details.py
@@ -0,0 +1,146 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class CreateVaultDetails(object):
+ """
+ CreateVaultDetails model.
+ """
+
+ #: A constant which can be used with the vault_type property of a CreateVaultDetails.
+ #: This constant has a value of "VIRTUAL_PRIVATE"
+ VAULT_TYPE_VIRTUAL_PRIVATE = "VIRTUAL_PRIVATE"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new CreateVaultDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this CreateVaultDetails.
+ :type compartment_id: str
+
+ :param display_name:
+ The value to assign to the display_name property of this CreateVaultDetails.
+ :type display_name: str
+
+ :param vault_type:
+ The value to assign to the vault_type property of this CreateVaultDetails.
+ Allowed values for this property are: "VIRTUAL_PRIVATE"
+ :type vault_type: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'display_name': 'str',
+ 'vault_type': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'display_name': 'displayName',
+ 'vault_type': 'vaultType'
+ }
+
+ self._compartment_id = None
+ self._display_name = None
+ self._vault_type = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this CreateVaultDetails.
+ The OCID of the compartment where you want to create this vault.
+
+
+ :return: The compartment_id of this CreateVaultDetails.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this CreateVaultDetails.
+ The OCID of the compartment where you want to create this vault.
+
+
+ :param compartment_id: The compartment_id of this CreateVaultDetails.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this CreateVaultDetails.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this CreateVaultDetails.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this CreateVaultDetails.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this CreateVaultDetails.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def vault_type(self):
+ """
+ **[Required]** Gets the vault_type of this CreateVaultDetails.
+ The type of vault to create. Each type of vault stores the key with different degrees of isolation and has different options and pricing.
+
+ Allowed values for this property are: "VIRTUAL_PRIVATE"
+
+
+ :return: The vault_type of this CreateVaultDetails.
+ :rtype: str
+ """
+ return self._vault_type
+
+ @vault_type.setter
+ def vault_type(self, vault_type):
+ """
+ Sets the vault_type of this CreateVaultDetails.
+ The type of vault to create. Each type of vault stores the key with different degrees of isolation and has different options and pricing.
+
+
+ :param vault_type: The vault_type of this CreateVaultDetails.
+ :type: str
+ """
+ allowed_values = ["VIRTUAL_PRIVATE"]
+ if not value_allowed_none_or_none_sentinel(vault_type, allowed_values):
+ raise ValueError(
+ "Invalid value for `vault_type`, must be None or one of {0}"
+ .format(allowed_values)
+ )
+ self._vault_type = vault_type
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/decrypt_data_details.py b/src/oci/key_management/models/decrypt_data_details.py
new file mode 100644
index 0000000000..93e9577805
--- /dev/null
+++ b/src/oci/key_management/models/decrypt_data_details.py
@@ -0,0 +1,135 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class DecryptDataDetails(object):
+ """
+ DecryptDataDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new DecryptDataDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param associated_data:
+ The value to assign to the associated_data property of this DecryptDataDetails.
+ :type associated_data: dict(str, str)
+
+ :param ciphertext:
+ The value to assign to the ciphertext property of this DecryptDataDetails.
+ :type ciphertext: str
+
+ :param key_id:
+ The value to assign to the key_id property of this DecryptDataDetails.
+ :type key_id: str
+
+ """
+ self.swagger_types = {
+ 'associated_data': 'dict(str, str)',
+ 'ciphertext': 'str',
+ 'key_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'associated_data': 'associatedData',
+ 'ciphertext': 'ciphertext',
+ 'key_id': 'keyId'
+ }
+
+ self._associated_data = None
+ self._ciphertext = None
+ self._key_id = None
+
+ @property
+ def associated_data(self):
+ """
+ Gets the associated_data of this DecryptDataDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :return: The associated_data of this DecryptDataDetails.
+ :rtype: dict(str, str)
+ """
+ return self._associated_data
+
+ @associated_data.setter
+ def associated_data(self, associated_data):
+ """
+ Sets the associated_data of this DecryptDataDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :param associated_data: The associated_data of this DecryptDataDetails.
+ :type: dict(str, str)
+ """
+ self._associated_data = associated_data
+
+ @property
+ def ciphertext(self):
+ """
+ **[Required]** Gets the ciphertext of this DecryptDataDetails.
+ The encrypted data to decrypt.
+
+
+ :return: The ciphertext of this DecryptDataDetails.
+ :rtype: str
+ """
+ return self._ciphertext
+
+ @ciphertext.setter
+ def ciphertext(self, ciphertext):
+ """
+ Sets the ciphertext of this DecryptDataDetails.
+ The encrypted data to decrypt.
+
+
+ :param ciphertext: The ciphertext of this DecryptDataDetails.
+ :type: str
+ """
+ self._ciphertext = ciphertext
+
+ @property
+ def key_id(self):
+ """
+ **[Required]** Gets the key_id of this DecryptDataDetails.
+ The OCID of the key used to encrypt the ciphertext.
+
+
+ :return: The key_id of this DecryptDataDetails.
+ :rtype: str
+ """
+ return self._key_id
+
+ @key_id.setter
+ def key_id(self, key_id):
+ """
+ Sets the key_id of this DecryptDataDetails.
+ The OCID of the key used to encrypt the ciphertext.
+
+
+ :param key_id: The key_id of this DecryptDataDetails.
+ :type: str
+ """
+ self._key_id = key_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/decrypted_data.py b/src/oci/key_management/models/decrypted_data.py
new file mode 100644
index 0000000000..247e40cdd1
--- /dev/null
+++ b/src/oci/key_management/models/decrypted_data.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class DecryptedData(object):
+ """
+ DecryptedData model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new DecryptedData object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param plaintext:
+ The value to assign to the plaintext property of this DecryptedData.
+ :type plaintext: str
+
+ :param plaintext_checksum:
+ The value to assign to the plaintext_checksum property of this DecryptedData.
+ :type plaintext_checksum: str
+
+ """
+ self.swagger_types = {
+ 'plaintext': 'str',
+ 'plaintext_checksum': 'str'
+ }
+
+ self.attribute_map = {
+ 'plaintext': 'plaintext',
+ 'plaintext_checksum': 'plaintextChecksum'
+ }
+
+ self._plaintext = None
+ self._plaintext_checksum = None
+
+ @property
+ def plaintext(self):
+ """
+ **[Required]** Gets the plaintext of this DecryptedData.
+ The decrypted data, in the form of a base64-encoded value.
+
+
+ :return: The plaintext of this DecryptedData.
+ :rtype: str
+ """
+ return self._plaintext
+
+ @plaintext.setter
+ def plaintext(self, plaintext):
+ """
+ Sets the plaintext of this DecryptedData.
+ The decrypted data, in the form of a base64-encoded value.
+
+
+ :param plaintext: The plaintext of this DecryptedData.
+ :type: str
+ """
+ self._plaintext = plaintext
+
+ @property
+ def plaintext_checksum(self):
+ """
+ **[Required]** Gets the plaintext_checksum of this DecryptedData.
+ Checksum of the decrypted data.
+
+
+ :return: The plaintext_checksum of this DecryptedData.
+ :rtype: str
+ """
+ return self._plaintext_checksum
+
+ @plaintext_checksum.setter
+ def plaintext_checksum(self, plaintext_checksum):
+ """
+ Sets the plaintext_checksum of this DecryptedData.
+ Checksum of the decrypted data.
+
+
+ :param plaintext_checksum: The plaintext_checksum of this DecryptedData.
+ :type: str
+ """
+ self._plaintext_checksum = plaintext_checksum
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/encrypt_data_details.py b/src/oci/key_management/models/encrypt_data_details.py
new file mode 100644
index 0000000000..ed5f920bf1
--- /dev/null
+++ b/src/oci/key_management/models/encrypt_data_details.py
@@ -0,0 +1,135 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class EncryptDataDetails(object):
+ """
+ EncryptDataDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new EncryptDataDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param associated_data:
+ The value to assign to the associated_data property of this EncryptDataDetails.
+ :type associated_data: dict(str, str)
+
+ :param key_id:
+ The value to assign to the key_id property of this EncryptDataDetails.
+ :type key_id: str
+
+ :param plaintext:
+ The value to assign to the plaintext property of this EncryptDataDetails.
+ :type plaintext: str
+
+ """
+ self.swagger_types = {
+ 'associated_data': 'dict(str, str)',
+ 'key_id': 'str',
+ 'plaintext': 'str'
+ }
+
+ self.attribute_map = {
+ 'associated_data': 'associatedData',
+ 'key_id': 'keyId',
+ 'plaintext': 'plaintext'
+ }
+
+ self._associated_data = None
+ self._key_id = None
+ self._plaintext = None
+
+ @property
+ def associated_data(self):
+ """
+ Gets the associated_data of this EncryptDataDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :return: The associated_data of this EncryptDataDetails.
+ :rtype: dict(str, str)
+ """
+ return self._associated_data
+
+ @associated_data.setter
+ def associated_data(self, associated_data):
+ """
+ Sets the associated_data of this EncryptDataDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :param associated_data: The associated_data of this EncryptDataDetails.
+ :type: dict(str, str)
+ """
+ self._associated_data = associated_data
+
+ @property
+ def key_id(self):
+ """
+ **[Required]** Gets the key_id of this EncryptDataDetails.
+ The OCID of the key to encrypt with.
+
+
+ :return: The key_id of this EncryptDataDetails.
+ :rtype: str
+ """
+ return self._key_id
+
+ @key_id.setter
+ def key_id(self, key_id):
+ """
+ Sets the key_id of this EncryptDataDetails.
+ The OCID of the key to encrypt with.
+
+
+ :param key_id: The key_id of this EncryptDataDetails.
+ :type: str
+ """
+ self._key_id = key_id
+
+ @property
+ def plaintext(self):
+ """
+ **[Required]** Gets the plaintext of this EncryptDataDetails.
+ The plaintext data to encrypt.
+
+
+ :return: The plaintext of this EncryptDataDetails.
+ :rtype: str
+ """
+ return self._plaintext
+
+ @plaintext.setter
+ def plaintext(self, plaintext):
+ """
+ Sets the plaintext of this EncryptDataDetails.
+ The plaintext data to encrypt.
+
+
+ :param plaintext: The plaintext of this EncryptDataDetails.
+ :type: str
+ """
+ self._plaintext = plaintext
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/encrypted_data.py b/src/oci/key_management/models/encrypted_data.py
new file mode 100644
index 0000000000..d70353edac
--- /dev/null
+++ b/src/oci/key_management/models/encrypted_data.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class EncryptedData(object):
+ """
+ EncryptedData model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new EncryptedData object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param ciphertext:
+ The value to assign to the ciphertext property of this EncryptedData.
+ :type ciphertext: str
+
+ """
+ self.swagger_types = {
+ 'ciphertext': 'str'
+ }
+
+ self.attribute_map = {
+ 'ciphertext': 'ciphertext'
+ }
+
+ self._ciphertext = None
+
+ @property
+ def ciphertext(self):
+ """
+ **[Required]** Gets the ciphertext of this EncryptedData.
+ The encrypted data.
+
+
+ :return: The ciphertext of this EncryptedData.
+ :rtype: str
+ """
+ return self._ciphertext
+
+ @ciphertext.setter
+ def ciphertext(self, ciphertext):
+ """
+ Sets the ciphertext of this EncryptedData.
+ The encrypted data.
+
+
+ :param ciphertext: The ciphertext of this EncryptedData.
+ :type: str
+ """
+ self._ciphertext = ciphertext
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/generate_key_details.py b/src/oci/key_management/models/generate_key_details.py
new file mode 100644
index 0000000000..5d7e1b1403
--- /dev/null
+++ b/src/oci/key_management/models/generate_key_details.py
@@ -0,0 +1,162 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class GenerateKeyDetails(object):
+ """
+ GenerateKeyDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new GenerateKeyDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param associated_data:
+ The value to assign to the associated_data property of this GenerateKeyDetails.
+ :type associated_data: dict(str, str)
+
+ :param include_plaintext_key:
+ The value to assign to the include_plaintext_key property of this GenerateKeyDetails.
+ :type include_plaintext_key: bool
+
+ :param key_id:
+ The value to assign to the key_id property of this GenerateKeyDetails.
+ :type key_id: str
+
+ :param key_shape:
+ The value to assign to the key_shape property of this GenerateKeyDetails.
+ :type key_shape: KeyShape
+
+ """
+ self.swagger_types = {
+ 'associated_data': 'dict(str, str)',
+ 'include_plaintext_key': 'bool',
+ 'key_id': 'str',
+ 'key_shape': 'KeyShape'
+ }
+
+ self.attribute_map = {
+ 'associated_data': 'associatedData',
+ 'include_plaintext_key': 'includePlaintextKey',
+ 'key_id': 'keyId',
+ 'key_shape': 'keyShape'
+ }
+
+ self._associated_data = None
+ self._include_plaintext_key = None
+ self._key_id = None
+ self._key_shape = None
+
+ @property
+ def associated_data(self):
+ """
+ Gets the associated_data of this GenerateKeyDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :return: The associated_data of this GenerateKeyDetails.
+ :rtype: dict(str, str)
+ """
+ return self._associated_data
+
+ @associated_data.setter
+ def associated_data(self, associated_data):
+ """
+ Sets the associated_data of this GenerateKeyDetails.
+ Information that can be used to provide an encryption context for the
+ encrypted data. The length of the string representation of the associatedData
+ must be fewer than 4096 characters.
+
+
+ :param associated_data: The associated_data of this GenerateKeyDetails.
+ :type: dict(str, str)
+ """
+ self._associated_data = associated_data
+
+ @property
+ def include_plaintext_key(self):
+ """
+ **[Required]** Gets the include_plaintext_key of this GenerateKeyDetails.
+ If true, the generated key is also returned unencrypted.
+
+
+ :return: The include_plaintext_key of this GenerateKeyDetails.
+ :rtype: bool
+ """
+ return self._include_plaintext_key
+
+ @include_plaintext_key.setter
+ def include_plaintext_key(self, include_plaintext_key):
+ """
+ Sets the include_plaintext_key of this GenerateKeyDetails.
+ If true, the generated key is also returned unencrypted.
+
+
+ :param include_plaintext_key: The include_plaintext_key of this GenerateKeyDetails.
+ :type: bool
+ """
+ self._include_plaintext_key = include_plaintext_key
+
+ @property
+ def key_id(self):
+ """
+ **[Required]** Gets the key_id of this GenerateKeyDetails.
+ The OCID of the master encryption key to encrypt the generated data encryption key with.
+
+
+ :return: The key_id of this GenerateKeyDetails.
+ :rtype: str
+ """
+ return self._key_id
+
+ @key_id.setter
+ def key_id(self, key_id):
+ """
+ Sets the key_id of this GenerateKeyDetails.
+ The OCID of the master encryption key to encrypt the generated data encryption key with.
+
+
+ :param key_id: The key_id of this GenerateKeyDetails.
+ :type: str
+ """
+ self._key_id = key_id
+
+ @property
+ def key_shape(self):
+ """
+ **[Required]** Gets the key_shape of this GenerateKeyDetails.
+
+ :return: The key_shape of this GenerateKeyDetails.
+ :rtype: KeyShape
+ """
+ return self._key_shape
+
+ @key_shape.setter
+ def key_shape(self, key_shape):
+ """
+ Sets the key_shape of this GenerateKeyDetails.
+
+ :param key_shape: The key_shape of this GenerateKeyDetails.
+ :type: KeyShape
+ """
+ self._key_shape = key_shape
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/generated_key.py b/src/oci/key_management/models/generated_key.py
new file mode 100644
index 0000000000..9773ecb9c6
--- /dev/null
+++ b/src/oci/key_management/models/generated_key.py
@@ -0,0 +1,141 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class GeneratedKey(object):
+ """
+ GeneratedKey model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new GeneratedKey object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param ciphertext:
+ The value to assign to the ciphertext property of this GeneratedKey.
+ :type ciphertext: str
+
+ :param plaintext:
+ The value to assign to the plaintext property of this GeneratedKey.
+ :type plaintext: str
+
+ :param plaintext_checksum:
+ The value to assign to the plaintext_checksum property of this GeneratedKey.
+ :type plaintext_checksum: str
+
+ """
+ self.swagger_types = {
+ 'ciphertext': 'str',
+ 'plaintext': 'str',
+ 'plaintext_checksum': 'str'
+ }
+
+ self.attribute_map = {
+ 'ciphertext': 'ciphertext',
+ 'plaintext': 'plaintext',
+ 'plaintext_checksum': 'plaintextChecksum'
+ }
+
+ self._ciphertext = None
+ self._plaintext = None
+ self._plaintext_checksum = None
+
+ @property
+ def ciphertext(self):
+ """
+ **[Required]** Gets the ciphertext of this GeneratedKey.
+ The encrypted generated data encryption key.
+
+
+ :return: The ciphertext of this GeneratedKey.
+ :rtype: str
+ """
+ return self._ciphertext
+
+ @ciphertext.setter
+ def ciphertext(self, ciphertext):
+ """
+ Sets the ciphertext of this GeneratedKey.
+ The encrypted generated data encryption key.
+
+
+ :param ciphertext: The ciphertext of this GeneratedKey.
+ :type: str
+ """
+ self._ciphertext = ciphertext
+
+ @property
+ def plaintext(self):
+ """
+ Gets the plaintext of this GeneratedKey.
+ The plaintext generated data encryption key, a base64-encoded
+ sequence of random bytes, which is included if the
+ GenerateDataEncryptionKey request includes the \"includePlaintextKey\"
+ parameter and sets its value to 'true'.
+
+
+ :return: The plaintext of this GeneratedKey.
+ :rtype: str
+ """
+ return self._plaintext
+
+ @plaintext.setter
+ def plaintext(self, plaintext):
+ """
+ Sets the plaintext of this GeneratedKey.
+ The plaintext generated data encryption key, a base64-encoded
+ sequence of random bytes, which is included if the
+ GenerateDataEncryptionKey request includes the \"includePlaintextKey\"
+ parameter and sets its value to 'true'.
+
+
+ :param plaintext: The plaintext of this GeneratedKey.
+ :type: str
+ """
+ self._plaintext = plaintext
+
+ @property
+ def plaintext_checksum(self):
+ """
+ Gets the plaintext_checksum of this GeneratedKey.
+ The checksum of the plaintext generated data encryption key, which
+ is included if the GenerateDataEncryptionKey request includes the
+ \"includePlaintextKey parameter and sets its value to 'true'.
+
+
+ :return: The plaintext_checksum of this GeneratedKey.
+ :rtype: str
+ """
+ return self._plaintext_checksum
+
+ @plaintext_checksum.setter
+ def plaintext_checksum(self, plaintext_checksum):
+ """
+ Sets the plaintext_checksum of this GeneratedKey.
+ The checksum of the plaintext generated data encryption key, which
+ is included if the GenerateDataEncryptionKey request includes the
+ \"includePlaintextKey parameter and sets its value to 'true'.
+
+
+ :param plaintext_checksum: The plaintext_checksum of this GeneratedKey.
+ :type: str
+ """
+ self._plaintext_checksum = plaintext_checksum
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/key.py b/src/oci/key_management/models/key.py
new file mode 100644
index 0000000000..6cb1df96ce
--- /dev/null
+++ b/src/oci/key_management/models/key.py
@@ -0,0 +1,416 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class Key(object):
+ """
+ Key model.
+ """
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "CREATING"
+ LIFECYCLE_STATE_CREATING = "CREATING"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "ENABLING"
+ LIFECYCLE_STATE_ENABLING = "ENABLING"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "ENABLED"
+ LIFECYCLE_STATE_ENABLED = "ENABLED"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "DISABLING"
+ LIFECYCLE_STATE_DISABLING = "DISABLING"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "DISABLED"
+ LIFECYCLE_STATE_DISABLED = "DISABLED"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "DELETING"
+ LIFECYCLE_STATE_DELETING = "DELETING"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "DELETED"
+ LIFECYCLE_STATE_DELETED = "DELETED"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "PENDING_DELETION"
+ LIFECYCLE_STATE_PENDING_DELETION = "PENDING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "SCHEDULING_DELETION"
+ LIFECYCLE_STATE_SCHEDULING_DELETION = "SCHEDULING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a Key.
+ #: This constant has a value of "CANCELLING_DELETION"
+ LIFECYCLE_STATE_CANCELLING_DELETION = "CANCELLING_DELETION"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new Key object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this Key.
+ :type compartment_id: str
+
+ :param current_key_version:
+ The value to assign to the current_key_version property of this Key.
+ :type current_key_version: str
+
+ :param defined_tags:
+ The value to assign to the defined_tags property of this Key.
+ :type defined_tags: dict(str, dict(str, object))
+
+ :param display_name:
+ The value to assign to the display_name property of this Key.
+ :type display_name: str
+
+ :param freeform_tags:
+ The value to assign to the freeform_tags property of this Key.
+ :type freeform_tags: dict(str, str)
+
+ :param id:
+ The value to assign to the id property of this Key.
+ :type id: str
+
+ :param key_shape:
+ The value to assign to the key_shape property of this Key.
+ :type key_shape: KeyShape
+
+ :param lifecycle_state:
+ The value to assign to the lifecycle_state property of this Key.
+ Allowed values for this property are: "CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type lifecycle_state: str
+
+ :param time_created:
+ The value to assign to the time_created property of this Key.
+ :type time_created: datetime
+
+ :param vault_id:
+ The value to assign to the vault_id property of this Key.
+ :type vault_id: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'current_key_version': 'str',
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'display_name': 'str',
+ 'freeform_tags': 'dict(str, str)',
+ 'id': 'str',
+ 'key_shape': 'KeyShape',
+ 'lifecycle_state': 'str',
+ 'time_created': 'datetime',
+ 'vault_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'current_key_version': 'currentKeyVersion',
+ 'defined_tags': 'definedTags',
+ 'display_name': 'displayName',
+ 'freeform_tags': 'freeformTags',
+ 'id': 'id',
+ 'key_shape': 'keyShape',
+ 'lifecycle_state': 'lifecycleState',
+ 'time_created': 'timeCreated',
+ 'vault_id': 'vaultId'
+ }
+
+ self._compartment_id = None
+ self._current_key_version = None
+ self._defined_tags = None
+ self._display_name = None
+ self._freeform_tags = None
+ self._id = None
+ self._key_shape = None
+ self._lifecycle_state = None
+ self._time_created = None
+ self._vault_id = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this Key.
+ The OCID of the compartment that contains this key.
+
+
+ :return: The compartment_id of this Key.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this Key.
+ The OCID of the compartment that contains this key.
+
+
+ :param compartment_id: The compartment_id of this Key.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def current_key_version(self):
+ """
+ **[Required]** Gets the current_key_version of this Key.
+ The OCID of the KeyVersion resource used in cryptographic operations. During key rotation, service may be in transitional state
+ where this or a newer KeyVersion are used intermittently, and currentKeyVersion field is updated once service is guaranteed to
+ use new KeyVersion for all consequent encrypt operations.
+
+
+ :return: The current_key_version of this Key.
+ :rtype: str
+ """
+ return self._current_key_version
+
+ @current_key_version.setter
+ def current_key_version(self, current_key_version):
+ """
+ Sets the current_key_version of this Key.
+ The OCID of the KeyVersion resource used in cryptographic operations. During key rotation, service may be in transitional state
+ where this or a newer KeyVersion are used intermittently, and currentKeyVersion field is updated once service is guaranteed to
+ use new KeyVersion for all consequent encrypt operations.
+
+
+ :param current_key_version: The current_key_version of this Key.
+ :type: str
+ """
+ self._current_key_version = current_key_version
+
+ @property
+ def defined_tags(self):
+ """
+ Gets the defined_tags of this Key.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :return: The defined_tags of this Key.
+ :rtype: dict(str, dict(str, object))
+ """
+ return self._defined_tags
+
+ @defined_tags.setter
+ def defined_tags(self, defined_tags):
+ """
+ Sets the defined_tags of this Key.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :param defined_tags: The defined_tags of this Key.
+ :type: dict(str, dict(str, object))
+ """
+ self._defined_tags = defined_tags
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this Key.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this Key.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this Key.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this Key.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def freeform_tags(self):
+ """
+ Gets the freeform_tags of this Key.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :return: The freeform_tags of this Key.
+ :rtype: dict(str, str)
+ """
+ return self._freeform_tags
+
+ @freeform_tags.setter
+ def freeform_tags(self, freeform_tags):
+ """
+ Sets the freeform_tags of this Key.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :param freeform_tags: The freeform_tags of this Key.
+ :type: dict(str, str)
+ """
+ self._freeform_tags = freeform_tags
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this Key.
+ The OCID of the key.
+
+
+ :return: The id of this Key.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this Key.
+ The OCID of the key.
+
+
+ :param id: The id of this Key.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def key_shape(self):
+ """
+ **[Required]** Gets the key_shape of this Key.
+
+ :return: The key_shape of this Key.
+ :rtype: KeyShape
+ """
+ return self._key_shape
+
+ @key_shape.setter
+ def key_shape(self, key_shape):
+ """
+ Sets the key_shape of this Key.
+
+ :param key_shape: The key_shape of this Key.
+ :type: KeyShape
+ """
+ self._key_shape = key_shape
+
+ @property
+ def lifecycle_state(self):
+ """
+ **[Required]** Gets the lifecycle_state of this Key.
+ The key's current state.
+
+ Example: `ENABLED`
+
+ Allowed values for this property are: "CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The lifecycle_state of this Key.
+ :rtype: str
+ """
+ return self._lifecycle_state
+
+ @lifecycle_state.setter
+ def lifecycle_state(self, lifecycle_state):
+ """
+ Sets the lifecycle_state of this Key.
+ The key's current state.
+
+ Example: `ENABLED`
+
+
+ :param lifecycle_state: The lifecycle_state of this Key.
+ :type: str
+ """
+ allowed_values = ["CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION"]
+ if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
+ lifecycle_state = 'UNKNOWN_ENUM_VALUE'
+ self._lifecycle_state = lifecycle_state
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this Key.
+ The date and time the key was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this Key.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this Key.
+ The date and time the key was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this Key.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def vault_id(self):
+ """
+ **[Required]** Gets the vault_id of this Key.
+ The OCID of the vault that contains this key.
+
+
+ :return: The vault_id of this Key.
+ :rtype: str
+ """
+ return self._vault_id
+
+ @vault_id.setter
+ def vault_id(self, vault_id):
+ """
+ Sets the vault_id of this Key.
+ The OCID of the vault that contains this key.
+
+
+ :param vault_id: The vault_id of this Key.
+ :type: str
+ """
+ self._vault_id = vault_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/key_shape.py b/src/oci/key_management/models/key_shape.py
new file mode 100644
index 0000000000..bfcb4e17ca
--- /dev/null
+++ b/src/oci/key_management/models/key_shape.py
@@ -0,0 +1,112 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class KeyShape(object):
+ """
+ The cryptographic properties of a key.
+ """
+
+ #: A constant which can be used with the algorithm property of a KeyShape.
+ #: This constant has a value of "AES"
+ ALGORITHM_AES = "AES"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new KeyShape object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param algorithm:
+ The value to assign to the algorithm property of this KeyShape.
+ Allowed values for this property are: "AES", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type algorithm: str
+
+ :param length:
+ The value to assign to the length property of this KeyShape.
+ :type length: int
+
+ """
+ self.swagger_types = {
+ 'algorithm': 'str',
+ 'length': 'int'
+ }
+
+ self.attribute_map = {
+ 'algorithm': 'algorithm',
+ 'length': 'length'
+ }
+
+ self._algorithm = None
+ self._length = None
+
+ @property
+ def algorithm(self):
+ """
+ **[Required]** Gets the algorithm of this KeyShape.
+ The algorithm used by a key's KeyVersions to encrypt or decrypt.
+
+ Allowed values for this property are: "AES", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The algorithm of this KeyShape.
+ :rtype: str
+ """
+ return self._algorithm
+
+ @algorithm.setter
+ def algorithm(self, algorithm):
+ """
+ Sets the algorithm of this KeyShape.
+ The algorithm used by a key's KeyVersions to encrypt or decrypt.
+
+
+ :param algorithm: The algorithm of this KeyShape.
+ :type: str
+ """
+ allowed_values = ["AES"]
+ if not value_allowed_none_or_none_sentinel(algorithm, allowed_values):
+ algorithm = 'UNKNOWN_ENUM_VALUE'
+ self._algorithm = algorithm
+
+ @property
+ def length(self):
+ """
+ **[Required]** Gets the length of this KeyShape.
+ The length of the key, expressed as an integer. Values of 16, 24, or 32 are supported.
+
+
+ :return: The length of this KeyShape.
+ :rtype: int
+ """
+ return self._length
+
+ @length.setter
+ def length(self, length):
+ """
+ Sets the length of this KeyShape.
+ The length of the key, expressed as an integer. Values of 16, 24, or 32 are supported.
+
+
+ :param length: The length of this KeyShape.
+ :type: int
+ """
+ self._length = length
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/key_summary.py b/src/oci/key_management/models/key_summary.py
new file mode 100644
index 0000000000..1f9edf9dae
--- /dev/null
+++ b/src/oci/key_management/models/key_summary.py
@@ -0,0 +1,354 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class KeySummary(object):
+ """
+ KeySummary model.
+ """
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "CREATING"
+ LIFECYCLE_STATE_CREATING = "CREATING"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "ENABLING"
+ LIFECYCLE_STATE_ENABLING = "ENABLING"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "ENABLED"
+ LIFECYCLE_STATE_ENABLED = "ENABLED"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "DISABLING"
+ LIFECYCLE_STATE_DISABLING = "DISABLING"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "DISABLED"
+ LIFECYCLE_STATE_DISABLED = "DISABLED"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "DELETING"
+ LIFECYCLE_STATE_DELETING = "DELETING"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "DELETED"
+ LIFECYCLE_STATE_DELETED = "DELETED"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "PENDING_DELETION"
+ LIFECYCLE_STATE_PENDING_DELETION = "PENDING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "SCHEDULING_DELETION"
+ LIFECYCLE_STATE_SCHEDULING_DELETION = "SCHEDULING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a KeySummary.
+ #: This constant has a value of "CANCELLING_DELETION"
+ LIFECYCLE_STATE_CANCELLING_DELETION = "CANCELLING_DELETION"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new KeySummary object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this KeySummary.
+ :type compartment_id: str
+
+ :param defined_tags:
+ The value to assign to the defined_tags property of this KeySummary.
+ :type defined_tags: dict(str, dict(str, object))
+
+ :param display_name:
+ The value to assign to the display_name property of this KeySummary.
+ :type display_name: str
+
+ :param freeform_tags:
+ The value to assign to the freeform_tags property of this KeySummary.
+ :type freeform_tags: dict(str, str)
+
+ :param id:
+ The value to assign to the id property of this KeySummary.
+ :type id: str
+
+ :param lifecycle_state:
+ The value to assign to the lifecycle_state property of this KeySummary.
+ Allowed values for this property are: "CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type lifecycle_state: str
+
+ :param time_created:
+ The value to assign to the time_created property of this KeySummary.
+ :type time_created: datetime
+
+ :param vault_id:
+ The value to assign to the vault_id property of this KeySummary.
+ :type vault_id: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'display_name': 'str',
+ 'freeform_tags': 'dict(str, str)',
+ 'id': 'str',
+ 'lifecycle_state': 'str',
+ 'time_created': 'datetime',
+ 'vault_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'defined_tags': 'definedTags',
+ 'display_name': 'displayName',
+ 'freeform_tags': 'freeformTags',
+ 'id': 'id',
+ 'lifecycle_state': 'lifecycleState',
+ 'time_created': 'timeCreated',
+ 'vault_id': 'vaultId'
+ }
+
+ self._compartment_id = None
+ self._defined_tags = None
+ self._display_name = None
+ self._freeform_tags = None
+ self._id = None
+ self._lifecycle_state = None
+ self._time_created = None
+ self._vault_id = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this KeySummary.
+ The OCID of the compartment that contains the key.
+
+
+ :return: The compartment_id of this KeySummary.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this KeySummary.
+ The OCID of the compartment that contains the key.
+
+
+ :param compartment_id: The compartment_id of this KeySummary.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def defined_tags(self):
+ """
+ Gets the defined_tags of this KeySummary.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :return: The defined_tags of this KeySummary.
+ :rtype: dict(str, dict(str, object))
+ """
+ return self._defined_tags
+
+ @defined_tags.setter
+ def defined_tags(self, defined_tags):
+ """
+ Sets the defined_tags of this KeySummary.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :param defined_tags: The defined_tags of this KeySummary.
+ :type: dict(str, dict(str, object))
+ """
+ self._defined_tags = defined_tags
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this KeySummary.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this KeySummary.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this KeySummary.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this KeySummary.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def freeform_tags(self):
+ """
+ Gets the freeform_tags of this KeySummary.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :return: The freeform_tags of this KeySummary.
+ :rtype: dict(str, str)
+ """
+ return self._freeform_tags
+
+ @freeform_tags.setter
+ def freeform_tags(self, freeform_tags):
+ """
+ Sets the freeform_tags of this KeySummary.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :param freeform_tags: The freeform_tags of this KeySummary.
+ :type: dict(str, str)
+ """
+ self._freeform_tags = freeform_tags
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this KeySummary.
+ The OCID of the key.
+
+
+ :return: The id of this KeySummary.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this KeySummary.
+ The OCID of the key.
+
+
+ :param id: The id of this KeySummary.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def lifecycle_state(self):
+ """
+ **[Required]** Gets the lifecycle_state of this KeySummary.
+ The key's current state.
+
+ Example: `ENABLED`
+
+ Allowed values for this property are: "CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The lifecycle_state of this KeySummary.
+ :rtype: str
+ """
+ return self._lifecycle_state
+
+ @lifecycle_state.setter
+ def lifecycle_state(self, lifecycle_state):
+ """
+ Sets the lifecycle_state of this KeySummary.
+ The key's current state.
+
+ Example: `ENABLED`
+
+
+ :param lifecycle_state: The lifecycle_state of this KeySummary.
+ :type: str
+ """
+ allowed_values = ["CREATING", "ENABLING", "ENABLED", "DISABLING", "DISABLED", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION"]
+ if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
+ lifecycle_state = 'UNKNOWN_ENUM_VALUE'
+ self._lifecycle_state = lifecycle_state
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this KeySummary.
+ The date and time the key was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this KeySummary.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this KeySummary.
+ The date and time the key was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this KeySummary.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def vault_id(self):
+ """
+ **[Required]** Gets the vault_id of this KeySummary.
+ The OCID of the vault that contains the key.
+
+
+ :return: The vault_id of this KeySummary.
+ :rtype: str
+ """
+ return self._vault_id
+
+ @vault_id.setter
+ def vault_id(self, vault_id):
+ """
+ Sets the vault_id of this KeySummary.
+ The OCID of the vault that contains the key.
+
+
+ :param vault_id: The vault_id of this KeySummary.
+ :type: str
+ """
+ self._vault_id = vault_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/key_version.py b/src/oci/key_management/models/key_version.py
new file mode 100644
index 0000000000..f26fbd2f6d
--- /dev/null
+++ b/src/oci/key_management/models/key_version.py
@@ -0,0 +1,201 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class KeyVersion(object):
+ """
+ KeyVersion model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new KeyVersion object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this KeyVersion.
+ :type compartment_id: str
+
+ :param id:
+ The value to assign to the id property of this KeyVersion.
+ :type id: str
+
+ :param key_id:
+ The value to assign to the key_id property of this KeyVersion.
+ :type key_id: str
+
+ :param time_created:
+ The value to assign to the time_created property of this KeyVersion.
+ :type time_created: datetime
+
+ :param vault_id:
+ The value to assign to the vault_id property of this KeyVersion.
+ :type vault_id: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'id': 'str',
+ 'key_id': 'str',
+ 'time_created': 'datetime',
+ 'vault_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'id': 'id',
+ 'key_id': 'keyId',
+ 'time_created': 'timeCreated',
+ 'vault_id': 'vaultId'
+ }
+
+ self._compartment_id = None
+ self._id = None
+ self._key_id = None
+ self._time_created = None
+ self._vault_id = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this KeyVersion.
+ The OCID of the compartment that contains this key version.
+
+
+ :return: The compartment_id of this KeyVersion.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this KeyVersion.
+ The OCID of the compartment that contains this key version.
+
+
+ :param compartment_id: The compartment_id of this KeyVersion.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this KeyVersion.
+ The OCID of the key version.
+
+
+ :return: The id of this KeyVersion.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this KeyVersion.
+ The OCID of the key version.
+
+
+ :param id: The id of this KeyVersion.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def key_id(self):
+ """
+ **[Required]** Gets the key_id of this KeyVersion.
+ The OCID of the key associated with this key version.
+
+
+ :return: The key_id of this KeyVersion.
+ :rtype: str
+ """
+ return self._key_id
+
+ @key_id.setter
+ def key_id(self, key_id):
+ """
+ Sets the key_id of this KeyVersion.
+ The OCID of the key associated with this key version.
+
+
+ :param key_id: The key_id of this KeyVersion.
+ :type: str
+ """
+ self._key_id = key_id
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this KeyVersion.
+ The date and time this key version was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this KeyVersion.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this KeyVersion.
+ The date and time this key version was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this KeyVersion.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def vault_id(self):
+ """
+ **[Required]** Gets the vault_id of this KeyVersion.
+ The OCID of the vault that contains this key version.
+
+
+ :return: The vault_id of this KeyVersion.
+ :rtype: str
+ """
+ return self._vault_id
+
+ @vault_id.setter
+ def vault_id(self, vault_id):
+ """
+ Sets the vault_id of this KeyVersion.
+ The OCID of the vault that contains this key version.
+
+
+ :param vault_id: The vault_id of this KeyVersion.
+ :type: str
+ """
+ self._vault_id = vault_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/key_version_summary.py b/src/oci/key_management/models/key_version_summary.py
new file mode 100644
index 0000000000..182c7c4558
--- /dev/null
+++ b/src/oci/key_management/models/key_version_summary.py
@@ -0,0 +1,201 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class KeyVersionSummary(object):
+ """
+ KeyVersionSummary model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new KeyVersionSummary object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this KeyVersionSummary.
+ :type compartment_id: str
+
+ :param id:
+ The value to assign to the id property of this KeyVersionSummary.
+ :type id: str
+
+ :param key_id:
+ The value to assign to the key_id property of this KeyVersionSummary.
+ :type key_id: str
+
+ :param time_created:
+ The value to assign to the time_created property of this KeyVersionSummary.
+ :type time_created: datetime
+
+ :param vault_id:
+ The value to assign to the vault_id property of this KeyVersionSummary.
+ :type vault_id: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'id': 'str',
+ 'key_id': 'str',
+ 'time_created': 'datetime',
+ 'vault_id': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'id': 'id',
+ 'key_id': 'keyId',
+ 'time_created': 'timeCreated',
+ 'vault_id': 'vaultId'
+ }
+
+ self._compartment_id = None
+ self._id = None
+ self._key_id = None
+ self._time_created = None
+ self._vault_id = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this KeyVersionSummary.
+ The OCID of the compartment that contains this key version.
+
+
+ :return: The compartment_id of this KeyVersionSummary.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this KeyVersionSummary.
+ The OCID of the compartment that contains this key version.
+
+
+ :param compartment_id: The compartment_id of this KeyVersionSummary.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this KeyVersionSummary.
+ The OCID of the key version.
+
+
+ :return: The id of this KeyVersionSummary.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this KeyVersionSummary.
+ The OCID of the key version.
+
+
+ :param id: The id of this KeyVersionSummary.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def key_id(self):
+ """
+ **[Required]** Gets the key_id of this KeyVersionSummary.
+ The OCID of the key associated with this key version.
+
+
+ :return: The key_id of this KeyVersionSummary.
+ :rtype: str
+ """
+ return self._key_id
+
+ @key_id.setter
+ def key_id(self, key_id):
+ """
+ Sets the key_id of this KeyVersionSummary.
+ The OCID of the key associated with this key version.
+
+
+ :param key_id: The key_id of this KeyVersionSummary.
+ :type: str
+ """
+ self._key_id = key_id
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this KeyVersionSummary.
+ The date and time this key version was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this KeyVersionSummary.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this KeyVersionSummary.
+ The date and time this key version was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this KeyVersionSummary.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def vault_id(self):
+ """
+ **[Required]** Gets the vault_id of this KeyVersionSummary.
+ The OCID of the vault that contains this key version.
+
+
+ :return: The vault_id of this KeyVersionSummary.
+ :rtype: str
+ """
+ return self._vault_id
+
+ @vault_id.setter
+ def vault_id(self, vault_id):
+ """
+ Sets the vault_id of this KeyVersionSummary.
+ The OCID of the vault that contains this key version.
+
+
+ :param vault_id: The vault_id of this KeyVersionSummary.
+ :type: str
+ """
+ self._vault_id = vault_id
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/schedule_vault_deletion_details.py b/src/oci/key_management/models/schedule_vault_deletion_details.py
new file mode 100644
index 0000000000..c4da509546
--- /dev/null
+++ b/src/oci/key_management/models/schedule_vault_deletion_details.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class ScheduleVaultDeletionDetails(object):
+ """
+ Details for scheduling Vault deletion
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new ScheduleVaultDeletionDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param time_of_deletion:
+ The value to assign to the time_of_deletion property of this ScheduleVaultDeletionDetails.
+ :type time_of_deletion: datetime
+
+ """
+ self.swagger_types = {
+ 'time_of_deletion': 'datetime'
+ }
+
+ self.attribute_map = {
+ 'time_of_deletion': 'timeOfDeletion'
+ }
+
+ self._time_of_deletion = None
+
+ @property
+ def time_of_deletion(self):
+ """
+ Gets the time_of_deletion of this ScheduleVaultDeletionDetails.
+ An optional property to indicate the deletion time of the Vault.
+ The time format should comply with RFC-3339 standards. This time must be between 7 to 30 days from the time
+ when the request is received. If the property is missing, it will be set to 30 days from request time by default.
+
+
+ :return: The time_of_deletion of this ScheduleVaultDeletionDetails.
+ :rtype: datetime
+ """
+ return self._time_of_deletion
+
+ @time_of_deletion.setter
+ def time_of_deletion(self, time_of_deletion):
+ """
+ Sets the time_of_deletion of this ScheduleVaultDeletionDetails.
+ An optional property to indicate the deletion time of the Vault.
+ The time format should comply with RFC-3339 standards. This time must be between 7 to 30 days from the time
+ when the request is received. If the property is missing, it will be set to 30 days from request time by default.
+
+
+ :param time_of_deletion: The time_of_deletion of this ScheduleVaultDeletionDetails.
+ :type: datetime
+ """
+ self._time_of_deletion = time_of_deletion
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/update_key_details.py b/src/oci/key_management/models/update_key_details.py
new file mode 100644
index 0000000000..148335e2db
--- /dev/null
+++ b/src/oci/key_management/models/update_key_details.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class UpdateKeyDetails(object):
+ """
+ UpdateKeyDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new UpdateKeyDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param display_name:
+ The value to assign to the display_name property of this UpdateKeyDetails.
+ :type display_name: str
+
+ """
+ self.swagger_types = {
+ 'display_name': 'str'
+ }
+
+ self.attribute_map = {
+ 'display_name': 'displayName'
+ }
+
+ self._display_name = None
+
+ @property
+ def display_name(self):
+ """
+ Gets the display_name of this UpdateKeyDetails.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this UpdateKeyDetails.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this UpdateKeyDetails.
+ A user-friendly name for the key. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this UpdateKeyDetails.
+ :type: str
+ """
+ self._display_name = display_name
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/update_vault_details.py b/src/oci/key_management/models/update_vault_details.py
new file mode 100644
index 0000000000..c75731a862
--- /dev/null
+++ b/src/oci/key_management/models/update_vault_details.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class UpdateVaultDetails(object):
+ """
+ UpdateVaultDetails model.
+ """
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new UpdateVaultDetails object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param display_name:
+ The value to assign to the display_name property of this UpdateVaultDetails.
+ :type display_name: str
+
+ """
+ self.swagger_types = {
+ 'display_name': 'str'
+ }
+
+ self.attribute_map = {
+ 'display_name': 'displayName'
+ }
+
+ self._display_name = None
+
+ @property
+ def display_name(self):
+ """
+ Gets the display_name of this UpdateVaultDetails.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this UpdateVaultDetails.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this UpdateVaultDetails.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this UpdateVaultDetails.
+ :type: str
+ """
+ self._display_name = display_name
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/vault.py b/src/oci/key_management/models/vault.py
new file mode 100644
index 0000000000..74f4dd6701
--- /dev/null
+++ b/src/oci/key_management/models/vault.py
@@ -0,0 +1,453 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class Vault(object):
+ """
+ Vault model.
+ """
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "CREATING"
+ LIFECYCLE_STATE_CREATING = "CREATING"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "ACTIVE"
+ LIFECYCLE_STATE_ACTIVE = "ACTIVE"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "DELETING"
+ LIFECYCLE_STATE_DELETING = "DELETING"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "DELETED"
+ LIFECYCLE_STATE_DELETED = "DELETED"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "PENDING_DELETION"
+ LIFECYCLE_STATE_PENDING_DELETION = "PENDING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "SCHEDULING_DELETION"
+ LIFECYCLE_STATE_SCHEDULING_DELETION = "SCHEDULING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a Vault.
+ #: This constant has a value of "CANCELLING_DELETION"
+ LIFECYCLE_STATE_CANCELLING_DELETION = "CANCELLING_DELETION"
+
+ #: A constant which can be used with the vault_type property of a Vault.
+ #: This constant has a value of "VIRTUAL_PRIVATE"
+ VAULT_TYPE_VIRTUAL_PRIVATE = "VIRTUAL_PRIVATE"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new Vault object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this Vault.
+ :type compartment_id: str
+
+ :param crypto_endpoint:
+ The value to assign to the crypto_endpoint property of this Vault.
+ :type crypto_endpoint: str
+
+ :param defined_tags:
+ The value to assign to the defined_tags property of this Vault.
+ :type defined_tags: dict(str, dict(str, object))
+
+ :param display_name:
+ The value to assign to the display_name property of this Vault.
+ :type display_name: str
+
+ :param freeform_tags:
+ The value to assign to the freeform_tags property of this Vault.
+ :type freeform_tags: dict(str, str)
+
+ :param id:
+ The value to assign to the id property of this Vault.
+ :type id: str
+
+ :param lifecycle_state:
+ The value to assign to the lifecycle_state property of this Vault.
+ Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type lifecycle_state: str
+
+ :param management_endpoint:
+ The value to assign to the management_endpoint property of this Vault.
+ :type management_endpoint: str
+
+ :param time_created:
+ The value to assign to the time_created property of this Vault.
+ :type time_created: datetime
+
+ :param time_of_deletion:
+ The value to assign to the time_of_deletion property of this Vault.
+ :type time_of_deletion: datetime
+
+ :param vault_type:
+ The value to assign to the vault_type property of this Vault.
+ Allowed values for this property are: "VIRTUAL_PRIVATE", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type vault_type: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'crypto_endpoint': 'str',
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'display_name': 'str',
+ 'freeform_tags': 'dict(str, str)',
+ 'id': 'str',
+ 'lifecycle_state': 'str',
+ 'management_endpoint': 'str',
+ 'time_created': 'datetime',
+ 'time_of_deletion': 'datetime',
+ 'vault_type': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'crypto_endpoint': 'cryptoEndpoint',
+ 'defined_tags': 'definedTags',
+ 'display_name': 'displayName',
+ 'freeform_tags': 'freeformTags',
+ 'id': 'id',
+ 'lifecycle_state': 'lifecycleState',
+ 'management_endpoint': 'managementEndpoint',
+ 'time_created': 'timeCreated',
+ 'time_of_deletion': 'timeOfDeletion',
+ 'vault_type': 'vaultType'
+ }
+
+ self._compartment_id = None
+ self._crypto_endpoint = None
+ self._defined_tags = None
+ self._display_name = None
+ self._freeform_tags = None
+ self._id = None
+ self._lifecycle_state = None
+ self._management_endpoint = None
+ self._time_created = None
+ self._time_of_deletion = None
+ self._vault_type = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this Vault.
+ The OCID of the compartment that contains this vault.
+
+
+ :return: The compartment_id of this Vault.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this Vault.
+ The OCID of the compartment that contains this vault.
+
+
+ :param compartment_id: The compartment_id of this Vault.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def crypto_endpoint(self):
+ """
+ **[Required]** Gets the crypto_endpoint of this Vault.
+ The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations.
+
+
+ :return: The crypto_endpoint of this Vault.
+ :rtype: str
+ """
+ return self._crypto_endpoint
+
+ @crypto_endpoint.setter
+ def crypto_endpoint(self, crypto_endpoint):
+ """
+ Sets the crypto_endpoint of this Vault.
+ The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations.
+
+
+ :param crypto_endpoint: The crypto_endpoint of this Vault.
+ :type: str
+ """
+ self._crypto_endpoint = crypto_endpoint
+
+ @property
+ def defined_tags(self):
+ """
+ Gets the defined_tags of this Vault.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :return: The defined_tags of this Vault.
+ :rtype: dict(str, dict(str, object))
+ """
+ return self._defined_tags
+
+ @defined_tags.setter
+ def defined_tags(self, defined_tags):
+ """
+ Sets the defined_tags of this Vault.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :param defined_tags: The defined_tags of this Vault.
+ :type: dict(str, dict(str, object))
+ """
+ self._defined_tags = defined_tags
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this Vault.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this Vault.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this Vault.
+ A user-friendly name for the vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this Vault.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def freeform_tags(self):
+ """
+ Gets the freeform_tags of this Vault.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :return: The freeform_tags of this Vault.
+ :rtype: dict(str, str)
+ """
+ return self._freeform_tags
+
+ @freeform_tags.setter
+ def freeform_tags(self, freeform_tags):
+ """
+ Sets the freeform_tags of this Vault.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :param freeform_tags: The freeform_tags of this Vault.
+ :type: dict(str, str)
+ """
+ self._freeform_tags = freeform_tags
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this Vault.
+ The OCID of the vault.
+
+
+ :return: The id of this Vault.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this Vault.
+ The OCID of the vault.
+
+
+ :param id: The id of this Vault.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def lifecycle_state(self):
+ """
+ **[Required]** Gets the lifecycle_state of this Vault.
+ The vault's current state.
+
+ Example: `DELETED`
+
+ Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The lifecycle_state of this Vault.
+ :rtype: str
+ """
+ return self._lifecycle_state
+
+ @lifecycle_state.setter
+ def lifecycle_state(self, lifecycle_state):
+ """
+ Sets the lifecycle_state of this Vault.
+ The vault's current state.
+
+ Example: `DELETED`
+
+
+ :param lifecycle_state: The lifecycle_state of this Vault.
+ :type: str
+ """
+ allowed_values = ["CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION"]
+ if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
+ lifecycle_state = 'UNKNOWN_ENUM_VALUE'
+ self._lifecycle_state = lifecycle_state
+
+ @property
+ def management_endpoint(self):
+ """
+ **[Required]** Gets the management_endpoint of this Vault.
+ The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations.
+
+
+ :return: The management_endpoint of this Vault.
+ :rtype: str
+ """
+ return self._management_endpoint
+
+ @management_endpoint.setter
+ def management_endpoint(self, management_endpoint):
+ """
+ Sets the management_endpoint of this Vault.
+ The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations.
+
+
+ :param management_endpoint: The management_endpoint of this Vault.
+ :type: str
+ """
+ self._management_endpoint = management_endpoint
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this Vault.
+ The date and time this vault was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this Vault.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this Vault.
+ The date and time this vault was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this Vault.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def time_of_deletion(self):
+ """
+ Gets the time_of_deletion of this Vault.
+ An optional property for the deletion time of the Vault expressed in `RFC 3339`__ timestamp format.
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_of_deletion of this Vault.
+ :rtype: datetime
+ """
+ return self._time_of_deletion
+
+ @time_of_deletion.setter
+ def time_of_deletion(self, time_of_deletion):
+ """
+ Sets the time_of_deletion of this Vault.
+ An optional property for the deletion time of the Vault expressed in `RFC 3339`__ timestamp format.
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_of_deletion: The time_of_deletion of this Vault.
+ :type: datetime
+ """
+ self._time_of_deletion = time_of_deletion
+
+ @property
+ def vault_type(self):
+ """
+ **[Required]** Gets the vault_type of this Vault.
+ The type of vault. Each type of vault stores the key with different degrees of isolation and has different options and pricing.
+
+ Allowed values for this property are: "VIRTUAL_PRIVATE", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The vault_type of this Vault.
+ :rtype: str
+ """
+ return self._vault_type
+
+ @vault_type.setter
+ def vault_type(self, vault_type):
+ """
+ Sets the vault_type of this Vault.
+ The type of vault. Each type of vault stores the key with different degrees of isolation and has different options and pricing.
+
+
+ :param vault_type: The vault_type of this Vault.
+ :type: str
+ """
+ allowed_values = ["VIRTUAL_PRIVATE"]
+ if not value_allowed_none_or_none_sentinel(vault_type, allowed_values):
+ vault_type = 'UNKNOWN_ENUM_VALUE'
+ self._vault_type = vault_type
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/key_management/models/vault_summary.py b/src/oci/key_management/models/vault_summary.py
new file mode 100644
index 0000000000..40b4b49a42
--- /dev/null
+++ b/src/oci/key_management/models/vault_summary.py
@@ -0,0 +1,416 @@
+# coding: utf-8
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+
+
+from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
+from oci.decorators import init_model_state_from_kwargs
+
+
+@init_model_state_from_kwargs
+class VaultSummary(object):
+ """
+ VaultSummary model.
+ """
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "CREATING"
+ LIFECYCLE_STATE_CREATING = "CREATING"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "ACTIVE"
+ LIFECYCLE_STATE_ACTIVE = "ACTIVE"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "DELETING"
+ LIFECYCLE_STATE_DELETING = "DELETING"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "DELETED"
+ LIFECYCLE_STATE_DELETED = "DELETED"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "PENDING_DELETION"
+ LIFECYCLE_STATE_PENDING_DELETION = "PENDING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "SCHEDULING_DELETION"
+ LIFECYCLE_STATE_SCHEDULING_DELETION = "SCHEDULING_DELETION"
+
+ #: A constant which can be used with the lifecycle_state property of a VaultSummary.
+ #: This constant has a value of "CANCELLING_DELETION"
+ LIFECYCLE_STATE_CANCELLING_DELETION = "CANCELLING_DELETION"
+
+ #: A constant which can be used with the vault_type property of a VaultSummary.
+ #: This constant has a value of "VIRTUAL_PRIVATE"
+ VAULT_TYPE_VIRTUAL_PRIVATE = "VIRTUAL_PRIVATE"
+
+ def __init__(self, **kwargs):
+ """
+ Initializes a new VaultSummary object with values from keyword arguments.
+ The following keyword arguments are supported (corresponding to the getters/setters of this class):
+
+ :param compartment_id:
+ The value to assign to the compartment_id property of this VaultSummary.
+ :type compartment_id: str
+
+ :param crypto_endpoint:
+ The value to assign to the crypto_endpoint property of this VaultSummary.
+ :type crypto_endpoint: str
+
+ :param defined_tags:
+ The value to assign to the defined_tags property of this VaultSummary.
+ :type defined_tags: dict(str, dict(str, object))
+
+ :param display_name:
+ The value to assign to the display_name property of this VaultSummary.
+ :type display_name: str
+
+ :param freeform_tags:
+ The value to assign to the freeform_tags property of this VaultSummary.
+ :type freeform_tags: dict(str, str)
+
+ :param id:
+ The value to assign to the id property of this VaultSummary.
+ :type id: str
+
+ :param lifecycle_state:
+ The value to assign to the lifecycle_state property of this VaultSummary.
+ Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type lifecycle_state: str
+
+ :param management_endpoint:
+ The value to assign to the management_endpoint property of this VaultSummary.
+ :type management_endpoint: str
+
+ :param time_created:
+ The value to assign to the time_created property of this VaultSummary.
+ :type time_created: datetime
+
+ :param vault_type:
+ The value to assign to the vault_type property of this VaultSummary.
+ Allowed values for this property are: "VIRTUAL_PRIVATE", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+ :type vault_type: str
+
+ """
+ self.swagger_types = {
+ 'compartment_id': 'str',
+ 'crypto_endpoint': 'str',
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'display_name': 'str',
+ 'freeform_tags': 'dict(str, str)',
+ 'id': 'str',
+ 'lifecycle_state': 'str',
+ 'management_endpoint': 'str',
+ 'time_created': 'datetime',
+ 'vault_type': 'str'
+ }
+
+ self.attribute_map = {
+ 'compartment_id': 'compartmentId',
+ 'crypto_endpoint': 'cryptoEndpoint',
+ 'defined_tags': 'definedTags',
+ 'display_name': 'displayName',
+ 'freeform_tags': 'freeformTags',
+ 'id': 'id',
+ 'lifecycle_state': 'lifecycleState',
+ 'management_endpoint': 'managementEndpoint',
+ 'time_created': 'timeCreated',
+ 'vault_type': 'vaultType'
+ }
+
+ self._compartment_id = None
+ self._crypto_endpoint = None
+ self._defined_tags = None
+ self._display_name = None
+ self._freeform_tags = None
+ self._id = None
+ self._lifecycle_state = None
+ self._management_endpoint = None
+ self._time_created = None
+ self._vault_type = None
+
+ @property
+ def compartment_id(self):
+ """
+ **[Required]** Gets the compartment_id of this VaultSummary.
+ The OCID of the compartment that contains this vault.
+
+
+ :return: The compartment_id of this VaultSummary.
+ :rtype: str
+ """
+ return self._compartment_id
+
+ @compartment_id.setter
+ def compartment_id(self, compartment_id):
+ """
+ Sets the compartment_id of this VaultSummary.
+ The OCID of the compartment that contains this vault.
+
+
+ :param compartment_id: The compartment_id of this VaultSummary.
+ :type: str
+ """
+ self._compartment_id = compartment_id
+
+ @property
+ def crypto_endpoint(self):
+ """
+ **[Required]** Gets the crypto_endpoint of this VaultSummary.
+ The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations.
+
+
+ :return: The crypto_endpoint of this VaultSummary.
+ :rtype: str
+ """
+ return self._crypto_endpoint
+
+ @crypto_endpoint.setter
+ def crypto_endpoint(self, crypto_endpoint):
+ """
+ Sets the crypto_endpoint of this VaultSummary.
+ The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations.
+
+
+ :param crypto_endpoint: The crypto_endpoint of this VaultSummary.
+ :type: str
+ """
+ self._crypto_endpoint = crypto_endpoint
+
+ @property
+ def defined_tags(self):
+ """
+ Gets the defined_tags of this VaultSummary.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :return: The defined_tags of this VaultSummary.
+ :rtype: dict(str, dict(str, object))
+ """
+ return self._defined_tags
+
+ @defined_tags.setter
+ def defined_tags(self, defined_tags):
+ """
+ Sets the defined_tags of this VaultSummary.
+ Usage of predefined tag keys. These predefined keys are scoped to namespaces.
+ Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
+
+
+ :param defined_tags: The defined_tags of this VaultSummary.
+ :type: dict(str, dict(str, object))
+ """
+ self._defined_tags = defined_tags
+
+ @property
+ def display_name(self):
+ """
+ **[Required]** Gets the display_name of this VaultSummary.
+ A user-friendly name for a vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :return: The display_name of this VaultSummary.
+ :rtype: str
+ """
+ return self._display_name
+
+ @display_name.setter
+ def display_name(self, display_name):
+ """
+ Sets the display_name of this VaultSummary.
+ A user-friendly name for a vault. It does not have to be unique, and it is changeable.
+ Avoid entering confidential information.
+
+
+ :param display_name: The display_name of this VaultSummary.
+ :type: str
+ """
+ self._display_name = display_name
+
+ @property
+ def freeform_tags(self):
+ """
+ Gets the freeform_tags of this VaultSummary.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :return: The freeform_tags of this VaultSummary.
+ :rtype: dict(str, str)
+ """
+ return self._freeform_tags
+
+ @freeform_tags.setter
+ def freeform_tags(self, freeform_tags):
+ """
+ Sets the freeform_tags of this VaultSummary.
+ Simple key-value pair that is applied without any predefined name, type, or scope.
+ Exists for cross-compatibility only.
+ Example: `{\"bar-key\": \"value\"}`
+
+
+ :param freeform_tags: The freeform_tags of this VaultSummary.
+ :type: dict(str, str)
+ """
+ self._freeform_tags = freeform_tags
+
+ @property
+ def id(self):
+ """
+ **[Required]** Gets the id of this VaultSummary.
+ The OCID of a vault.
+
+
+ :return: The id of this VaultSummary.
+ :rtype: str
+ """
+ return self._id
+
+ @id.setter
+ def id(self, id):
+ """
+ Sets the id of this VaultSummary.
+ The OCID of a vault.
+
+
+ :param id: The id of this VaultSummary.
+ :type: str
+ """
+ self._id = id
+
+ @property
+ def lifecycle_state(self):
+ """
+ **[Required]** Gets the lifecycle_state of this VaultSummary.
+ A vault's current state.
+
+ Example: `ACTIVE`
+
+ Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The lifecycle_state of this VaultSummary.
+ :rtype: str
+ """
+ return self._lifecycle_state
+
+ @lifecycle_state.setter
+ def lifecycle_state(self, lifecycle_state):
+ """
+ Sets the lifecycle_state of this VaultSummary.
+ A vault's current state.
+
+ Example: `ACTIVE`
+
+
+ :param lifecycle_state: The lifecycle_state of this VaultSummary.
+ :type: str
+ """
+ allowed_values = ["CREATING", "ACTIVE", "DELETING", "DELETED", "PENDING_DELETION", "SCHEDULING_DELETION", "CANCELLING_DELETION"]
+ if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
+ lifecycle_state = 'UNKNOWN_ENUM_VALUE'
+ self._lifecycle_state = lifecycle_state
+
+ @property
+ def management_endpoint(self):
+ """
+ **[Required]** Gets the management_endpoint of this VaultSummary.
+ The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations.
+
+
+ :return: The management_endpoint of this VaultSummary.
+ :rtype: str
+ """
+ return self._management_endpoint
+
+ @management_endpoint.setter
+ def management_endpoint(self, management_endpoint):
+ """
+ Sets the management_endpoint of this VaultSummary.
+ The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations.
+
+
+ :param management_endpoint: The management_endpoint of this VaultSummary.
+ :type: str
+ """
+ self._management_endpoint = management_endpoint
+
+ @property
+ def time_created(self):
+ """
+ **[Required]** Gets the time_created of this VaultSummary.
+ The date and time a vault was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :return: The time_created of this VaultSummary.
+ :rtype: datetime
+ """
+ return self._time_created
+
+ @time_created.setter
+ def time_created(self, time_created):
+ """
+ Sets the time_created of this VaultSummary.
+ The date and time a vault was created, expressed in `RFC 3339`__ timestamp format.
+
+ Example: `2018-04-03T21:10:29.600Z`
+
+ __ https://tools.ietf.org/html/rfc3339
+
+
+ :param time_created: The time_created of this VaultSummary.
+ :type: datetime
+ """
+ self._time_created = time_created
+
+ @property
+ def vault_type(self):
+ """
+ **[Required]** Gets the vault_type of this VaultSummary.
+ The type of vault. Each type of vault stores keys with different degrees of isolation and has different options and pricing.
+
+ Allowed values for this property are: "VIRTUAL_PRIVATE", 'UNKNOWN_ENUM_VALUE'.
+ Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
+
+
+ :return: The vault_type of this VaultSummary.
+ :rtype: str
+ """
+ return self._vault_type
+
+ @vault_type.setter
+ def vault_type(self, vault_type):
+ """
+ Sets the vault_type of this VaultSummary.
+ The type of vault. Each type of vault stores keys with different degrees of isolation and has different options and pricing.
+
+
+ :param vault_type: The vault_type of this VaultSummary.
+ :type: str
+ """
+ allowed_values = ["VIRTUAL_PRIVATE"]
+ if not value_allowed_none_or_none_sentinel(vault_type, allowed_values):
+ vault_type = 'UNKNOWN_ENUM_VALUE'
+ self._vault_type = vault_type
+
+ def __repr__(self):
+ return formatted_flat_dict(self)
+
+ def __eq__(self, other):
+ if other is None:
+ return False
+
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not self == other
diff --git a/src/oci/object_storage/models/bucket.py b/src/oci/object_storage/models/bucket.py
index 8eef23ce32..e8e4c16c48 100644
--- a/src/oci/object_storage/models/bucket.py
+++ b/src/oci/object_storage/models/bucket.py
@@ -94,6 +94,10 @@ def __init__(self, **kwargs):
The value to assign to the defined_tags property of this Bucket.
:type defined_tags: dict(str, dict(str, object))
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this Bucket.
+ :type kms_key_id: str
+
"""
self.swagger_types = {
'namespace': 'str',
@@ -106,7 +110,8 @@ def __init__(self, **kwargs):
'public_access_type': 'str',
'storage_tier': 'str',
'freeform_tags': 'dict(str, str)',
- 'defined_tags': 'dict(str, dict(str, object))'
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'kms_key_id': 'str'
}
self.attribute_map = {
@@ -120,7 +125,8 @@ def __init__(self, **kwargs):
'public_access_type': 'publicAccessType',
'storage_tier': 'storageTier',
'freeform_tags': 'freeformTags',
- 'defined_tags': 'definedTags'
+ 'defined_tags': 'definedTags',
+ 'kms_key_id': 'kmsKeyId'
}
self._namespace = None
@@ -134,6 +140,7 @@ def __init__(self, **kwargs):
self._storage_tier = None
self._freeform_tags = None
self._defined_tags = None
+ self._kms_key_id = None
@property
def namespace(self):
@@ -447,6 +454,30 @@ def defined_tags(self, defined_tags):
"""
self._defined_tags = defined_tags
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this Bucket.
+ The OCID of a KMS key id used to call KMS to generate data key, decrypt the encrypted data key
+
+
+ :return: The kms_key_id of this Bucket.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this Bucket.
+ The OCID of a KMS key id used to call KMS to generate data key, decrypt the encrypted data key
+
+
+ :param kms_key_id: The kms_key_id of this Bucket.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
def __repr__(self):
return formatted_flat_dict(self)
diff --git a/src/oci/object_storage/models/create_bucket_details.py b/src/oci/object_storage/models/create_bucket_details.py
index 28c2701a4e..47770c7073 100644
--- a/src/oci/object_storage/models/create_bucket_details.py
+++ b/src/oci/object_storage/models/create_bucket_details.py
@@ -71,6 +71,10 @@ def __init__(self, **kwargs):
The value to assign to the defined_tags property of this CreateBucketDetails.
:type defined_tags: dict(str, dict(str, object))
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this CreateBucketDetails.
+ :type kms_key_id: str
+
"""
self.swagger_types = {
'name': 'str',
@@ -79,7 +83,8 @@ def __init__(self, **kwargs):
'public_access_type': 'str',
'storage_tier': 'str',
'freeform_tags': 'dict(str, str)',
- 'defined_tags': 'dict(str, dict(str, object))'
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'kms_key_id': 'str'
}
self.attribute_map = {
@@ -89,7 +94,8 @@ def __init__(self, **kwargs):
'public_access_type': 'publicAccessType',
'storage_tier': 'storageTier',
'freeform_tags': 'freeformTags',
- 'defined_tags': 'definedTags'
+ 'defined_tags': 'definedTags',
+ 'kms_key_id': 'kmsKeyId'
}
self._name = None
@@ -99,6 +105,7 @@ def __init__(self, **kwargs):
self._storage_tier = None
self._freeform_tags = None
self._defined_tags = None
+ self._kms_key_id = None
@property
def name(self):
@@ -318,6 +325,30 @@ def defined_tags(self, defined_tags):
"""
self._defined_tags = defined_tags
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this CreateBucketDetails.
+ The OCID of a KMS key id used to call KMS to generate data key, decrypt the encrypted data key
+
+
+ :return: The kms_key_id of this CreateBucketDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this CreateBucketDetails.
+ The OCID of a KMS key id used to call KMS to generate data key, decrypt the encrypted data key
+
+
+ :param kms_key_id: The kms_key_id of this CreateBucketDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
def __repr__(self):
return formatted_flat_dict(self)
diff --git a/src/oci/object_storage/models/multipart_upload.py b/src/oci/object_storage/models/multipart_upload.py
index 028cdfcff3..ce2f8dd2b3 100644
--- a/src/oci/object_storage/models/multipart_upload.py
+++ b/src/oci/object_storage/models/multipart_upload.py
@@ -13,13 +13,13 @@ class MultipartUpload(object):
objects that are too large for a single upload operation. With multipart uploads, individual parts of an object can be
uploaded in parallel to reduce the amount of time you spend uploading. Multipart uploads can also minimize the impact
of network failures by letting you retry a failed part upload instead of requiring you to retry an entire object upload.
- See `Managing Multipart Uploads`__.
+ See `Using Multipart Uploads`__.
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,
talk to an administrator. If you're an administrator who needs to write policies to give users access, see
`Getting Started with Policies`__.
- __ https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingmultipartuploads.htm
+ __ https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/usingmultipartuploads.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm
"""
diff --git a/src/oci/object_storage/models/preauthenticated_request.py b/src/oci/object_storage/models/preauthenticated_request.py
index 9aa249bf85..69c8942cb4 100644
--- a/src/oci/object_storage/models/preauthenticated_request.py
+++ b/src/oci/object_storage/models/preauthenticated_request.py
@@ -11,12 +11,12 @@ class PreauthenticatedRequest(object):
"""
Pre-authenticated requests provide a way to let users access a bucket or an object without having their own credentials.
When you create a pre-authenticated request, a unique URL is generated. Users in your organization, partners, or third
- parties can use this URL to access the targets identified in the pre-authenticated request. See `Managing Access to Buckets and Objects`__.
+ parties can use this URL to access the targets identified in the pre-authenticated request. See `Using Pre-Authenticated Requests`__.
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator.
If you're an administrator who needs to write policies to give users access, see `Getting Started with Policies`__.
- __ https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm
+ __ https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm
"""
diff --git a/src/oci/object_storage/models/update_bucket_details.py b/src/oci/object_storage/models/update_bucket_details.py
index 75415953bb..0ce6ef1af1 100644
--- a/src/oci/object_storage/models/update_bucket_details.py
+++ b/src/oci/object_storage/models/update_bucket_details.py
@@ -62,6 +62,10 @@ def __init__(self, **kwargs):
The value to assign to the defined_tags property of this UpdateBucketDetails.
:type defined_tags: dict(str, dict(str, object))
+ :param kms_key_id:
+ The value to assign to the kms_key_id property of this UpdateBucketDetails.
+ :type kms_key_id: str
+
"""
self.swagger_types = {
'namespace': 'str',
@@ -70,7 +74,8 @@ def __init__(self, **kwargs):
'metadata': 'dict(str, str)',
'public_access_type': 'str',
'freeform_tags': 'dict(str, str)',
- 'defined_tags': 'dict(str, dict(str, object))'
+ 'defined_tags': 'dict(str, dict(str, object))',
+ 'kms_key_id': 'str'
}
self.attribute_map = {
@@ -80,7 +85,8 @@ def __init__(self, **kwargs):
'metadata': 'metadata',
'public_access_type': 'publicAccessType',
'freeform_tags': 'freeformTags',
- 'defined_tags': 'definedTags'
+ 'defined_tags': 'definedTags',
+ 'kms_key_id': 'kmsKeyId'
}
self._namespace = None
@@ -90,6 +96,7 @@ def __init__(self, **kwargs):
self._public_access_type = None
self._freeform_tags = None
self._defined_tags = None
+ self._kms_key_id = None
@property
def namespace(self):
@@ -291,6 +298,36 @@ def defined_tags(self, defined_tags):
"""
self._defined_tags = defined_tags
+ @property
+ def kms_key_id(self):
+ """
+ Gets the kms_key_id of this UpdateBucketDetails.
+ A KMS key OCID that will be associated with the given bucket. If it is empty the Update operation will
+ actually remove the KMS key, if there is one, from the given bucket. Please note, the old kms key should
+ still be enbaled in KMS otherwise all the objects in the bucket encrypted with the old KMS key will no
+ longer accessible.
+
+
+ :return: The kms_key_id of this UpdateBucketDetails.
+ :rtype: str
+ """
+ return self._kms_key_id
+
+ @kms_key_id.setter
+ def kms_key_id(self, kms_key_id):
+ """
+ Sets the kms_key_id of this UpdateBucketDetails.
+ A KMS key OCID that will be associated with the given bucket. If it is empty the Update operation will
+ actually remove the KMS key, if there is one, from the given bucket. Please note, the old kms key should
+ still be enbaled in KMS otherwise all the objects in the bucket encrypted with the old KMS key will no
+ longer accessible.
+
+
+ :param kms_key_id: The kms_key_id of this UpdateBucketDetails.
+ :type: str
+ """
+ self._kms_key_id = kms_key_id
+
def __repr__(self):
return formatted_flat_dict(self)
diff --git a/src/oci/object_storage/object_storage_client.py b/src/oci/object_storage/object_storage_client.py
index f9c81843f8..c29e32178d 100644
--- a/src/oci/object_storage/object_storage_client.py
+++ b/src/oci/object_storage/object_storage_client.py
@@ -280,7 +280,8 @@ def commit_multipart_upload(self, namespace_name, bucket_name, object_name, uplo
def create_bucket(self, namespace_name, create_bucket_details, **kwargs):
"""
Create Bucket
- Creates a bucket in the given namespace with a bucket name and optional user-defined metadata.
+ Creates a bucket in the given namespace with a bucket name and optional user-defined metadata. Avoid entering confidential
+ information in bucket names.
:param str namespace_name: (required)
@@ -1922,7 +1923,9 @@ def list_preauthenticated_requests(self, namespace_name, bucket_name, **kwargs):
def put_object(self, namespace_name, bucket_name, object_name, put_object_body, **kwargs):
"""
PUT Object
- Creates a new object or overwrites an existing one.
+ Creates a new object or overwrites an existing one. See `Special Instructions for Object Storage PUT`__ for request signature requirements.
+
+ __ https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/signingrequests.htm#ObjectStoragePut
:param str namespace_name: (required)
@@ -2401,7 +2404,9 @@ def update_namespace_metadata(self, namespace_name, update_namespace_metadata_de
def upload_part(self, namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, **kwargs):
"""
Upload Multipart Object Part
- Uploads a single part of a multipart upload.
+ Uploads a single part of a multipart upload. See `Special Instructions for Object Storage PUT`__ for request signature requirements.
+
+ __ https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/signingrequests.htm#ObjectStoragePut
:param str namespace_name: (required)
diff --git a/src/oci/regions.py b/src/oci/regions.py
index 2f36abaa43..4941ac39be 100644
--- a/src/oci/regions.py
+++ b/src/oci/regions.py
@@ -25,14 +25,11 @@ def is_region(region_name):
return region_name.lower() in REGIONS
-def endpoint_for(service, region=None, endpoint=None):
+def endpoint_for(service, region=None, endpoint=None, service_endpoint_template=None):
"""Returns the base URl for a service, either in the given region or at the specified endpoint.
If endpoint and region are provided, endpoint is used.
"""
- if service.lower() not in SERVICE_ENDPOINTS:
- raise ValueError("Unknown service {!r}".format(service))
-
if not (endpoint or region):
raise ValueError("Must supply either a region or an endpoint.")
elif endpoint:
@@ -42,6 +39,10 @@ def endpoint_for(service, region=None, endpoint=None):
# no endpoint provided
region = region.lower()
+ # use service endpoint template if available
+ if (service_endpoint_template):
+ return service_endpoint_template.format(region=region)
+
# for backwards compatibility, if region already has a '.'
# then consider it the full domain and do not append '.oraclecloud.com'
if '.' in region:
@@ -49,5 +50,8 @@ def endpoint_for(service, region=None, endpoint=None):
else:
domain = DOMAIN_FORMAT.format(region=region)
+ if service.lower() not in SERVICE_ENDPOINTS:
+ raise ValueError("Unknown service {!r}".format(service))
+
url_format = SERVICE_ENDPOINTS[service.lower()]
return url_format.format(domain=domain)
diff --git a/src/oci/service_endpoints.py b/src/oci/service_endpoints.py
index 1cc1b64c15..477935bd5d 100644
--- a/src/oci/service_endpoints.py
+++ b/src/oci/service_endpoints.py
@@ -12,6 +12,9 @@
"email": "https://email.{domain}",
"file_storage": "https://filestorage.{domain}",
"identity": "https://identity.{domain}",
+ "kms_crypto": "https://kms.{domain}",
+ "kms_provisioning": "https://kms.{domain}",
+ "kms_vault": "https://kms.{domain}",
"load_balancer": "https://iaas.{domain}",
"object_storage": "https://objectstorage.{domain}",
"resource_search": "https://query.{domain}"
diff --git a/src/oci/version.py b/src/oci/version.py
index 20b15562b5..6a23b87f5a 100644
--- a/src/oci/version.py
+++ b/src/oci/version.py
@@ -1,4 +1,4 @@
# coding: utf-8
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
-__version__ = "2.0.3"
+__version__ = "2.0.4"
diff --git a/tests/conftest.py b/tests/conftest.py
index 394260b90c..f97e548451 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -24,17 +24,17 @@ def pytest_configure(config):
test_config_container.vcr_mode = config.getoption("--vcr-record-mode")
-@pytest.fixture
+@pytest.fixture(scope="session")
def config_file(request):
return request.config.getoption("--config-file")
-@pytest.fixture
+@pytest.fixture(scope="session")
def config_profile(request):
return request.config.getoption("--config-profile")
-@pytest.fixture
+@pytest.fixture(scope="session")
def config(config_file, config_profile):
config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
util.target_region = config['region']
@@ -53,7 +53,7 @@ def tenant_id(config):
return config['tenancy']
-@pytest.fixture
+@pytest.fixture(scope="session")
def object_storage(config):
client = oci.object_storage.ObjectStorageClient(config)
add_retries_to_service_operations(client)
diff --git a/tests/integ/test_launch_instance_tutorial.py b/tests/integ/test_launch_instance_tutorial.py
index 9d4e9356cb..978a366108 100644
--- a/tests/integ/test_launch_instance_tutorial.py
+++ b/tests/integ/test_launch_instance_tutorial.py
@@ -58,6 +58,10 @@ def test_tutorial(virtual_network, compute, block_storage, config):
terminate_instance(compute, instance)
if subnet:
delete_subnet(virtual_network, subnet)
+ if gateway:
+ # Clear the route table so it does not have a reference to the internet gateway
+ virtual_network.update_route_table(vcn.default_route_table_id, oci.core.models.UpdateRouteTableDetails(route_rules=[]))
+ delete_internet_gateway(virtual_network, gateway.id)
if vcn:
delete_cloud_network(virtual_network, vcn)
@@ -161,6 +165,11 @@ def create_internet_gateway(virtual_network, compartment, test_id, vcn):
return gateway
+def delete_internet_gateway(virtual_network, gateway_id):
+ vcn_composite_ops = oci.core.VirtualNetworkClientCompositeOperations(virtual_network)
+ vcn_composite_ops.delete_internet_gateway_and_wait_for_state(gateway_id, wait_for_states=[oci.core.models.InternetGateway.LIFECYCLE_STATE_TERMINATED])
+
+
def update_route_table(virtual_network, test_id, vcn, gateway):
# print('Updating route table')
route_rule = oci.core.models.RouteRule()
diff --git a/tests/integ/util.py b/tests/integ/util.py
index cfc77f1ffc..8bf84959b9 100644
--- a/tests/integ/util.py
+++ b/tests/integ/util.py
@@ -11,7 +11,7 @@
from oci.object_storage.transfer.constants import MEBIBYTE
from .. import test_config_container
-TEST_DATA_VERSION = '1'
+TEST_DATA_VERSION = '2'
COMPARTMENT_ID = os.environ.get("OCI_PYSDK_COMPARTMENT_ID")
COMPARTMENT_NAME = os.environ.get("OCI_PYSDK_COMPARTMENT_NAME")
@@ -185,10 +185,11 @@ def ensure_test_data(api, namespace, compartment, bucket_prefix):
test_data_version_object).data.content.decode('UTF-8')
if version == TEST_DATA_VERSION:
- return
+ return True
except Exception as error:
# if the bucket has never been created with the test_metadata, then create it
if error.status == 404:
+ print(error)
create_bucket(api, namespace, compartment, test_data_metadata_bucket)
api.put_object(namespace, test_data_metadata_bucket, test_data_version_object, TEST_DATA_VERSION)
else:
@@ -206,18 +207,13 @@ def ensure_test_data(api, namespace, compartment, bucket_prefix):
create_bucket(api, namespace, compartment, bucket_prefix + 'ReadOnlyTestBucket4')
create_object(api, namespace, bucket_prefix + 'ReadOnlyTestBucket4', 'hasUserMetadata.json', metadata={'foo1': 'bar1', 'foo2': 'bar2'})
create_bucket(api, namespace, compartment, bucket_prefix + 'ReadOnlyTestBucket5', {'foo1': 'bar1', 'foo2': 'bar2'})
- create_bucket(api, namespace, compartment, bucket_prefix + 'ReadOnlyTestBucket6')
-
- for num in range(1, 213):
- create_object(api, namespace, bucket_prefix + 'ReadOnlyTestBucket6', 'ob' + str(num))
-
- for num in range(7, 209):
- create_bucket(api, namespace, compartment, bucket_prefix + 'ReadOnlyTestBucket' + str(num))
# Update test data version
create_bucket(api, namespace, compartment, test_data_metadata_bucket)
api.put_object(namespace, test_data_metadata_bucket, test_data_version_object, TEST_DATA_VERSION)
+ return True
+
def create_bucket(api, namespace, compartment, bucket_name, metadata=None, objects=None):
"""Deletes all buckets and objects in the given compartment."""