-
Notifications
You must be signed in to change notification settings - Fork 27
File downloads not working #17
Comments
Thanks! I would appreciate any help, thanks! |
Hello, This also works changing mode=text I have no tried to download drawings. I could upload the step using the online application. But my problem is that I can't upload any step using the API |
This is fixed... see this test, for instance: https://github.com/onshape-public/onshape-clients/blob/master/python/test/test_export.py#L6 |
Hollo Ethan,
Now when I upload a file, I get this warning:
/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cad.onshape.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,
Please, can you tell-me what can I do to remove this warning?
Thank you.
Víctor Naranjo
protoandgo
… El 10 mar 2020, a las 16:43, Ethan Keller ***@***.***> escribió:
Closed #17 <#17>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#17?email_source=notifications&email_token=AG5ZTO3MGVHDADMGPBVDLMDRGZN3BA5CNFSM4KLHUWQ2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOXGXZWGY#event-3115293467>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AG5ZTO54KSSPZIEWVAQDYITRGZN3BANCNFSM4KLHUWQQ>.
|
Hello Ethan,
Before solve the upload file issue, I was using another client and I could generate images with shaded_view. Then, to solve the import issue, I am using the client that you told me.
Now the problem is that I can’t generate images with the shaded views of the new client. When I try to get the shaded_views, I get this error:
arning: Unverified HTTPS request is being made to host 'cad.onshape.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,
Traceback (most recent call last):
File "/Users/woocomerce/repos/proto-data-batch/uploadParts.py", line 58, in <module>
getFace('top')
File "/Users/woocomerce/repos/proto-data-batch/uploadParts.py", line 51, in getFace
response = Client.get_client().part_studios_api.get_part_studio_shaded_views(did, wvm, wvmid, eid, view_matrix='top')
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 4105, in __call__
return self.callable(self, *args, **kwargs)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 2634, in __get_part_studio_shaded_views
return self.call_with_http_info(**kwargs)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 4175, in call_with_http_info
collection_formats=params['collection_format'])
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 345, in call_api
_check_type)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 189, in __call_api
_check_type
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 280, in deserialize
configuration=self.configuration
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1065, in validate_and_convert_types
must_convert=True
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1003, in attempt_convert_item
raise conversion_exc
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 996, in attempt_convert_item
configuration, from_server)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 877, in deserialize_model
instance = used_model_class(**kw_args)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/models/bt_shaded_views_info.py", line 128, in __init__
setattr(self, var_name, var_value)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 198, in __setattr__
self.set_attribute(name, value)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 90, in set_attribute
self._check_type, configuration=self._configuration)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1112, in validate_and_convert_types
configuration=configuration
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1065, in validate_and_convert_types
must_convert=True
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 990, in attempt_convert_item
key_type=key_type)
onshape_client.oas.exceptions.ApiTypeError: Invalid type for variable '0'. Required value type is list and passed type was str at ['received_data']['images'][0]
And this is part of the response:
"images":["iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAgAElEQVR4nO3dXcxlV10/8N/0FcYhD4nUibGDhbRjI4xpZ2xSS4bWSk0tCTqEmGDrnTeaEBNiQqsmGIxWb7jUeKEJtfWCcAFcNE0ppCBvCTBMOiQOtCHaygU0Gh8ZB0rpnP+Fnub8D/tlrb3X3mfv/Xw+yeScs/baa+3nFM53/9be53kiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgQId2fQAku7zrA2ASxv7/7Grk+ZimK3Z9ALQT6PNw+Q//8A8Pvfa1r931cUzaoUPj/M85d56m/nXbqtq32zZf121rGifnsen59nFU/Wva1vTviiuuSN6+fn7FFVe8Ot9mW1Wf7faqvnXtddub+lT1n7r//M//jOPHj69CqE/eVbs+ANK89rWvjcOHD+/6MCZNoKc9LxXkm8/7BndbiKeEZ
I think that the request is doing well, but there is somewhere in the client code that is expecting another format of the request…
Please, can you help me with that?
Thank you
… El 10 mar 2020, a las 16:43, Ethan Keller ***@***.***> escribió:
Closed #17 <#17>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#17?email_source=notifications&email_token=AG5ZTO3MGVHDADMGPBVDLMDRGZN3BA5CNFSM4KLHUWQ2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOXGXZWGY#event-3115293467>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AG5ZTO54KSSPZIEWVAQDYITRGZN3BANCNFSM4KLHUWQQ>.
|
Correction of the previous email (at end of this one). In theist word, I wanted to say response instead of request: the python client crash while checking the response obtained
… El 11 mar 2020, a las 14:20, Victor Naranjo Rubio ***@***.***> escribió:
Hello Ethan,
Before solve the upload file issue, I was using another client and I could generate images with shaded_view. Then, to solve the import issue, I am using the client that you told me.
Now the problem is that I can’t generate images with the shaded views of the new client. When I try to get the shaded_views, I get this error:
arning: Unverified HTTPS request is being made to host 'cad.onshape.com <http://cad.onshape.com/>'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings <https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings>
InsecureRequestWarning,
Traceback (most recent call last):
File "/Users/woocomerce/repos/proto-data-batch/uploadParts.py", line 58, in <module>
getFace('top')
File "/Users/woocomerce/repos/proto-data-batch/uploadParts.py", line 51, in getFace
response = Client.get_client().part_studios_api.get_part_studio_shaded_views(did, wvm, wvmid, eid, view_matrix='top')
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 4105, in __call__
return self.callable(self, *args, **kwargs)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 2634, in __get_part_studio_shaded_views
return self.call_with_http_info(**kwargs)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api/part_studios_api.py", line 4175, in call_with_http_info
collection_formats=params['collection_format'])
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 345, in call_api
_check_type)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 189, in __call_api
_check_type
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/api_client.py", line 280, in deserialize
configuration=self.configuration
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1065, in validate_and_convert_types
must_convert=True
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1003, in attempt_convert_item
raise conversion_exc
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 996, in attempt_convert_item
configuration, from_server)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 877, in deserialize_model
instance = used_model_class(**kw_args)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/models/bt_shaded_views_info.py", line 128, in __init__
setattr(self, var_name, var_value)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 198, in __setattr__
self.set_attribute(name, value)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 90, in set_attribute
self._check_type, configuration=self._configuration)
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1112, in validate_and_convert_types
configuration=configuration
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 1065, in validate_and_convert_types
must_convert=True
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/model_utils.py", line 990, in attempt_convert_item
key_type=key_type)
onshape_client.oas.exceptions.ApiTypeError: Invalid type for variable '0'. Required value type is list and passed type was str at ['received_data']['images'][0]
And this is part of the response:
"images":["iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAgAElEQVR4nO3dXcxlV10/8N/0FcYhD4nUibGDhbRjI4xpZ2xSS4bWSk0tCTqEmGDrnTeaEBNiQqsmGIxWb7jUeKEJtfWCcAFcNE0ppCBvCTBMOiQOtCHaygU0Gh8ZB0rpnP+Fnub8D/tlrb3X3mfv/Xw+yeScs/baa+3nFM53/9be53kiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgQId2fQAku7zrA2ASxv7/7Grk+ZimK3Z9ALQT6PNw+Q//8A8Pvfa1r931cUzaoUPj/M85d56m/nXbqtq32zZf121rGifnsen59nFU/Wva1vTviiuuSN6+fn7FFVe8Ot9mW1Wf7faqvnXtddub+lT1n7r//M//jOPHj69CqE/eVbs+ANK89rWvjcOHD+/6MCZNoKc9LxXkm8/7BndbiKeEZ
I think that the request is doing well, but there is somewhere in the client code that is expecting another format of the response
Please, can you help me with that?
Thank you
> El 10 mar 2020, a las 16:43, Ethan Keller ***@***.*** ***@***.***>> escribió:
>
> Closed #17 <#17>.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <#17?email_source=notifications&email_token=AG5ZTO3MGVHDADMGPBVDLMDRGZN3BA5CNFSM4KLHUWQ2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOXGXZWGY#event-3115293467>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AG5ZTO54KSSPZIEWVAQDYITRGZN3BANCNFSM4KLHUWQQ>.
>
|
Hi Victor, The client code looks like it still needs a little tweaking in what it expects for the response. I'm working on that, but in the meantime, you can just pass in _preload_content=False to the endpoint call and the client won't attempt to deserialize the response. Also, as for the 'unverified' warning, that is just saying urlib doesn't have a mechanism to verify the ssl request, and you need to install one by doing something like this: https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl |
Ok Ethan, thank you. The first issue is solved with in _preload_content=False. But for the second one I've been trying https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl. But I don't know how to apply it to the client library. Do I have to modify the source code of the library? or can I set any static or singleton parameter to enable that mechanism of verification? Is it posible to disable it too? The problem is that I don't know where do I have to apply this in the client code: urllib3.PoolManager(cert_reqs='CERT_REQUIRED',ca_certs=certifi.where()) |
Hello Ethan, with the first examples of api calls that I downloaded from Git hub it was so easy to connect. Now, since I am using the onshape_clientes 0.36, everything becomes more difficult, and I can not reuse the tests that I did before. The problem that I have now is that I can't create a new document. The client asks me for a parameter: BTDocumentParameters(). I've trying to initialize BTDocumentParameters with no arguments, as I have seen in DocumentsApi.md:
but I get this invalid empty argument error: File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/rest.py", line 268, in request The only think that I need is to create a new document. Please, can you tell me what is the missing parameter the I am not writing for BTDocumentParams? Thank you |
done: bt_document_params=BTDocumentParams( |
You can request SSL certification through the configuration object: https://github.com/onshape-public/onshape-clients/blob/master/python/onshape_client/oas/rest.py#L64 . And that is actually set by default here to false: https://github.com/onshape-public/onshape-clients/blob/master/python/onshape_client/client.py#L198 . So for right now, you can't override that setting. I'll put that on the list of things to change for the next version. Thanks for pointing this out! For now, are you OK with making the unverified requests? |
yes, ok |
Apparently STEP and ShadedViews file downloads are not working.
The text was updated successfully, but these errors were encountered: