Coder Social home page Coder Social logo

oci-python-sdk's Issues

Python is_stateless returning False or None for Seclist

We are using oci sdk --version 2.4.32

When trying to read the security rules that are in a seclist – we seem to be hitting something odd…
When looking at “rule.is_stateless” – we expect “True” or “False” per the documentation. However, we seem to be getting “None” or False. Below are the functions we’re using.

ingressRules = vnc.get_security_list(seclist_id).data.ingress_security_rules
egressRules = vnc.get_security_list(seclist_id).data.egress_security_rules

for seclist_id in response.data.security_list_ids:
ingressRules = vnc.get_security_list(seclist_id).data.ingress_security_rules
for rule in ingressRules:
.
..
.. ....
print (rule.is_stateless) ---- returns false/none {expecting true/false}

Can we add the option to use a proxy when making the request to OCI?

I'm in the Oracle VPN, and I can't hit the servers without setting the proxy in my env that I am running my process in.

Here's my traceback:

oci._vendor.requests.exceptions.ConnectionError: HTTPSConnectionPool(host='objectstorage.us-phoenix-1.oraclecloud.com', port=443): Max retries exceeded with url: taken_out_because_this_is_public (Caused by NewConnectionError('<oci._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f094d392c88>: Failed to establish a new connection: [Errno 113] No route to host',))

Should I just make a PR? Or is there another solution to this you already know of?

Install fails with cryptography 2.6

Issue:

Starting with cryptography 2.6 (released today) the SDK won't install in a Python 3.6 virtualenv. I expect it won't install anywhere but I haven't tested that. The SDK should install using the documented process, pip install oci.

NOTE: There appears to be an open ticket here -> pyca/cryptography#4789. This may get resolved upstream.

Error:

...
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.6/_padding.c'
creating build/temp.linux-x86_64-3.6
generating cffi module 'build/temp.linux-x86_64-3.6/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-3.6/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-3.6/build
creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c build/temp.linux-x86_64-3.6/_openssl.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_openssl.o -Wconversion -Wno-error=sign-conversion
 error: command 'gcc' failed with exit status 1
 ----------------------------------------
 Failed building wheel for cryptography
 Running setup.py clean for cryptography
Failed to build cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

Workaround:

Install cryptography 2.5 before installing the SDK -

pip install cryptography==2.5
pip install oci

Repo:

I'm running this in the Oracle-Linux-7.6-2019.01.17-0 image on OCI.

sudo yum install -y python36 python-pip
sudo pip install virtualenvwrapper

mkdir workdir && cd workdir
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bash_profile
echo 'export PROJECT_HOME=$HOME/Devel' >> ~/.bash_profile
echo 'source /usr/bin/virtualenvwrapper.sh' >> ~/.bash_profile
source ~/.bash_profile
mkvirtualenv workdir --python=python3.6
echo 'cd ~/workdir && workon workdir' >> ~/.bash_profile
source ~/.bash_profile
pip install oci

References:

Abnormally pinned setup.py dependencies

Setup.py should not pin dependencies, else the package can't coexist with others. At worst, min (or max) versions should be specified.

But pytz should never be pinned, people need recent versions of it all the time.

not update 1.3.8 docs

the documentation has not been updated example: database services client documentation is missing at docs site

KmsManagementClient - MissingEndpointForNonRegionalServiceClientError exception

Hi SDK group

I would like to list the vaults and then the keys per vault.
Issue to initiate KmsManagementClient

kms_keys = oci.key_management.KmsManagementClient(config)
Throw exception - MissingEndpointForNonRegionalServiceClientError('An endpoint must be provided for a non-regional service client')
Altough the documentation mentioned service_endpoint is optional

Adding service_endpoint from the vault:
kms_keys = oci.key_management.KmsManagementClient(config,service_endpoint=vault.management_endpoint)
But the function list_keys does not have option to filter by vault_id therefore, there is some issue here !
keySummary has vault_id which I need to filter inside a loop

Please advise:

  1. Why service_endpoint is required when specify optional in documentation
  2. How do I fetch the key if I have key_id but not vault (need to use KmsManagementClient and get_key but don't have service_endpoint) ?
  3. Why cannot filter vault_id in list keys

list_compartments for identity

When I'm trying to use:

identity = oci.identity.IdentityClient(config)
identity.list_compartments(config["compartment"], access_level="ANY", compartment_id_in_subtree=True).data

I receive the following error:

  File "check_for_duplicates.py", line 177, in <module>
    list_compartments_response = identity.list_compartments(config["compartment"], access_level="ANY", compartment_id_in_subtree=True).data
  File "/usr/lib/python3.6/site-packages/oci/identity/identity_client.py", line 2723, in list_compartments
    "list_compartments got unknown kwargs: {!r}".format(extra_kwargs))
ValueError: list_compartments got unknown kwargs: ['access_level', 'compartment_id_in_subtree']

Announcement Service Not Found

After updating the OCI package with pip install oci -U, I received the error message:

