Using python to add new hosts?

I am trying to add a new host using python with rancher api.

I get a response 400, and the this what I see in the web ui:

Error setting machine configuration from flags provided: generic driver requires the --generic-ip-address option

Any idea why?
Here is the code:

import requests

headers = {‘Content-Type’: ‘application/json’}
data = { “authKey”: ‘null’,
“labels”: {},
“engineInstallUrl”: “”,
“engineStorageDriver”: ‘null’,
{ “ipAddress”:”,
“sshKey”: ‘’,
“sshPort”: “22”,
“sshUser”: “root”
“description”: “Docker Hosting client.”,
“authCertificateAuthority”: ‘null’,
“name”: “newlocalhost”,
“dockerVersion”: ‘null’
}‘’, auth=(‘xxxxxx’,‘yyyy’), headers=headers, data=data)

I haven’t tried to run it or anything but the request object seems OK.

Some of the details don’t make sense though, validation errors return 422, and any 4xx error would result in no entry going into the database, which would mean no machine entry, call to docker-machine, or error response from that…