Skip to content

Commit 2d5523d

Browse files
authored
Merge pull request #37 from oracle/release_2017-11-27
Releasing version 1.3.10
2 parents e6d98d2 + c6824dd commit 2d5523d

File tree

260 files changed

+9955
-451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+9955
-451
lines changed

CHANGELOG.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ 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.3.10 - 2017-11-27
9+
====================
10+
11+
Added
12+
-----
13+
* Support for initializing model objects from keyword arguments
14+
* Support for VCN to VCN peering within the same region
15+
* Support for sorting and filtering in list APIs in Load Balancing service
16+
* Support for user managed boot volumes
17+
* Support for using a second physical NIC when attaching VNICs on X7 Bare Metal instances
18+
19+
Fixed
20+
-----
21+
* Model types now check the data types of their attributes prior to data being serialized and sent to the service
22+
* When opc_request_id is specified as a parameter, it is no longer overwritten with a SDK-generated value
23+
724
====================
825
1.3.9 - 2017-11-02
926
====================

README-development.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
============
2+
Development
3+
============
4+
5+
Getting Started
6+
===============
7+
Assuming that you have Python and `virtualenv` installed, set up your environment and install the required dependencies like this:
8+
9+
.. code-block:: sh
10+
11+
git clone https://github.com/oracle/oci-python-sdk.git
12+
cd oci-python-sdk
13+
virtualenv oci-python-sdk-env
14+
. oci-python-sdk-env/bin/activate
15+
pip install -r requirements.txt
16+
pip install -e .
17+
18+
You should also set up your configuration files as described `here`__
19+
20+
__ https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm
21+
22+
Running Tests
23+
=============
24+
The SDK uses `pytest` as its test framework. You can run tests against Python 2.7 Python 3.5 using the `tox` command. Note that this requires that you have those versions of Python installed,
25+
otherwise you must pass `-e` or run tests directly:
26+
27+
.. code-block:: sh
28+
29+
# This will run tests against all configured Pythons in tox.ini (currently 2.7 and 3.5). You need to have those versions installed
30+
tox
31+
32+
# This will run tests against a specific Python versions
33+
tox -e py27
34+
35+
If you wish to run an individual test then you can run:
36+
37+
.. code-block:: sh
38+
39+
py.test -s tests/integ/test_launch_instance_tutorial.py
40+
41+
Specifying a config file
42+
------------------------
43+
44+
By default, the tests will look for a config file at 'tests/resources/config'
45+
and use the ``DEFAULT`` profile. You can change this with the ``--config-file``
46+
and ``--config-profile`` options.
47+
48+
.. code-block:: sh
49+
50+
# Use a different config file, still using the DEFAULT profile
51+
tox -- --config-file ~/.oci/config
52+
53+
# Using a different profile in the default config file
54+
tox -- --config-profile IAD_PROFILE
55+
56+
Specifying environment variables
57+
--------------------------------
58+
In addition to a valid config file for your tenancy, the tests also require the following environment
59+
variables to be set:
60+
61+
* ``OCI_PYSDK_PUBLIC_SSH_KEY_FILE``: path to a public SSH key (.pub file) that will be given access to the instance launched in ``test_launch_instance_tutorial.py``.
62+
63+
Generating Documentation
64+
========================
65+
Sphinx is used for documentation. You can generate HTML locally with the following:
66+
67+
.. code-block:: sh
68+
69+
pip install -r requirements.txt
70+
cd docs
71+
make html
72+
73+
Generating the wheel
74+
====================
75+
The SDK is packaged as a wheel. In order to generate the wheel you can run:
76+
77+
.. code-block:: sh
78+
79+
python setup.py sdist bdist_wheel
80+
81+
This wheel can then be installed via `pip`.

README.rst

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -50,83 +50,9 @@ __ https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/insta
5050
Development
5151
============
5252

53-
Getting Started
54-
===============
55-
Assuming that you have Python and `virtualenv` installed, set up your environment and install the required dependencies like this:
53+
See the `development readme`__ for information on how to make changes, run tests and build the documentation and wheel for the Python SDK.
5654

