getPrivateNetworkVrfs" is not a valid method for this service - python

We are trying to use the method getPrivateNetworkVrfs() found in the doc
http://sldn.softlayer.com/reference/services/SoftLayer_Account. But we are getting error like
client.call('SoftLayer_Account', 'getPrivateNetworkVrfs')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/SoftLayer/API.py", line 237, in call
return self.transport(request)
File "/usr/local/lib/python2.7/site-packages/SoftLayer/transports.py", line 187, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(Client): Function ("getPrivateNetworkVrfs") is not a valid method for this service.
But we are able to use method like "getNetworkVlanSpan" successfully
Please let us know, whether we are missing anything here?
Thanks

Unfortunately, the SoftLayer_Account::getPrivateNetworkVrfs method is deprecated, if you would like to check or get this kind of information, you need to submit a ticket
Related Forum:
Is there an API to check whether an account has VRF or not?

Related

(Python) ColabTurtle requires has initializeturtle() error, but we already used it

code:
import ColabTurtle.Turtle as tutel
tutel.initializeTurtle()
tutel.forward(10)
error is:
<IPython.core.display.HTML object>
Traceback (most recent call last):
File "f:\stuff\e.py", line 3, in <module>
tutel.forward(10)
File "C:\Users\U.S.E.R\AppData\Local\Programs\Python\Python311\Lib\site-packages\ColabTurtle\Turtle.py", line 174, in forward
_moveToNewPosition(ending_point)
File "C:\Users\U.S.E.R\AppData\Local\Programs\Python\Python311\Lib\site-packages\ColabTurtle\Turtle.py", line 163, in _moveToNewPosition
_updateDrawing()
File "C:\Users\U.S.E.R\AppData\Local\Programs\Python\Python311\Lib\site-packages\ColabTurtle\Turtle.py", line 144, in _updateDrawing
raise AttributeError("Display has not been initialized yet. Call initializeTurtle() before using.")
AttributeError: Display has not been initialized yet. Call initializeTurtle() before using.
basically, it tells me to use intializeturtle() before running a ColabTurtle function. Except, i did already use it.
Help.
Try to run it in Google Collab. If there will be no module ColabTurtle, you need to create a new code (+code) and write
!pip install ColabTurtle

python skype groupchat GET response error

I'm getting error in trying to communicate in a group chat via skype.
Traceback (most recent call last):
File "C:\Program Files\Python\Python38-32\ga.py", line 12, in
skc.recent()
File "C:\Program Files\Python\Python38-32\lib\site-packages\skpy\chat.py", line 452, in recent
info = self.skype.conn("GET", "{0}/threads/{1}".format(self.skype.conn.msgsHost, json.get("id")),
File "C:\Program Files\Python\Python38-32\lib\site-packages\skpy\conn.py", line 219, in call
raise SkypeApiException("{0} response from {1} {2}".format(resp.status_code, method, url), resp)
skpy.core.SkypeApiException: ('404 response from GET https://azwus1-client-s.gateway.messenger.live.com/v1/threads/19:*********************', )
[Finished in 7.483s]
I'm just trying to test to send a simple chat to a groupchat but I'm not sure what is causing this error.
currently using this code
ch = sk.chats["19:***********************#thread.skype"] //due to privacy issue, i cant display the id
ch.sendMsg("testing")
whereas if I use the code this way for creating a new conversation,
ch = sk.contacts["live#123"].chat
ch.sendMsg("testing")
it will work.
Can someone enlighten me what is the issue with it? really appreciate a lot.

Connect Python to Bonsai

I am trying to connect to Bonsai using Python and for this I am using the code provided by Bonsai here. However, my code breaks at
bonsai = os.environ['https://username:password#app-testing-3106893156.eu-central-1.bonsaisearch.net:443']
with error
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python3.7/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'https://username:password#app-testing-3106893156.eu-central-1.bonsaisearch.net:443'
I am using the exact same code Bonsai provides and I am only adding the Full Access URL also provided by Bonsai so I have no idea how to proceed with this. Any ideas what is causing the error?
You have to set environment variable first. example
export BONSAI_URL='https://username:password#app-testing-3106893156.eu-central-1.bonsaisearch.net:443'
and then use it in code like
bonsai = os.environ['BONSAI_URL']
Check How to set environment variables in Python

Python browser.submit() not working

When i am doing browser.submit() ,its showing this error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", line 541, in submit
return self.open(self.click(*args, **kwds))
File "/usr/local/lib/python2.7/dist-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", line 528, in click
if not self.viewing_html():
File "/usr/local/lib/python2.7/dist-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", line 443, in viewing_html
raise BrowserStateError("not viewing any document")
mechanize._mechanize.BrowserStateError: not viewing any document
one of the reason i can think of is when i am printing browser.form
then its showing
-form-urlencoded
<TextControl(username)>
<PasswordControl(password)>
<HiddenControl(AUTH_STATE=08539313-ae8d-4133-ba21-247a90668ccb) (readonly)>
<SubmitButtonControl(<None>=) (readonly)>>
may be its because its showing none in SubmitButtonControl. Can anyone suggest how can i solve this issue.
In html submit button's code is
login
how to resolve this ?
The issue is you aren't getting ANY response to the browser.submit() because the SubmitButtonControl is set to None i believe. Here is what I would do first:
select the form via br.select_form(nr=WHATEVER)
then use
for control in br.form.controls:
print control.name
to see if it will print out some identifier.
Your goal is to manually assign the control a value by selecting the control like so...
browser.form['controlname']='login'
browser.urlopen(form.click())
If you can't select the control then just try the browser.urlopen(form.click()) option instead of browser.submit()
Let me know how it works out.

How to get active tab url from browser?

How do I get URL from current tab in browser using python? Using os.environ['REQUEST_URI'] gives an error.
The following is my code :
os.environ['REQUEST_URI']
and the error :
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
os.environ["REQUEST_URI"]
File "C:\Python27\lib\os.py", line 423, in __getitem__
return self.data[key.upper()]
KeyError: 'REQUEST_URI'
Any other alternatives are also welcome.
Alternate to your asked way by "os.environ", you can do it:
by copy and past by hand
on other ways than you asked way by python
by Brotab
by Selenium
by xdotool
by javascript from serversite or by code injection from client side

Categories

Resources