From 69629cd6bb4c59c463624840517432641748956c Mon Sep 17 00:00:00 2001 From: Mike Ross Date: Thu, 27 Apr 2017 18:10:32 -0700 Subject: [PATCH] Releasing version 1.3.1 (#14) --- .gitignore | 4 +- CHANGELOG.rst | 10 +++ docs/index.rst | 1 + docs/installation.rst | 4 - docs/parallel-ops.rst | 5 ++ examples/parallel_upload_to_object_storage.py | 81 +++++++++++++++++++ oraclebmc/core/models/console_history.py | 8 +- oraclebmc/core/models/dhcp_dns_option.py | 8 +- oraclebmc/core/models/dhcp_options.py | 8 +- oraclebmc/core/models/drg.py | 8 +- oraclebmc/core/models/drg_attachment.py | 8 +- oraclebmc/core/models/image.py | 8 +- oraclebmc/core/models/instance.py | 8 +- oraclebmc/core/models/internet_gateway.py | 8 +- oraclebmc/core/models/ip_sec_connection.py | 8 +- oraclebmc/core/models/route_table.py | 8 +- oraclebmc/core/models/security_list.py | 8 +- oraclebmc/core/models/subnet.py | 8 +- oraclebmc/core/models/tunnel_status.py | 8 +- oraclebmc/core/models/vcn.py | 8 +- oraclebmc/core/models/vnic.py | 8 +- oraclebmc/core/models/vnic_attachment.py | 8 +- oraclebmc/core/models/volume.py | 8 +- oraclebmc/core/models/volume_attachment.py | 8 +- oraclebmc/core/models/volume_backup.py | 8 +- oraclebmc/identity/models/api_key.py | 8 +- oraclebmc/identity/models/compartment.py | 8 +- oraclebmc/identity/models/group.py | 8 +- oraclebmc/identity/models/policy.py | 8 +- oraclebmc/identity/models/swift_password.py | 8 +- oraclebmc/identity/models/ui_password.py | 8 +- oraclebmc/identity/models/user.py | 8 +- .../identity/models/user_group_membership.py | 8 +- oraclebmc/version.py | 2 +- setup.py | 1 + 35 files changed, 210 insertions(+), 114 deletions(-) create mode 100644 docs/parallel-ops.rst create mode 100644 examples/parallel_upload_to_object_storage.py diff --git a/.gitignore b/.gitignore index 166af4ccad..156b6a37a9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,15 +6,17 @@ abandoned/ .settings .DS_Store .idea/ +*.iml *.pyc *.egg-info/ .tox/ .cache/ build/ +data/ dist/ __pycache__/ env/ docs/_build/ docs/apidocs/ oraclebmc/models/init_* -tests/resources/test_debug.log \ No newline at end of file +tests/resources/test_debug.log diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c63f2cbfb..141175792f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== + 1.3.1 - 2017-04-27 +==================== + +------- + Changed +------- + +* No longer throwing exceptions for unrecognized enum values returned by services. Any unrecognized enum value returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + ==================== 1.3.0 - 2017-04-06 ==================== diff --git a/docs/index.rst b/docs/index.rst index 64ea745aef..475dbf3e09 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -34,6 +34,7 @@ To get started, head over to the :ref:`installation instructions ` or s installation configuration quickstart + parallel-ops raw-requests api/index contributions diff --git a/docs/installation.rst b/docs/installation.rst index 8e4d80ac22..e1ec85f114 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -117,10 +117,6 @@ Service Errors Any operation resulting in a service error will cause an exception of type oraclebmc.exceptions.ServiceError to be thrown by the SDK. For information about common service errors returned by BMCS, see `API Errors `_ . -Oracle Linux Permission Issues ------------------------------- -On Oracle Linux 7.3, if you encounter permission issues when running pip install, you might need to use ``sudo``. - SSL/TLS or Certificate Issues ----------------------------- diff --git a/docs/parallel-ops.rst b/docs/parallel-ops.rst new file mode 100644 index 0000000000..eb258480e8 --- /dev/null +++ b/docs/parallel-ops.rst @@ -0,0 +1,5 @@ +.. _parallel-ops: + +Parallel Operations +~~~~~~~~~~~~~~~~~~~~~~ +The Python SDK supports parallel requests to Oracle Bare Metal Cloud Services. For example, the `object storage upload `_ example shows how multiple processes can be used to upload files to object storage. \ No newline at end of file diff --git a/examples/parallel_upload_to_object_storage.py b/examples/parallel_upload_to_object_storage.py new file mode 100644 index 0000000000..1f9effa0bf --- /dev/null +++ b/examples/parallel_upload_to_object_storage.py @@ -0,0 +1,81 @@ +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# +# Uploads all files from a local directory to an object storage bucket +# using multiple processes so that the uploads are done in parallel. +# +# Assumptions: Object storage bucket already exists. See object_crud.py for +# an example of creating a bucket. +# Loads configuration from default profile in the default config +# file + +import oraclebmc +import os +import argparse +from multiprocessing import Process +from glob import glob + + +def upload_to_object_storage(config, namespace, bucket, path): + """ + upload_to_object_storage will upload a file to an object storage bucket. + This function is intended to be run as a separate process. The client is + created with each invocation so that the separate processes do + not have a reference to the same client. + + :param config: a configuration dictionary used to create ObjectStorageClient + :param namespace: Namespace where the bucket resides + :param bucket: Name of the bucket in which the object will be stored + :param path: path to file to upload to object storage + :rtype: None + """ + with open(path, "rb") as in_file: + name = os.path.basename(path) + ostorage = oraclebmc.object_storage.ObjectStorageClient(config) + ostorage.put_object(namespace, + bucket, + name, + in_file) + print("Finished uploading {}".format(name)) + + +if __name__ == "__main__": + config = oraclebmc.config.from_file() + object_storage = oraclebmc.object_storage.ObjectStorageClient(config) + namespace = object_storage.get_namespace().data + + description = "\n".join(["This is an example to show how multiple files can be uploaded to in", + "parallel. The example uses multiple processes.", + "", + "All the files in 'directory' will be uploaded to the object storage bucket", + "specified by 'bucket_name' The default profile will is used.", + "", + "The bucket must already exist. See object_crud.py for a bucket creation", + "example."]) + + parser = argparse.ArgumentParser(description=description, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument(dest='bucket_name', + help="Name of object storage bucket") + parser.add_argument(dest='directory', + help="Path to local directory containing files to upload. Do not include trailing path delimiter.") + args = parser.parse_args() + + bucket_name = args.bucket_name + directory = args.directory + if not os.path.isdir(directory): + parser.usage() + else: + dir = directory + os.path.sep + "*" + + proc_list = [] + for file_path in glob(dir): + print("Starting upload for {}".format(file_path)) + p = Process(target=upload_to_object_storage, args=(config, + namespace, + args.bucket_name, + file_path)) + p.start() + proc_list.append(p) + + for job in proc_list: + job.join() diff --git a/oraclebmc/core/models/console_history.py b/oraclebmc/core/models/console_history.py index c199e0eb88..8c41fa5e18 100644 --- a/oraclebmc/core/models/console_history.py +++ b/oraclebmc/core/models/console_history.py @@ -171,6 +171,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this ConsoleHistory. The current state of the console history. + Allowed values for this property are: "REQUESTED", "GETTING-HISTORY", "SUCCEEDED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this ConsoleHistory. :rtype: str @@ -189,10 +192,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["REQUESTED", "GETTING-HISTORY", "SUCCEEDED", "FAILED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/dhcp_dns_option.py b/oraclebmc/core/models/dhcp_dns_option.py index b2ba822d12..c5095cc3a4 100644 --- a/oraclebmc/core/models/dhcp_dns_option.py +++ b/oraclebmc/core/models/dhcp_dns_option.py @@ -73,6 +73,9 @@ def server_type(self): __ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm + Allowed values for this property are: "VcnLocal", "VcnLocalPlusInternet", "CustomDnsServer", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The server_type of this DhcpDnsOption. :rtype: str @@ -106,10 +109,7 @@ def server_type(self, server_type): """ allowed_values = ["VcnLocal", "VcnLocalPlusInternet", "CustomDnsServer"] if server_type not in allowed_values: - raise ValueError( - "Invalid value for `server_type`, must be one of {0}" - .format(allowed_values) - ) + server_type = 'UNKNOWN_ENUM_VALUE' self._server_type = server_type def __repr__(self): diff --git a/oraclebmc/core/models/dhcp_options.py b/oraclebmc/core/models/dhcp_options.py index ec5bde5cbc..7d8dec01db 100644 --- a/oraclebmc/core/models/dhcp_options.py +++ b/oraclebmc/core/models/dhcp_options.py @@ -115,6 +115,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this DhcpOptions. The current state of the set of DHCP options. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this DhcpOptions. :rtype: str @@ -133,10 +136,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/drg.py b/oraclebmc/core/models/drg.py index 2d07a1ee82..2858cca388 100644 --- a/oraclebmc/core/models/drg.py +++ b/oraclebmc/core/models/drg.py @@ -109,6 +109,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Drg. The DRG's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Drg. :rtype: str @@ -127,10 +130,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/drg_attachment.py b/oraclebmc/core/models/drg_attachment.py index 97467f52a3..714df1e4ac 100644 --- a/oraclebmc/core/models/drg_attachment.py +++ b/oraclebmc/core/models/drg_attachment.py @@ -139,6 +139,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this DrgAttachment. The DRG attachment's current state. + Allowed values for this property are: "ATTACHING", "ATTACHED", "DETACHING", "DETACHED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this DrgAttachment. :rtype: str @@ -157,10 +160,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/image.py b/oraclebmc/core/models/image.py index 73037cee82..e8e8dbef21 100644 --- a/oraclebmc/core/models/image.py +++ b/oraclebmc/core/models/image.py @@ -179,6 +179,9 @@ def id(self, id): def lifecycle_state(self): """ Gets the lifecycle_state of this Image. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "DISABLED", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Image. :rtype: str @@ -195,10 +198,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "DISABLED", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/instance.py b/oraclebmc/core/models/instance.py index 108d459b2a..176eb601f2 100644 --- a/oraclebmc/core/models/instance.py +++ b/oraclebmc/core/models/instance.py @@ -253,6 +253,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Instance. The current state of the instance. + Allowed values for this property are: "PROVISIONING", "RUNNING", "STARTING", "STOPPING", "STOPPED", "CREATING_IMAGE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Instance. :rtype: str @@ -271,10 +274,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "RUNNING", "STARTING", "STOPPING", "STOPPED", "CREATING_IMAGE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/internet_gateway.py b/oraclebmc/core/models/internet_gateway.py index 78b9df972d..801a4cd451 100644 --- a/oraclebmc/core/models/internet_gateway.py +++ b/oraclebmc/core/models/internet_gateway.py @@ -141,6 +141,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this InternetGateway. The Internet Gateway's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this InternetGateway. :rtype: str @@ -159,10 +162,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/ip_sec_connection.py b/oraclebmc/core/models/ip_sec_connection.py index 24a8ca46e7..23661894c5 100644 --- a/oraclebmc/core/models/ip_sec_connection.py +++ b/oraclebmc/core/models/ip_sec_connection.py @@ -166,6 +166,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this IPSecConnection. The IPSec connection's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this IPSecConnection. :rtype: str @@ -184,10 +187,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/route_table.py b/oraclebmc/core/models/route_table.py index 4c44d1e55f..79cf27c57d 100644 --- a/oraclebmc/core/models/route_table.py +++ b/oraclebmc/core/models/route_table.py @@ -115,6 +115,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this RouteTable. The route table's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this RouteTable. :rtype: str @@ -133,10 +136,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/security_list.py b/oraclebmc/core/models/security_list.py index 985ac3c0a8..2fa1300ed6 100644 --- a/oraclebmc/core/models/security_list.py +++ b/oraclebmc/core/models/security_list.py @@ -166,6 +166,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this SecurityList. The security list's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this SecurityList. :rtype: str @@ -184,10 +187,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/subnet.py b/oraclebmc/core/models/subnet.py index d7c5eeef42..dad8f13021 100644 --- a/oraclebmc/core/models/subnet.py +++ b/oraclebmc/core/models/subnet.py @@ -271,6 +271,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Subnet. The subnet's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Subnet. :rtype: str @@ -289,10 +292,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/tunnel_status.py b/oraclebmc/core/models/tunnel_status.py index 91a2546736..9b9768c8fa 100644 --- a/oraclebmc/core/models/tunnel_status.py +++ b/oraclebmc/core/models/tunnel_status.py @@ -62,6 +62,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this TunnelStatus. The tunnel's current state. + Allowed values for this property are: "UP", "DOWN", "DOWN_FOR_MAINTENANCE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this TunnelStatus. :rtype: str @@ -80,10 +83,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["UP", "DOWN", "DOWN_FOR_MAINTENANCE"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/vcn.py b/oraclebmc/core/models/vcn.py index da6778bf35..0ec74e40ee 100644 --- a/oraclebmc/core/models/vcn.py +++ b/oraclebmc/core/models/vcn.py @@ -279,6 +279,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Vcn. The VCN's current state. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Vcn. :rtype: str @@ -297,10 +300,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/vnic.py b/oraclebmc/core/models/vnic.py index dc430c0cdd..fcb0211631 100644 --- a/oraclebmc/core/models/vnic.py +++ b/oraclebmc/core/models/vnic.py @@ -208,6 +208,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Vnic. The current state of the VNIC. + Allowed values for this property are: "PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Vnic. :rtype: str @@ -226,10 +229,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "AVAILABLE", "TERMINATING", "TERMINATED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/vnic_attachment.py b/oraclebmc/core/models/vnic_attachment.py index bd7930ac5f..50045dc6f4 100644 --- a/oraclebmc/core/models/vnic_attachment.py +++ b/oraclebmc/core/models/vnic_attachment.py @@ -173,6 +173,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this VnicAttachment. The current state of the VNIC attachment. + Allowed values for this property are: "ATTACHING", "ATTACHED", "DETACHING", "DETACHED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this VnicAttachment. :rtype: str @@ -191,10 +194,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/volume.py b/oraclebmc/core/models/volume.py index 261727af98..2e908fa990 100644 --- a/oraclebmc/core/models/volume.py +++ b/oraclebmc/core/models/volume.py @@ -143,6 +143,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this Volume. The current state of a volume. + Allowed values for this property are: "PROVISIONING", "RESTORING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Volume. :rtype: str @@ -161,10 +164,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["PROVISIONING", "RESTORING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/volume_attachment.py b/oraclebmc/core/models/volume_attachment.py index 19c9b7574a..bc554261a1 100644 --- a/oraclebmc/core/models/volume_attachment.py +++ b/oraclebmc/core/models/volume_attachment.py @@ -214,6 +214,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this VolumeAttachment. The current state of the volume attachment. + Allowed values for this property are: "ATTACHING", "ATTACHED", "DETACHING", "DETACHED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this VolumeAttachment. :rtype: str @@ -232,10 +235,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["ATTACHING", "ATTACHED", "DETACHING", "DETACHED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/core/models/volume_backup.py b/oraclebmc/core/models/volume_backup.py index 403cded218..fd0337d301 100644 --- a/oraclebmc/core/models/volume_backup.py +++ b/oraclebmc/core/models/volume_backup.py @@ -121,6 +121,9 @@ def lifecycle_state(self): Gets the lifecycle_state of this VolumeBackup. The current state of a volume backup. + Allowed values for this property are: "CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this VolumeBackup. :rtype: str @@ -139,10 +142,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "AVAILABLE", "TERMINATING", "TERMINATED", "FAULTY", "REQUEST_RECEIVED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/api_key.py b/oraclebmc/identity/models/api_key.py index 65ece051d3..c6b8b7f766 100644 --- a/oraclebmc/identity/models/api_key.py +++ b/oraclebmc/identity/models/api_key.py @@ -170,6 +170,9 @@ def lifecycle_state(self): The API key's current state. After creating an `ApiKey` object, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this ApiKey. :rtype: str @@ -189,10 +192,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/compartment.py b/oraclebmc/identity/models/compartment.py index 0bee89bab7..d1c0053492 100644 --- a/oraclebmc/identity/models/compartment.py +++ b/oraclebmc/identity/models/compartment.py @@ -170,6 +170,9 @@ def lifecycle_state(self): The compartment's current state. After creating a compartment, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Compartment. :rtype: str @@ -189,10 +192,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/group.py b/oraclebmc/identity/models/group.py index 6f09acd7ad..de690594bc 100644 --- a/oraclebmc/identity/models/group.py +++ b/oraclebmc/identity/models/group.py @@ -170,6 +170,9 @@ def lifecycle_state(self): The group's current state. After creating a group, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Group. :rtype: str @@ -189,10 +192,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/policy.py b/oraclebmc/identity/models/policy.py index ef4a32c398..5c445f0449 100644 --- a/oraclebmc/identity/models/policy.py +++ b/oraclebmc/identity/models/policy.py @@ -200,6 +200,9 @@ def lifecycle_state(self): The policy's current state. After creating a policy, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this Policy. :rtype: str @@ -219,10 +222,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/swift_password.py b/oraclebmc/identity/models/swift_password.py index 0d5af22c73..4f35028c99 100644 --- a/oraclebmc/identity/models/swift_password.py +++ b/oraclebmc/identity/models/swift_password.py @@ -203,6 +203,9 @@ def lifecycle_state(self): The password's current state. After creating a password, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this SwiftPassword. :rtype: str @@ -222,10 +225,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/ui_password.py b/oraclebmc/identity/models/ui_password.py index e347a93667..3ad9bf36b0 100644 --- a/oraclebmc/identity/models/ui_password.py +++ b/oraclebmc/identity/models/ui_password.py @@ -114,6 +114,9 @@ def lifecycle_state(self): The password's current state. After creating a password, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this UIPassword. :rtype: str @@ -133,10 +136,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/user.py b/oraclebmc/identity/models/user.py index dc892b39cb..13852fe0c9 100644 --- a/oraclebmc/identity/models/user.py +++ b/oraclebmc/identity/models/user.py @@ -170,6 +170,9 @@ def lifecycle_state(self): The user's current state. After creating a user, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this User. :rtype: str @@ -189,10 +192,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/identity/models/user_group_membership.py b/oraclebmc/identity/models/user_group_membership.py index cce7835536..278b6ce81d 100644 --- a/oraclebmc/identity/models/user_group_membership.py +++ b/oraclebmc/identity/models/user_group_membership.py @@ -168,6 +168,9 @@ def lifecycle_state(self): The membership's current state. After creating a membership object, make sure its `lifecycleState` changes from CREATING to ACTIVE before using it. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :return: The lifecycle_state of this UserGroupMembership. :rtype: str @@ -187,10 +190,7 @@ def lifecycle_state(self, lifecycle_state): """ allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] if lifecycle_state not in allowed_values: - raise ValueError( - "Invalid value for `lifecycle_state`, must be one of {0}" - .format(allowed_values) - ) + lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state @property diff --git a/oraclebmc/version.py b/oraclebmc/version.py index 13c81fc1ab..c968ed592a 100644 --- a/oraclebmc/version.py +++ b/oraclebmc/version.py @@ -1,4 +1,4 @@ # coding: utf-8 # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. -__version__ = "1.3.0" +__version__ = "1.3.1" diff --git a/setup.py b/setup.py index 84ad2e90c3..cea3f53bfc 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ def open_relative(*path): "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: Universal Permissive License (UPL)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", ]