57-
.. code-block:: sh
58-
59-
git clone https://github.com/oracle/oci-python-sdk.git
60-
cd oci-python-sdk
61-
virtualenv oci-python-sdk-env
62-
. oci-python-sdk-env/bin/activate
63-
pip install -r requirements.txt
64-
pip install -e .
65-
66-
You should also set up your configuration files as described `here`__
67-
68-
__ https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm
69-
70-
Running Tests
71-
=============
72-
The SDK uses `pytest` as its test framework. You can run tests against Python 2.7 Python 3.5 using the `tox` command. Note that this requires that you have those versions of Python installed,
73-
otherwise you must pass `-e` or run tests directly:
74-
75-
.. code-block:: sh
76-
77-
# This will run tests against all configured Pythons in tox.ini (currently 2.7 and 3.5). You need to have those versions installed
78-
tox
79-
80-
# This will run tests against a specific Python versions
81-
tox -e py27
82-
83-
If you wish to run an individual test then you can run:
84-
85-
.. code-block:: sh
86-
87-
py.test -s tests/integ/test_launch_instance_tutorial.py
88-
89-
Specifying a config file
90-
------------------------
91-
92-
By default, the tests will look for a config file at 'tests/resources/config'
93-
and use the ``DEFAULT`` profile. You can change this with the ``--config-file``
94-
and ``--config-profile`` options.
95-
96-
.. code-block:: sh
97-
98-
# Use a different config file, still using the DEFAULT profile
99-
tox -- --config-file ~/.oci/config
100-
101-
# Using a different profile in the default config file
102-
tox -- --config-profile IAD_PROFILE
103-
104-
Specifying environment variables
105-
--------------------------------
106-
In addition to a valid config file for your tenancy, the tests also require the following environment
107-
variables to be set:
108-
109-
* ``OCI_PYSDK_PUBLIC_SSH_KEY_FILE``: path to a public SSH key (.pub file) that will be given access to the instance launched in ``test_launch_instance_tutorial.py``.
110-
111-
Generating Documentation
112-
========================
113-
Sphinx is used for documentation. You can generate HTML locally with the following:
114-
115-
.. code-block:: sh
116-
117-
pip install -r requirements.txt
118-
cd docs
119-
make html
120-
121-
Generating the wheel
122-
====================
123-
The SDK is packaged as a wheel. In order to generate the wheel you can run:
124-
125-
.. code-block:: sh
126-
127-
python setup.py sdist bdist_wheel
128-
129-
This wheel can then be installed via `pip`.
55+
__ https://github.com/oracle/oci-python-sdk/blob/master/README-development.rst
13056

13157
========
13258
Examples

docs/api/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ API Reference
2828
--------
2929

3030
.. automodule:: oci.audit.models
31+
:special-members: __init__
3132
:members:
3233
:undoc-members:
3334
:imported-members:
35+
:inherited-members:
3436

3537
===============
3638
Core Services
@@ -65,9 +67,11 @@ Virtual Network
6567
--------
6668

6769
.. automodule:: oci.core.models
70+
:special-members: __init__
6871
:members:
6972
:undoc-members:
7073
:imported-members:
74+
:inherited-members:
7175

7276
==========
7377
Database
@@ -85,9 +89,11 @@ Virtual Network
8589
--------
8690

8791
.. automodule:: oci.database.models
92+
:special-members: __init__
8893
:members:
8994
:undoc-members:
9095
:imported-members:
96+
:inherited-members:
9197

9298
==========
9399
Identity
@@ -105,9 +111,11 @@ Virtual Network
105111
--------
106112

107113
.. automodule:: oci.identity.models
114+
:special-members: __init__
108115
:members:
109116
:undoc-members:
110117
:imported-members:
118+
:inherited-members:
111119

112120
==============
113121
Load Balancer
@@ -125,9 +133,11 @@ Load Balancer
125133
--------
126134