Traceback (most recent call last):
  File "/opt/goat/www/cgi-bin/test.py", line 25, in <module>
    announcement_client = oci.announcements_service.AnnouncementClient(config, signer=signer)
AttributeError: 'module' object has no attribute 'announcements_service'

I attempted to define an announcements client just like I defined the network client as shown. The network client was created without issue, but the python script fails at the creation of the announcement client:

    network_client = oci.core.VirtualNetworkClient(config, signer=signer)
    announcement_client = oci.announcements_service.AnnouncementClient(config, signer=signer)

Is there a known lag between the release of the oci package to git and it's deployment through pip?

Consider updating python-dateutil

(Oracle employee here)

python-dateutil is pinned to <=2.7.3

Common packages like Luigi (workflow engine) require >= 2.7.5. This causes a pipenv conflict and an inability to create a package lock file.

All updates for python-dateutil since 2.7.3 seem to be tzdata updates, so this should be a safe change to make.

Suggest pinning to <3 rather than <=2.7.3

ObjectStorageClient.list_objects does not return ListObjects.data.next_start_with

(Oracle employee)
Hi,

I implemented an iterator for bucket's file list using ObjectStorageClient.list_objects function.
The buckets that I'm iterating has more than 1000 files and therefor I'm using the start argument based on the response.data.next_start_with from the last response.
When the iterator reaches the chunk before the last, the response retreived with response.data.next_start_with=None and not with the proper file name.

For example, for a bucket with 4500 files, the requests for files 0-999, 1000-1999, 2000-2999 are returned with proper response.data.next_start_with value but the request for files 3000-3999 which should contain reference to the 4000th file returns with response.data.next_start_with=None.

here is the relevant code that reproduces the issue:

def __iter__(self):
        oci.config.validate_config(config)
        client = ObjectStorageClient(config)
        response = client.list_objects(namespace_name, bucket_name,
                                       delimiter='/', fields='name,timeCreated')
        while response.data.next_start_with and response.data.objects:
            for obj in response.data.objects:
                yield obj.name, obj.time_created
            response = client.list_objects(namespace_name, bucket_name,
                                           delimiter='/',
                                           fields='name,timeCreated',
                                           start=response.data.next_start_with)

Python SDK has complex way of API key upload

  1. In the doc https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/identity/models/oci.identity.models.ApiKey.html#oci.identity.models.ApiKey you can see "UNKNOWN_ENUM_VALUE".. that needs to be corrected. Not sure when that can happen.

  2. Once I use the upload_api_key in IdentityClient to upload a public key. Its very difficult to know when the lifecycle state changes to ACTIVE.

  3. No examples to use this API

https://github.com/oracle/oci-python-sdk/blob/master/docs/api/identity/models/oci.identity.models.ApiKey.rst
or

  1. Further more the problem is the format of the public API key ... I had to do something like this:
    POLICY_TEST_USER_PUBLIC_KEY_LINES = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3wcQOvxpNDizIAzwDfas\nFfWQRRtVfZ31wNosly30e811iZ8NNF7f6OoZww8e/j9ezxkKXlTVGsD+75iaTaZ3\nPbdOywqdLtyOEpRlnqOBVoeK8nWxEWKXyrnmWyolE01zkxNWVk5jI75LaNaMVMa2\nWXjkAEtn/M5+wBY+MELT9UZVXhFohZ1vLexvJwe1W1r0Mu4n9Z7ujuFaZqD/osQe\nAF57fq7SOGu4An/z4qE+oGiJJGPnQPDKEXJCfjUIIeFkOBH8RyMhQrPbSGp7/lBv\nvtbl0PuOB3fUOtDmW84+1ZpHgON9jBGoHyinfS06Dn0YH5VBoL1xpjvAea2PIWOq\nuQIDAQAB\n-----END PUBLIC KEY-----"

It should have accepted in the base64 format and not in this format

missing util from tests.integ

in the tests/conftest.py, it requires:
from tests.integ import util
from tests.util import get_resource_path

But there is no such file under tests/integ. Please add the missing file.

Thanks,
Qing

Optional/hidden configuration fields are actually required by client classes

The documentation states:

Since config is a dict, you can also build it manually and check it with config.validate_config()

So I create a simple dictionary similar to this:

{
    "user" = ...,
    "tenancy" = ...,
    "fingerprint" = ...,
    "key_file" = ...,
    "region" = ...
}

That dictionary passes the validate_config() check.

However, when attempting to create a VirtualNetworkClient I get a KeyError for pass_phrase.

After looking at the oraclebmc/config.py and oraclebmc/core/virtual_network_client.py source code, it appears that client code makes the assumption that all configuration dictionaries have these optional fields populated. Configurations loaded with config.from_file() automatically pre-populate these fields. But synthetic ones obviously do not.

The client classes should validate whether these optional values are present in the configuration before assigning them in their constructors.

SDK returns error when creating a global resource outside of home region

In the UI, the console detects your home region and automatically runs the command through your home region. The SDK acknowledges your home region, and fails with a message that you should run the command in your home region. Even though the resource (a user deployed with the user_crud.py example) will be populated globally.

