Skip to content

Commit 87c08f9

Browse files
Merge pull request #9 from oracle/release_120
1.2.0 Release
2 parents 27cf90b + f1079b6 commit 87c08f9

21 files changed

+581
-147
lines changed

CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44

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

7+
====================
8+
1.2.0 - 2017-03-28
9+
====================
10+
11+
-------
12+
Fixed
13+
-------
14+
15+
* Allow service responses to deserialize to base classes when unknown subtypes are returned. Previously this would result in an exception.
16+
17+
-------
18+
Added
19+
-------
20+
21+
* Support hostnames for instances and DNS labels for VCNs and subnets.
22+
723
====================
824
1.1.2 - 2017-03-16
925
====================

docs/installation.rst

Lines changed: 47 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ This topic describes how to install, configure, and use the Oracle Bare Metal Cl
77
The Python SDK supports operations for the following services:
88

99
* Identity and Access Management Service
10-
* Object Storage Service
1110
* Core Services (Networking Service, Compute Service, and Block Volume Service)
11+
* Object Storage Service
1212

1313
===============
1414
Prerequisites
@@ -22,25 +22,25 @@ The Python SDK supports operations for the following services:
2222
Oracle Bare Metal Cloud Services policies, see `Common Policies`_ in the User Guide.
2323
* Python version 2.7.5 or 3.5 or later, running on Mac, Windows, or Linux.
2424
* The Python SDK uses the `cryptography.io`_ library, which has its own additional `build requirements`_.
25-
* The Python SDK requires `TLS 1.2`_, which versions of `openssl`_ before 1.0.1 do not provide.
26-
If your version of Python was built against an earlier version, you will need to install a new
27-
Python that links against a newer version.
2825
* A keypair used for signing API requests, with the public key uploaded to Oracle. Only the user calling
29-
the API should be in possession of the private key. See Configuring the SDK below.
26+
the API should be in possession of the private key. (For more information, see `Configuring the SDK`_.)
3027

31-
.. _Adding Users: https://docs.us-phoenix-1.oraclecloud.com/Content/GSG/Tasks/addingusers.htm
32-
.. _Common Policies: https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm
33-
.. _cryptography.io: https://cryptography.io/en/latest/
34-
.. _build requirements: https://cryptography.io/en/latest/installation/
35-
.. _TLS 1.2: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm
36-
.. _PyPI: https://pypi.python.org/pypi
37-
.. _openssl: https://www.openssl.org/
3828

3929
====================================
4030
Downloading and Installing the SDK
4131
====================================
4232

43-
You can install the Python SDK from GitHub or through the Python Package Index (PyPI).
33+
You can install the Python SDK through the Python Package Index (PyPI), or alternatively through GitHub.
34+
35+
**PyPi**
36+
37+
To install from `PyPI <https://pypi.python.org/pypi/oraclebmc>`_:
38+
39+
Use the following command::
40+
41+
pip install oraclebmc
42+
43+
**GitHub**
4444

4545
To install from GitHub:
4646

@@ -56,15 +56,10 @@ To install from GitHub:
5656
If you're unable to install the whl file, make sure pip is up to date.
5757
Use ``pip install -U pip`` and then try to install the whl file again.
5858

59-
To install from `PyPI <https://pypi.python.org/pypi/oraclebmc>`_:
60-
61-
Use the following command::
6259

63-
pip install oraclebmc
60+
**Virtual environment (Optional)**
6461

65-
66-
(Optional)
67-
Oracle recommends that you run the SDK in a virtual environment with virtualenv.
62+
Although optional, Oracle recommends that you run the SDK in a virtual environment with virtualenv.
6863

6964
With Linux, it's usually in a separate package from the main Python package.
7065
If you need to install virtualenv, use pip install virtualenv.
@@ -89,104 +84,55 @@ For instructions, see `SDK and Tool Configuration`_ in the User Guide.
8984

9085
.. _SDK and Tool Configuration: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm
9186

92-
====================
93-
Note for OSX Users
94-
====================
87+
Verify OpenSSL Version
88+
----------------------
9589

96-
OS X already has Python and OpenSSL preinstalled. However, the preinstalled OpenSSL is probably not version 1.0.x or
97-
newer, which is what you need. To check whether you have a supported OpenSSL version, run this command::
90+
The supported version of OpenSSL for the Python SDK is version 1.0.1 or newer. Run the following command to find out the version of OpenSSL that you have::
9891

9992
python -c "import ssl; print(ssl.OPENSSL_VERSION)"
10093

101-
If the version is ``0.9.x``, you need to reinstall Python and OpenSSL using Homebrew
102-
(a package manager for the OS X platform).
103-
104-
If you've never used Homebrew to install Python on the system, follow these instructions:
105-
106-
1. Download and install `Homebrew`_.
107-
2. Use these commands to update Homebrew and then install OpenSSL and Python:
108-
::
94+
If the version is lower than ``1.0.1``, run the following command to bypass the version issue::
10995

110-
brew update
111-
brew install openssl
112-
brew install python
113-
114-
.. note::
96+
pip install requests[security]
11597

116-
If you get a "Permission denied" message when running any brew command, it's probably because
117-
the OS X permissions model conflicts with Homebrew's default installation location of ``/usr/local``.
118-
You can usually fix this by taking back control of the folder with ``sudo chown -R $(whoami) /usr/local``.
98+
This command instructs the `requests <https://pypi.python.org/pypi/requests>`_
99+
library used by the Python SDK to use the version of OpenSSL that is bundled with the `cryptography <https://pypi.python.org/pypi/cryptography>`_
100+
library used by the SDK.
119101

120-
Check the OpenSSL version again. If it's still 0.9, see `Troubleshooting Mac Issues`_.
102+
**Note:**
103+
If you don't want to use ``requests[security]`` you can update OpenSSL as you normally would. For example, on OS X, use Homebrew to update OpenSSL using the following commands::
121104

122-
.. _Homebrew: http://brew.sh/
105+
brew update
106+
brew install openssl
107+
brew install python
123108

124109
=================
125110
Troubleshooting
126111
=================
127112

128113
You might encounter issues when installing Python or the SDK, or using the SDK itself.
129114