127135
.. automodule:: oci.load_balancer.models
136+
:special-members: __init__
128137
:members:
129138
:undoc-members:
130139
:imported-members:
140+
:inherited-members:
131141

132142
================
133143
Object Storage
@@ -145,9 +155,11 @@ Load Balancer
145155
--------
146156

147157
.. automodule:: oci.object_storage.models
158+
:special-members: __init__
148159
:members:
149160
:undoc-members:
150161
:imported-members:
162+
:inherited-members:
151163

152164
================
153165
Upload Manager

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ To get started, head over to the :ref:`installation instructions <install>` or s
4747
forward-compatibility
4848
backward-compatibility
4949
quickstart
50+
logging
5051
parallel-ops
5152
pass-explicit-null
5253
upload-manager

docs/logging.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. raw:: html
2+
3+
<script type='text/javascript'>
4+
var oldDocsHost = 'oracle-bare-metal-cloud-services-python-sdk';
5+
if (window.location.href.indexOf(oldDocsHost) != -1) {
6+
window.location.href = 'https://oracle-bare-metal-cloud-services-python-sdk.readthedocs.io/en/latest/deprecation-notice.html';
7+
}
8+
</script>
9+
10+
Logging
11+
~~~~~~~
12+
13+
The Python SDK uses Python's `logging <https://docs.python.org/3.6/library/logging.html>`_ module.
14+
15+
Loggers for the Python SDK are ordered hierarchically, with the top level being ``oci`` (or ``oraclebmc`` if you are using the legacy OracleBMC package).
16+
17+
Logger names are of the form ``<hierarchy>.<id>`` where the ``<hierarchy>`` is similar to ``oci.base_client`` and ``<id>`` is the result of Python's built-in ``id()`` function. The implication of this is that different instances of the same class have different loggers.
18+
19+
Request Logging
20+
================
21+
Logging of the requests which the Python SDK sends to OCI services can be enabled by setting the ``log_requests`` attribute to ``True`` in your configuration. This could be done in your configuration file, for example:
22+
23+
.. code-block:: text
24+
25+
[DEFAULT]
26+
user = <user OCID>
27+
fingerprint = <fingerprint>
28+
key_file = <key file>
29+
tenancy = <tenancy OCID>
30+
region = us-ashburn-1
31+
log_requests = True
32+
33+
Or programmatically, for example:
34+
35+
.. code-block:: python
36+
37+
config = {
38+
"user": user_ocid,
39+
"key_file": key_file,
40+
"fingerprint": calc_fingerprint(key_file),
41+
"tenancy": testrunner.tenancy,
42+
"region": testrunner.region,
43+
"log_requests": True
44+
}
45+
46+
Once you have request logging in your config, you can create the appropriate logging handler(s) for your use case. For example to log to an output stream such as ``stderr`` you could do:
47+
48+
.. code-block:: python
49+
50+
import oci
51+
import logging
52+
53+
config = oci.config.from_file()
54+
config['log_requests'] = True
55+
56+
logging.basicConfig()
57+
58+
client = oci.identity.IdentityClient(config)
59+
60+
# This call will emit log information to stderr
61+
client.list_regions()
62+
63+
Note that request logging occurs at the following levels:
64+
65+
* ``INFO``: Request method and request URL
66+
* ``DEBUG``: Request headers and body, and response headers
67+
68+
The raw response body is not logged.

src/oci/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
33

4-
from . import audit, config, constants, core, database, exceptions, identity, load_balancer, object_storage, regions
4+
from . import audit, config, constants, core, decorators, database, exceptions, identity, load_balancer, object_storage, regions
55
from .base_client import BaseClient
66
from .request import Request
77
from .response import Response
@@ -12,7 +12,7 @@
1212

1313
__all__ = [
1414
"BaseClient", "Error", "Request", "Response", "Signer",
15-
"audit", "config", "constants", "core", "database", "exceptions",
15+
"audit", "config", "constants", "core", "decorators", "database", "exceptions",
1616
"identity", "load_balancer", "object_storage", "regions",
1717
"wait_until"
1818
]

0 commit comments

Comments
 (0)