I expect the sdk to behave in the same way as the console and run the command through my home region for me.

python user_crud.py
Creating a new user 'python-sdk-example-user' in compartment u'ocid1.tenancy.oc1..aaaaaaaaiqvbw46md3vnh3luutu5uyxar2xwb3z3ybaozlnnoervfbl57p2q'
Traceback (most recent call last):
File "user_crud.py", line 24, in
user = identity.create_user(request)
File "/Users/kfields/oci-python-sdk/src/oci/identity/identity_client.py", line 724, in create_user
response_type="User")
File "/Users/kfields/oci-python-sdk/src/oci/base_client.py", line 139, in call_api
return self.request(request)
File "/Users/kfields/oci-python-sdk/src/oci/base_client.py", line 165, in request
self.raise_service_error(response)
File "/Users/kfields/oci-python-sdk/src/oci/base_client.py", line 245, in raise_service_error
message)
oci.exceptions.ServiceError: {'status': 403, 'message': u'Please go to your home region PHX to execute CREATE, UPDATE and DELETE operations.', 'code': u'NotAllowed', 'opc-request-id': '97AD7E6B313647AA922ED6C7FE080766/F7E7AE847FDC8CDDD67CCD70C3171C63/220AE55995EF48E4859F157E1F6B979F'}

SDK dependency on requests==2.11.1 is strict or we can have any latest version?

I can see in setup.py, that we have defined dependency on python package requests==2.11.1. Is this a strict dependency? Or we can have any requests version > 2.11.1 and SDK would work?
If SDK can work with version > 2.11.1 for requests package, then can we add that in setup.py also? Since now I am using OCI==1.3.9 and another python package which has dependencies on different versions of requests, creating problem. Also unfortunately I need both modules which are part of my virtualenv.

Any help on this is appreciated. Thanks in advance.

list_* by tags

Hi

It is wonderful that one is able to tag objects such as compute, compartment, vcn etc. Though it is slightly asymmetrical that one have no way of listing objects having a set of tags.

Sort of having the ability to do:

    def computes(self, compartment_ocid, freeform_tags=None):
        return self.compute_client.list_instances(compartment_ocid, freeform_tags=freeform_tags).data

How to speed up reading of a large file from object store?

I have a file of about 160 MB on Object store and it is taking almost 8 minutes to download that. What can I do to speed that up?
This is what I'm doing right now.

client = oci.object_storage.ObjectStorageClient(..)
obj = client.get_object(..., ...., ...)

for chunk in obj.data.raw.stream(2048 ** 2, decode_content=False):
    file.write(chunk)

I tried playing the buffer size but that didn't seem to make any difference. What else can I do to download that file faster?

How do I send user_data when launching an instance?

LaunchInstanceDetails supports providing user_data: base64-encoded data to be used by Cloud-Init to run custom scripts or provide custom Cloud-Init configuration.

When I try and send this through using the below code:

with open('/tmp/cinit.sh') as myfile:
    l_cinit=myfile.read()

l_cinit_b=base64.encodestring(l_cinit.encode('ascii'))

launch_instance_details = oci.core.models.LaunchInstanceDetails (
    display_name=p_instance_info['instance_name'],
    compartment_id=p_instance_info['compartment_id'],
    availability_domain=p_instance_info['availability_domain'],
    shape=p_target_shape,
    source_details=oci.core.models.InstanceSourceViaBootVolumeDetails(boot_volume_id=p_instance_info['boot_volume_id']),
    create_vnic_details=oci.core.models.CreateVnicDetails(
        subnet_id=p_instance_info['subnet_id'],
        private_ip=p_instance_info['priv_ip']
    ),
    metadata={
        "user_data":l_cinit_b
    }
)
launch_instance_response = p_compute_client.launch_instance(launch_instance_details)

I receive this error from the SDK:

TypeError: Field metadata.user_data with value b'<redacted>' was expected to be of type str but was of type bytes

If I do "user_data":l_cinit_b then I get this error instead:

oci.exceptions.ServiceError: {'opc-request-id': '<redacted>, 'code': 'InvalidParameter', 'message': 'user_data must be base64 encoded', 'status': 400}

How do I successfully send user_data via the Python SDK?

Issue passing a list of strings into the object- UpdatePolicyDetails for statements

Hello,

I am trying to update a policy with following statement

Here is the code snippet:
statements_to_be_added = ['ALLOW group EXAMPLE TO MANAGE users IN TENANCY']
template_stmt = []

#doing this convert to string in case
for stmt in statements_to_be_added:
stmt_to_be_added = str(stmt)
template_stmt.append(stmt_to_be_added)

#outside for loop
identity.update_policy(policyid, oci.identity.models.UpdatePolicyDetails(statements=template_stmt))

oci.exceptions.ServiceError: {'opc-request-id': '43B518D6EB8E4D37A179A28984E78BF8/DC99C55F6291A49EC9C8199380EC472C/F0D0F0D3E738366C5C7492ECA3C9F981', 'code': 'InvalidParameter', 'message': "'syntax error starting with <<EOF>>'@'line 1, char 73' \n", 'status': 400}

Based on the documentation, it is list[str].

The type for template_stmt above is <class 'list'>

Please let me know how to resolve this. Thanks

Unable to validate_config when supplying "private_key_content" in dict

According to the code for https://github.com/oracle/oci-python-sdk/blob/master/src/oci/identity/identity_client.py

It should be possible to create a config dict and supply the private_key_content within this dictionary.

However, when doing so, it is still required to provide a key_file parameter. It cannot be omitted (gives error: oci.exceptions.InvalidConfig: {'key_file': 'missing'}, and when both are supplied, the validation continues to try to load the key_file and thus creates a problem if the file doesn't exist or contain the key file.

config = {
"user": user_ocid,
"key_file": key_file,
"fingerprint": calc_fingerprint(key_file),
"tenancy": testrunner.tenancy,
"private_key_content": "-------BEGIN RSA....",
"region": testrunner.region
}

from oci.config import validate_config
validate_config(config)

output of list_objects : objects size,time_created,md5 are showing null when using python sdk

Hi, this issue is reported in #90. but it has been closed but issue is still here.

From https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/object_storage/client/oci.object_storage.ObjectStorageClient.html#oci.object_storage.ObjectStorageClient.list_objects we can see it's return value

Returns: A Response object with data of type ListObjects

Here is my output of the return, we can see object_size,time_created,md5 are showing null instead of a actual value. Can you help to view this issue again?
{
"next_start_with": null,
"objects": [
{
"md5": null,
"name": "1487902706.jpg",
"size": null,
"time_created": null
},
{
"md5": null,
"name": "48132889.jpg",
"size": null,
"time_created": null
}
],
"prefixes": null
}

ResourceWarning: unclosed socket.socket

Hey there guys,

I've run into an interesting warning using the compute api on python 3.7. I'm just running simple apis like: compute.update_image(image_ocid, UpdateImageDetails(defined_tags=defined_tags)) but I'm seeing this error (produced using import tracemalloc; tracemalloc.start() to find where the socket was created):

ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.15.15.88', 61087), raddr=('129.146.14.197', 443)>
  <snipped my line of code here>
Object allocated at (most recent call last):
  File "/Users/ted/.local/share/virtualenvs/<my library snipped>/lib/python3.7/site-packages/oci/_vendor/urllib3/util/connection.py", lineno 68
    sock = socket.socket(af, socktype, proto)

I've traced the call back to this method by editing the vendored connection.py to throw an error. If I just add a self.session.close just before the return Response in this method, my code still works and the ResourceWarning no longer appears. I can't say if that's the correct place to close things, but I wanted to report the ugly-looking warning.

For reference, I am currently using oci==2.2.1.

response = self.session.request(

allow for a generic method to call an enpoint

Would like to have the ability to directly call rest methods.

client.call( 'rest method', 'service', 'uri', json, **args )
json is optional, used for put operations

client.call( 'GET', 'compute', '/instances/', retrieve_all=true )
*allow option to retrieve paged data

This allows developers to use methods that have not been added to the sdk

UpdateBackend for loadbalancer is not getting updated

i am doing the Backend Update for loadbalancer. with the method "update_backend"

update_backend(update_backend_details, load_balancer_id, backend_set_name, backend_name, **kwargs)

where as i am unable to update backend_name and it is not throwing any exceptions . will you please provide the solution as soon as possible

the headers are {'Date': 'Tue, 23 Apr 2019 11:01:24 GMT', 'Content-Type': 'application/json', 'Connection': 'keep-alive', 'opc-request-id': '9F83843A6F73490BB16B99B4D11C438B/EE374ADE6FABAACB5F278F2946733056/2C8DBC1C5AD27F37FF28B7B506B557D9', 'opc-work-request-id': 'ocid1.loadbalancerworkrequest.oc1.iad.aaaaaaaajegg2fjborr6zsek3cfoz7cmnl7bmhhwwne6hnfkpy7duvuoojcq', 'X-Content-Type-Options': 'nosniff'}
the status is 204
the data is None
the body is {"weight": 1, "backup": false, "drain": false, "offline": false}
the url is https://iaas.us-ashburn-1.oraclecloud.com/20170115/loadBalancers/ocid1.loadbalancer.oc1.iad.aaaaaaaaxl52xzxqafgzs7ynlnvntry6vgiiod23cfkgbgo7moez34wcsbia/backendSets/lb-20190416-1419-backend-set/backends/10.0.0.6%3A90
the request_id is 9F83843A6F73490BB16B99B4D11C438B/EE374ADE6FABAACB5F278F2946733056/2C8DBC1C5AD27F37FF28B7B506B557D9

Process finished with exit code 0

Instance Pools and Instance Configurations

Hi Dev,
In the release notes of 2.0.6 mentioned "Support for Instance Pools and Instance Configurations in the Compute service", but I could not find any API under ComputeClient for Instance configuration and instance pool
Can you please let me know what I missed ?
Thank you
Adi Zohar

oci.exceptions.RequestException When run python retrieve_audit_events.py

testing env:
$ uname -a
Linux miketest 4.8.14-300.fc25.x86_64 #1 SMP Mon Dec 12 16:31:04 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[mcao@miketest examples]$ python --version
Python 2.7.12
[mcao@miketest examples]$ pip list |grep oci
oci 2.0.6

$ python retrieve_audit_events.py
Traceback (most recent call last):
File "retrieve_audit_events.py", line 95, in
end_time)
File "retrieve_audit_events.py", line 54, in get_audit_events
end_time=end_time).data
File "/usr/lib/python2.7/site-packages/oci/pagination/pagination_utils.py", line 203, in list_call_get_all_results
for response in list_call_get_all_results_generator(list_func_ref, 'response', *list_func_args, **list_func_kwargs):
File "/usr/lib/python2.7/site-packages/oci/pagination/pagination_utils.py", line 271, in list_call_get_all_results_generator
call_result = retry.DEFAULT_RETRY_STRATEGY.make_retrying_call(list_func_ref, *list_func_args, **list_func_kwargs)
File "/usr/lib/python2.7/site-packages/oci/retry/retry.py", line 271, in make_retrying_call
return func_ref(*func_args, **func_kwargs)
File "/usr/lib/python2.7/site-packages/oci/audit/audit_client.py", line 229, in list_events
response_type="list[AuditEvent]")
File "/usr/lib/python2.7/site-packages/oci/base_client.py", line 221, in call_api
response = self.request(request)
File "/usr/lib/python2.7/site-packages/oci/base_client.py", line 332, in request
raise exceptions.RequestException(e)
oci.exceptions.RequestException: HTTPSConnectionPool(host='audit.us-asburn-1.oraclecloud.com', port=443): Max retries exceeded with url: /20160918/auditEvents?compartmentId=ocid1.tenancy.oc1..aaaaaaaaqrol7kkrruav76ou65we6n4yj646gdt554ssiecdpqorr4jnyz7a&endTime=2018-11-01T09%3A00%3A46.383604Z&startTime=2018-10-27T09%3A00%3A46.383604Z (Caused by NewConnectionError('<oci._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7c162abb10>: Failed to establish a new connection: [Errno -2] Name or service not known',))