130-
----------------------------
131-
Troubleshooting OEL Issues
132-
----------------------------
133-
On OEL 7.3, if you encounter permission issues when running pip install, you might need to use ``sudo``.
115+
Service Errors
116+
--------------
117+
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 <https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm>`_
118+
.
134119

135-
----------------------------
136-
Troubleshooting Mac Issues
137-
----------------------------
120+
Oracle Linux Permission Issues
121+
------------------------------
122+
On Oracle Linux 7.3, if you encounter permission issues when running pip install, you might need to use ``sudo``.
138123

139-
There are several general types of issues you might encounter.
140-
141-
OpenSSL Version Still 0.9.x
142-
===========================
143-
144-
If the Python installation instructions listed in Mac above still result in OpenSSL version 0.9.x,
145-
it might be one of these reasons:
146-
147-
* Your python command is pointing to the wrong Python installation. To check, use the which python command.
148-
The default system Python is at ``/usr/bin/python``, whereas the Homebrew-installed version that you want
149-
is typically at ``usr/local/bin``. Edit the ``etc/paths`` file to move the ``usr/local/bin`` line to the
150-
top of the list. Don't remove the system Python line.
151-
152-
* Your virtualenv is pointing to the wrong Python installation. By default, virtualenv uses ``/usr/bin/python``,
153-
whereas the Homebrew-installed Python is typically at ``usr/local/bin``. To fix this, use this command::
154-
155-
virtualenv -p <path to Homebrew Python> <directory for the virtualenv>
156-
157-
For example, if your installation is at /usr/local/bin/python::
158-
159-
virtualenv -p /usr/local/bin/python bmcs_sdk_env
160-
161-
To determine the location of your Homebrew-installed Python, try one of these commands::
162-
163-
brew info python
164-
which -a python # (the -a option lists all the Python installations)
165-
brew doctor
166-
167-
If the above items don't fix the problem, the best strategy is to uninstall and reinstall Python with the following
168-
commands. Note that you will need to reinstall any packages you previously installed into Homebrew's Python via pip.
169-
::
170-
171-
brew uninstall openssl
172-
brew uninstall python
173-
brew update
174-
brew install python
175-
176-
If you're still having problems, you may need slightly different commands depending on the version of Homebrew
177-
that was used to install your Python or OpenSSL libraries. Here's a recent post that may be helpful:
178-
`Updating Python and OpenSSL on OS X`__.
179-
180-
__ https://community.dev.hpe.com/t5/Blogs/Updating-Python-and-Openssl-on-OS-X/ba-p/237791
181-
182-
SSL/TLS or Certificate Exception
183-
================================
184-
185-
When trying to use the SDK, if you get an exception related to SSL/TLS or certificates/certificate validation,
186-
the underlying issue is that OpenSSL is the wrong version (0.9.x). See the solution for uninstalling and
187-
reinstalling Python above. Make sure to also reinstall the wheel with this command::
188-
189-
pip install oraclebmc-*-py2.py3-none-any.whl
124+
SSL/TLS or Certificate Issues
125+
-----------------------------
190126

127+
When trying to use the SDK, if you get an exception related to SSL/TLS or certificates/certificate validation, see the command for installing requests[security] in `Verify OpenSSL Version`_.
191128

192129

130+
.. _Adding Users: https://docs.us-phoenix-1.oraclecloud.com/Content/GSG/Tasks/addingusers.htm
131+
.. _Common Policies: https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm
132+
.. _cryptography.io: https://cryptography.io/en/latest/
133+
.. _build requirements: https://cryptography.io/en/latest/installation/
134+
.. _TLS 1.2: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm
135+
.. _PyPI link: https://pypi.python.org/pypi
136+
.. _openssl: https://www.openssl.org/
137+
.. _ConfiguringSDK: Configuring the SDK
138+
.. _OSXUsers: Verify OpenSSL Version

oraclebmc/core/models/attach_volume_details.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def get_subtype(object_dictionary):
3838

3939
if type == 'iscsi':
4040
return 'AttachIScsiVolumeDetails'
41-
42-
raise ValueError('Could not resolve subtype type based on the object dictionary.')
41+
else:
42+
return 'AttachVolumeDetails'
4343

4444
@property
4545
def display_name(self):

oraclebmc/core/models/create_subnet_details.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def __init__(self):
1515
'compartment_id': 'str',
1616
'dhcp_options_id': 'str',
1717
'display_name': 'str',
18+
'dns_label': 'str',
1819
'route_table_id': 'str',
1920
'security_list_ids': 'list[str]',
2021
'vcn_id': 'str'
@@ -26,6 +27,7 @@ def __init__(self):
2627
'compartment_id': 'compartmentId',
2728
'dhcp_options_id': 'dhcpOptionsId',
2829
'display_name': 'displayName',
30+
'dns_label': 'dnsLabel',
2931
'route_table_id': 'routeTableId',
3032
'security_list_ids': 'securityListIds',
3133
'vcn_id': 'vcnId'
@@ -36,6 +38,7 @@ def __init__(self):
3638
self._compartment_id = None
3739
self._dhcp_options_id = None
3840
self._display_name = None
41+
self._dns_label = None
3942
self._route_table_id = None
4043
self._security_list_ids = None
4144
self._vcn_id = None
@@ -170,6 +173,66 @@ def display_name(self, display_name):
170173
"""
171174
self._display_name = display_name
172175

176+
@property
177+
def dns_label(self):
178+
"""
179+
Gets the dns_label of this CreateSubnetDetails.
180+
A DNS label for the subnet, used in conjunction with the VNIC's hostname and
181+
VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
182+
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
183+
Must be unique within the VCN and comply with
184+
`RFC 952`__ and
185+
`RFC 1123`__. The value cannot be changed.
186+
187+
This value must be set if you want to use the VCN Resolver to resolve the
188+
hostnames of instances in the subnet. It can only be set if the VCN itself
189+
was created with a DNS label.
190+
191+
For more information, see
192+
`DNS in Your Virtual Cloud Network`__.
193+
194+
Example: `subnet-123`
195+
196+
__ https://tools.ietf.org/html/rfc952
197+
__ https://tools.ietf.org/html/rfc1123
198+
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
199+
200+
201+
:return: The dns_label of this CreateSubnetDetails.
202+
:rtype: str
203+
"""
204+
return self._dns_label
205+
206+
@dns_label.setter
207+
def dns_label(self, dns_label):
208+
"""
209+
Sets the dns_label of this CreateSubnetDetails.
210+
A DNS label for the subnet, used in conjunction with the VNIC's hostname and
211+
VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
212+
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
213+
Must be unique within the VCN and comply with
214+
`RFC 952`__ and
215+
`RFC 1123`__. The value cannot be changed.
216+
217+
This value must be set if you want to use the VCN Resolver to resolve the
218+
hostnames of instances in the subnet. It can only be set if the VCN itself
219+
was created with a DNS label.
220+
221+
For more information, see
222+
`DNS in Your Virtual Cloud Network`__.
223+
224+
Example: `subnet-123`
225+
226+
__ https://tools.ietf.org/html/rfc952
227+
__ https://tools.ietf.org/html/rfc1123
228+
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
229+
230+
231+
:param dns_label: The dns_label of this CreateSubnetDetails.
232+
:type: str
233+
"""
234+
self._dns_label = dns_label
235+
173236
@property
174237
def route_table_id(self):
175238
"""

0 commit comments

Comments
 (0)