Error ovh
Closed this issue · 7 comments
Hi.
plz help fixed.
Traceback (most recent call last):
File "C:\Users\1\Desktop\2.py", line 18, in
result = client.post("/auth/credential",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\ovh\client.py", line 385, in post
return self.call("POST", _target, kwargs, _need_auth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\ovh\client.py", line 465, in call
raise BadParametersError(json_result.get("message"), response=result)
ovh.exceptions.BadParametersError: Body parameter accessRules isn't formated correctly
OVH-Query-ID: EU.ext-2.64415cf2.40437.b4d78937-363f-44a4-aa8c-ba3793266eec
Hi there,
Can you please give us some data?
What version of the wrapper are you using?
Can you show us some code?
windows 10 x64
python 11
import ovh
create a client
client = ovh.Client()
copy file ovh.conf to C:\Python311\Lib\site-packages\ovh\
Grab bill list
bills = client.get('/me/bill')
for bill in bills:
details = client.get('/me/bill/%s' % bill)
print("%12s (%s): %10s --> %s" % (
bill,
details['date'],
details['priceWithTax']['text'],
details['pdfUrl'],
))
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\ovh\client.py", line 160, in init
self._endpoint = ENDPOINTS[endpoint]
~~~~~~~~~^^^^^^^^^^
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\1\Desktop\2.py", line 3, in
client = ovh.Client()
^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\ovh\client.py", line 162, in init
raise InvalidRegion("Unknown endpoint %s. Valid endpoints: %s", endpoint, ENDPOINTS.keys())
ovh.exceptions.InvalidRegion: ('Unknown endpoint %s. Valid endpoints: %s', None, dict_keys(['ovh-eu', 'ovh-us', 'ovh-ca', 'kimsufi-eu', 'kimsufi-ca', 'soyoustart-eu', 'soyoustart-ca']))
OK fixed.
client = ovh.Client(config_file='C:/Python311/Lib/site-packages/ovh/ovh.conf')
Why Error :
import json
import ovh
client = ovh.Client(config_file='C:/Python311/Lib/site-packages/ovh/ovh.conf')
result = client.get('/allDom/{serviceName}')
Pretty print
print json.dumps(result, indent=4)
File "C:\Users\1\Desktop\2.py", line 9
print json.dumps(result, indent=4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
Hi,
You'll find a lot of resources on the Internet regarding this kind of error. Here is one: https://stackoverflow.com/a/32124420.
I'll close this ticket, as there is no issue to raise with python-ovh
itself.