Is audit.us-asburn-1.oraclecloud.com the right host to get the audit data? why my laptop can not parse the address?

objects size,time_created,md5 are showing null when using rest webserivce api

Hi, Pls check following code
namespace = object_storage_client.get_namespace().data
print object_storage_client.list_objects(namespace, buckets[2].name).data.objects

Here is my output:
[{
"md5": null,
"name": "1487902706.jpg",
"size": null,
"time_created": null
}, {
"md5": null,
"name": "48132889.jpg",
"size": null,
"time_created": null
}]

We can see md5, size ,time created are all none. I believe it is a bug in this api call. can you help to check this.

Need a supported mechanism for a streaming upload to object storage.

I'm writing a client to move our data from AWS S3 to BMCS Object Storage.

I ran into an issue with the underlying version of requests you have pinned. I'm able to get to the stream of the AWS download from their SDK, however in order for it to be handled correctly as a stream and not a file I had to do some wrapping of the stream object to "fool" requests into doing the right thing. This is due to their mechanism of inferring whether the object passed in is a file handle or a stream. My method relies in internal knowledge of the requests implementation and, having looked at the newer sources, I'm can see it will will definitely break when you move to a more recent version of requests.

I think it's a better idea to expose something in the BMCS SDK to explicitly indicate that it's being passed a stream object and then handle the calls to requests appropriately to assure it's handled correctly. If we discuss what you think it the appropriate interface and reach a design statement, I can submit a patch for your review to implement it.

upgrade cryptography to 2.0.3

Is it possible to upgrade the library cryptography 1.8.2 to cryptography 2.0.3 this since the updated version have installation support from many Linux devices and it would made easier to install in different environments easier.

AJ

On Ubuntu 16.04, pip3 install fails due to no openssl

This is not an issue with the SDK, of course, but it might be a useful tip for others running into this problem.

$ pip3 install oci
...
Building wheels for collected packages: cryptography
  Running setup.py bdist_wheel for cryptography ... error
...
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.linux-x86_64-3.5/_openssl.c:498:30: fatal error: openssl/opensslv.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
...

Just need to install openssl (sudo apt-get update && sudo apt-get install libssl-dev).

Missing unit from tests/unit

After copying the util.py file into tests/integ, I encountered this error which indicates that a file called "unit" is missing from "tests":

============================================================================ test session starts ============================================================================
platform darwin -- Python 2.7.13, pytest-3.0.2, py-1.4.34, pluggy-0.3.1
rootdir: /Users/kfields/oci-python-sdk, inifile:
plugins: catchlog-1.2.2

======================================================================= no tests ran in 0.00 seconds ========================================================================
ERROR: file not found: tests/unit
ERROR: InvocationError: '/Users/kfields/oci-python-sdk/.tox/py27/bin/py.test tests/unit tests/integ -s'
__________________________________________________________________________________ summary __________________________________________________________________________________
ERROR: py27: commands failed

