Hi, I hope someone can help... I am running on solaris and access the 3par via wsapi only. I have a python script to automate the process of creating oracle databases on Solaris, however the createVLUN doesn't work. The script map.py is:
import sys, requests, json headers = { 'Content-Type': 'application/json', } data = '{"user":"XXXXX", "password":"YYYYY"}' response = requests.post('https://10.13.9.154:8080/api/v1/credentials', headers=headers, data=data, verify=False) key = json.loads(response.text)['key']
vset = sys.argv[1] host = sys.argv[2] headers = {'X-HP3PAR-WSAPI-SessionKey':key, 'Content-Type':'application/json' } pydata = { "volumeName":"set:" + vset, "hostname":host, "autoLun":True, } data = json.dumps(pydata) r = requests.post('https://10.13.9.154:8080/api/v1/vluns', headers=headers, data=data, verify=False) result = r.status_code print(result)
j = json.loads(r.text) print(j)
When run with: python -W ignore map.py <vset name> <host_name>
returns: 400 {u'code': 40, u'ref': u'lun', u'desc': u'invalid input: some or all required parameters are missing'}
Anyone with an idea? By using autoLun, I shouldn't need to supply a Lunid.
/Richard
|