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)