Is there API call to audit user login/logout info.

Hi,
Referring to $subject.Is there is API call to audit user login/logout info?
I checked the https://github.com/oracle/oci-python-sdk/blob/master/examples/retrieve_audit_events.py ,the output of events are are related to user operations based on compartment.
I walk through https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/search.html?q=login&check_keywords=yes&area=default but no luck to find one.

So Is there a API function to get all user login/logout info based on tenancy?

Thanks in advance,
Mike

examples/stream_example.py not working

I am using Python 3.7.2. and trying the stream_examples.

When I am trying to publish sample messages this part:

key = "key" + str(i)
value = "value" + str(i)
encoded_key = base64.b64encode(key)
encoded_value = base64.b64encode(value)

Won't work as I can only base64 encode a bytes object. I can fix it with:

        encoded_key = base64.b64encode(key.encode('utf-8'))
        encoded_value = base64.b64encode(value.encode('utf-8'))

But it leads to the error:

Traceback (most recent call last):
File "C:/Users/xx/IdeaProjects/cloud-wuzzler-streeaming-agent/agent.py", line 151, in
publish_example_messages(stream_client, s_id)
File "C:/Users/xx/IdeaProjects/cloud-wuzzler-streeaming-agent/agent.py", line 43, in publish_example_messages
put_message_result = client.put_messages(stream_id, messages)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\streaming\stream_client.py", line 666, in put_messages
enforce_content_headers=False)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 208, in call_api
body = self.sanitize_for_serialization(body)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 465, in sanitize_for_serialization
sanitized_dict[key] = self.sanitize_for_serialization(val, value_declared_type, inner_field_name)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 428, in sanitize_for_serialization
for sub_obj in obj]
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 428, in
for sub_obj in obj]
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 465, in sanitize_for_serialization
sanitized_dict[key] = self.sanitize_for_serialization(val, value_declared_type, inner_field_name)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 417, in sanitize_for_serialization
self.raise_type_error_serializing_model(field_name, obj, declared_type)
File "C:\Users\xx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\oci\base_client.py", line 473, in raise_type_error_serializing_model
raise TypeError('Field {} with value {} was expected to be of type {} but was of type {}'.format(field_name, str(obj), declared_type, type(obj).name))
TypeError: Field messages[*].key with value b'a2V5MA==' was expected to be of type str but was of type bytes

It looks like sanitize_for_serialization in base_client does not allow bytes as type, but then how can we send a base64 encoded string?

ImportError: No module named idna

The latest release of Cryptography, version 2.5, stopped requiring idna. This uncovered an issue in the oci-python-sdk where idna is imported but is not part of the required packages for oci-python-sdk. If you receive an ImportError for idna, you can resolve it by upgrading to oci>=2.1.5 or running pip install idna in your virtual environment containing the oci package.

Here is an snippet from the stack trace for the import error.

File "/lib/python2.7/site-packages/oci/_vendor/urllib3/contrib/pyopenssl.py", line 171, in idna_encode
    import idna
ImportError: No module named idna

Testsuite fails because of missing sample configuration file

Trying to run the testsuite fails on multiple occasions because the sample configuration files tests/resources/config is missing:

(oci-python-sdk-env) glaubitz@suse-laptop:~/upstream/oci-python-sdk> tox
GLOB sdist-make: /home/glaubitz/upstream/oci-python-sdk/setup.py
py27 inst-nodeps: /home/glaubitz/upstream/oci-python-sdk/.tox/dist/oci-2.1.6.zip
py27 installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.,alabaster==0.7.12,asn1crypto==0.24.0,Babel==2.6.0,certifi==2018.11.29,cffi==1.11.5,chardet==3.0.4,configparser==3.5.0,contextlib2==0.5.5,coverage==4.4.1,cryptography==2.1.4,docutils==0.14,enum34==1.1.6,flake8==3.5.0,funcsigs==1.0.2,idna==2.8,imagesize==1.1.0,ipaddress==1.0.22,Jinja2==2.10,MarkupSafe==1.1.0,mccabe==0.6.1,mock==2.0.0,oci==2.1.6,pbr==5.1.2,pluggy==0.8.1,py==1.7.0,pycodestyle==2.3.1,pycparser==2.19,pyflakes==1.6.0,Pygments==2.3.1,pyOpenSSL==17.5.0,pytest==3.2.3,pytest-catchlog==1.2.2,pytest-cov==2.5.1,python-dateutil==2.7.3,pytz==2018.9,PyYAML==3.13,requests==2.21.0,six==1.12.0,snowballstemmer==1.2.1,Sphinx==1.6.4,sphinx-rtd-theme==0.2.5b2,sphinxcontrib-websupport==1.1.0,tox==2.9.1,typing==3.6.6,urllib3==1.24.1,vcrpy==1.11.1,virtualenv==16.3.0,wrapt==1.11.1
py27 runtests: PYTHONHASHSEED='1261293047'
py27 runtests: commands[0] | py.test tests/unit tests/integ -s
==================================================== test session starts ====================================================
platform linux2 -- Python 2.7.15, pytest-3.2.3, py-1.7.0, pluggy-0.4.0
rootdir: /home/glaubitz/upstream/oci-python-sdk, inifile:
plugins: cov-2.5.1, catchlog-1.2.2
collected 34 items                                                                                                           

