I am trying to use the SoftLayer API Rest method to update a user VPN password but having no luck. I must be structuring my call incorrectly and was hoping someone had a working example or input on why my call is failing. I've tried many ways but with no luck. The api user I am using has the needed priv level, my key is valid (works on other methods etc..) My method is:
def set_user_vpn_password(self):
''' method to set a user's vpn password '''
myPass = { "password" : "P@s$w0rd!?" }
r = requests.post('https://<priv api account>:<api key>@api.softlayer.com/rest/v3/SoftLayer_User_Customer/<softlayer uid>/updateVpnPassword', json=myPass)
print(r.text)
pp(r)
pp(r.json())
The resulting error is:
{"error":"ERR_USER_CUSTOMER_PASSWORD_COMPLEXITY_FAILED","code":"SoftLayer_Exception"}
<Response [500]>
{u'code': u'SoftLayer_Exception',
u'error': u'ERR_USER_CUSTOMER_PASSWORD_COMPLEXITY_FAILED'}
I don't believe I missed anything on my password policy with regard to complexity - I've tried different strings to no avail. As you can see I am using the Python requests module.
The password policy regarding the complexity is Ok. The problem is that SoftLayer uses this kind of body in the requests:
Sometimes the request requires an object or an integer or a string such in this case, so the correct REST request would be:
Here a python example using SoftLayer python client: