Fetch the Cloudstack API Client
(config_file='datacenterCfg')
| 201 | |
| 202 | |
| 203 | def fetch_api_client(config_file='datacenterCfg'): |
| 204 | """Fetch the Cloudstack API Client""" |
| 205 | config = marvin.configGenerator.get_setup_config(config_file) |
| 206 | mgt = config.mgtSvr[0] |
| 207 | testClientLogger = logging.getLogger("testClient") |
| 208 | asyncTimeout = 3600 |
| 209 | return cloudstackAPIClient.CloudStackAPIClient( |
| 210 | marvin.cloudstackConnection.cloudConnection( |
| 211 | mgt, |
| 212 | asyncTimeout, |
| 213 | testClientLogger |
| 214 | ) |
| 215 | ) |
| 216 | |
| 217 | def get_host_credentials(config, hostip): |
| 218 | """Get login information for a host `hostip` (ipv4) from marvin's `config` |