tests/unit/test_basic_api_calls.py EEEEE
tests/unit/test_model.py .................
tests/unit/test_response.py ...
tests/unit/test_waiters.py EEEEEEEE
tests/integ/test_launch_instance_tutorial.py E

========================================================== ERRORS ===========================================================
________________________________________ ERROR at setup of test_identity_list_users _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________________ ERROR at setup of test_vcn_list_vcns ____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_vcn_list_instances _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_______________________________________________ ERROR at setup of test_limit ________________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________ ERROR at setup of test_api_call_with_explicit_timeout ___________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_____________________________________________ ERROR at setup of test_basic_wait _____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_invalid_operation __________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
__________________________________________ ERROR at setup of test_already_in_state __________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_wait_time_exceeded _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
________________________________ ERROR at setup of test_property_and_eval_function_provided _________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
________________________________________ ERROR at setup of test_eval_function_lambda ________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
_______________________________________ ERROR at setup of test_eval_function_func_ref _______________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________________ ERROR at setup of test_callback_func ____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
______________________________________________ ERROR at setup of test_tutorial ______________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py27/lib/python2.7/site-packages/oci/config.py:77: ConfigFileNotFound
============================================ 20 passed, 14 error in 0.83 seconds ============================================
ERROR: InvocationError: '/home/glaubitz/upstream/oci-python-sdk/.tox/py27/bin/py.test tests/unit tests/integ -s'
py37 create: /home/glaubitz/upstream/oci-python-sdk/.tox/py37
py37 installdeps: -r/home/glaubitz/upstream/oci-python-sdk/requirements.txt
py37 inst: /home/glaubitz/upstream/oci-python-sdk/.tox/dist/oci-2.1.6.zip
py37 installed: alabaster==0.7.12,asn1crypto==0.24.0,Babel==2.6.0,certifi==2018.11.29,cffi==1.11.5,chardet==3.0.4,configparser==3.5.0,coverage==4.4.1,cryptography==2.1.4,docutils==0.14,flake8==3.5.0,idna==2.8,imagesize==1.1.0,Jinja2==2.10,MarkupSafe==1.1.0,mccabe==0.6.1,mock==2.0.0,oci==2.1.6,pbr==5.1.2,pluggy==0.8.1,py==1.7.0,pycodestyle==2.3.1,pycparser==2.19,pyflakes==1.6.0,Pygments==2.3.1,pyOpenSSL==17.5.0,pytest==3.2.3,pytest-catchlog==1.2.2,pytest-cov==2.5.1,python-dateutil==2.7.3,pytz==2018.9,PyYAML==3.13,requests==2.21.0,six==1.12.0,snowballstemmer==1.2.1,Sphinx==1.6.4,sphinx-rtd-theme==0.2.5b2,sphinxcontrib-websupport==1.1.0,tox==2.9.1,urllib3==1.24.1,vcrpy==1.11.1,virtualenv==16.3.0,wrapt==1.11.1
py37 runtests: PYTHONHASHSEED='1261293047'
py37 runtests: commands[0] | py.test tests/unit tests/integ -s
==================================================== test session starts ====================================================
platform linux -- Python 3.7.2, pytest-3.2.3, py-1.7.0, pluggy-0.4.0
rootdir: /home/glaubitz/upstream/oci-python-sdk, inifile:
plugins: cov-2.5.1, catchlog-1.2.2
collected 34 items                                                                                                           

tests/unit/test_basic_api_calls.py EEEEE
tests/unit/test_model.py .................
tests/unit/test_response.py ...
tests/unit/test_waiters.py EEEEEEEE
tests/integ/test_launch_instance_tutorial.py E

========================================================== ERRORS ===========================================================
________________________________________ ERROR at setup of test_identity_list_users _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________________ ERROR at setup of test_vcn_list_vcns ____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_vcn_list_instances _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_______________________________________________ ERROR at setup of test_limit ________________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________ ERROR at setup of test_api_call_with_explicit_timeout ___________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_____________________________________________ ERROR at setup of test_basic_wait _____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_invalid_operation __________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
__________________________________________ ERROR at setup of test_already_in_state __________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_________________________________________ ERROR at setup of test_wait_time_exceeded _________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
________________________________ ERROR at setup of test_property_and_eval_function_provided _________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
________________________________________ ERROR at setup of test_eval_function_lambda ________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
_______________________________________ ERROR at setup of test_eval_function_func_ref _______________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config'

    @pytest.fixture
    def identity(config_file):
        # Identity throws an error if we do things from not our home region (currently PHX). So use the default profile here, regardless
        # of any command line switches, under the tacit assumption that the default profile points to our home region
>       client = oci.identity.IdentityClient(config(config_file, oci.config.DEFAULT_PROFILE))

tests/conftest.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:39: in config
    config = oci.config.from_file(file_location=config_file, profile_name=config_profile)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
