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:

#!/bin/python
import requests

headers = {‘Content-Type’: ‘application/json’}
data = { “authKey”: ‘null’,
“labels”: {},
“engineInstallUrl”: “https://get.docker.com”,
“engineStorageDriver”: ‘null’,
“genericConfig”:
{ “ipAddress”:
newlocalhost.example.com”,
“sshKey”: ‘’,
“sshPort”: “22”,
“sshUser”: “root”
},
“description”: “Docker Hosting client.”,
“authCertificateAuthority”: ‘null’,
“name”: “newlocalhost”,
“dockerVersion”: ‘null’
}
requests.post(‘http://rancher.example.com:8080/v1/projects/1a5/machines’, 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…