___________________________________________ ERROR at setup of test_callback_func ____________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
______________________________________________ ERROR at setup of test_tutorial ______________________________________________

config_file = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', config_profile = 'DEFAULT'

    @pytest.fixture(scope="session")
    def config(config_file, config_profile):
>       config = oci.config.from_file(file_location=config_file, profile_name=config_profile)

tests/conftest.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_location = '/home/glaubitz/upstream/oci-python-sdk/tests/resources/config', profile_name = 'DEFAULT'

    def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):
        """Create a config dict from a file.
    
        :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback to ~/.oraclebmc/config.
        :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
        :return: A config dict that can be used to create clients.
        """
        expanded_file_location = _get_config_path_with_fallback(file_location)
    
        parser = configparser.ConfigParser(interpolation=None)
        if not parser.read(expanded_file_location):
>           raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location))
E           oci.exceptions.ConfigFileNotFound: Could not find config file at /home/glaubitz/upstream/oci-python-sdk/tests/resources/config

.tox/py37/lib/python3.7/site-packages/oci/config.py:77: ConfigFileNotFound
============================================ 20 passed, 14 error in 0.81 seconds ============================================
ERROR: InvocationError: '/home/glaubitz/upstream/oci-python-sdk/.tox/py37/bin/py.test tests/unit tests/integ -s'
flake8 inst-nodeps: /home/glaubitz/upstream/oci-python-sdk/.tox/dist/oci-2.1.6.zip
flake8 installed: asn1crypto==0.24.0,certifi==2018.11.29,cffi==1.11.5,configparser==3.7.1,cryptography==2.5,entrypoints==0.3,flake8==3.7.5,mccabe==0.6.1,oci==2.1.6,pycodestyle==2.5.0,pycparser==2.19,pyflakes==2.1.0,pyOpenSSL==19.0.0,python-dateutil==2.7.3,pytz==2018.9,six==1.12.0
flake8 runtests: PYTHONHASHSEED='1261293047'
flake8 runtests: commands[0] | flake8 src docs tests examples
__________________________________________________________ summary __________________________________________________________
ERROR:   py27: commands failed
ERROR:   py37: commands failed
  flake8: commands succeeded
(oci-python-sdk-env) glaubitz@suse-laptop:~/upstream/oci-python-sdk>

Apache libcloud support?

Now that there's a Python SDK, any chance that it'll be used to build BMCS providers for Apache libcloud? Compute & Object Storage services would be of particular interest.

OCI Search Client : Call multiple functions at one go : Suggest best search model with sample example

currently i am coding on search functionality using python SDK
https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/resource_search.html

I need your suggestion to get best model to use to get search results

below is my current code where i am doing two calls 1 ) to get instance data 2 ) get subnet level information
which is using Free Text search
Is there a way i can get both these calls at one go ?

  1. call : singleInstanceData = compute_client.get_instance(value).data
  2. call : singleInstanceSubnetDataDict = get_instance_ip_addresses_and_dns_info(compute_client, virtual_network_client, identity_client, value, config)
    It is working but a performance hit as i am using Free Text Search
    I want both calls to be done at one go.

I used some of the functionality shown here -
https://github.com/oracle/oci-python-sdk/blob/master/examples/get_all_instance_ip_addresses_and_dns_info.py

Below is my code snippet for reference.

def search(input_text) :
free_text_search = oci.resource_search.models.FreeTextSearchDetails(text=input_text,
type='FreeText',
matching_context_type=oci.resource_search.models.SearchDetails.MATCHING_CONTEXT_TYPE_HIGHLIGHTS)
data = {}
data['searchresults'] = []
multiInstanceDataList = []
singleInstanceDict = {}

compute_client = oci.core.ComputeClient(config)
virtual_network_client = oci.core.VirtualNetworkClient(config)
identity_client = oci.identity.IdentityClient(config)
account=json.loads(str(identity_client.get_compartment(compartment_id).data)).get('name')
print account
instance_Info={}


for response in oci.pagination.list_call_get_all_results_generator(search_client.search_resources, 'response', free_text_search):
        for resource in response.data.items:
            print("Resource type: {}, Resource name: {}".format(resource.resource_type, resource.identifier))
            data['searchresults'].append({str(resource.resource_type):str(resource.identifier)})


for iterable in data['searchresults']:
    for key, value in iterable.items():
        print('{}: {}'.format(key, value))
        if key == "Instance":
            singleInstanceData = compute_client.get_instance(value).data
            #print singleInstanceDataJson

            .......
            ........

            singleInstanceSubnetDataDict = get_instance_ip_addresses_and_dns_info(compute_client, virtual_network_client, identity_client, value, config)
            print singleInstanceSubnetDataDict

            
            .........
            .........



            #print singleInstanceDict
            if singleInstanceDict.copy() not in multiInstanceDataList:
                multiInstanceDataList.append(singleInstanceDict.copy())


#print("******************************")
#print(multiInstanceDataList[0].values())
#print("finalllllll******************************")
print multiInstanceDataList
return multiInstanceDataList

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.