Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Create an instance over Nova using HTTP API. 

        def create_server(initial_wait=120):
    """ Create an instance over Nova using HTTP API. """
    rax_config = load_configurations()
    auth_token = get_auth_token(rax_config["username"], rax_config["api_key"], rax_config["identity_url"])
    print("Auth Token: %s" % auth_token)

    url = "%s" % rax_config["cloud_url"] + "%s/servers" % rax_config["tenant_id"]
    headers = {"X-Auth-Token": auth_token}
    body = """{
                "server": {
                    "imageRef": "%(image_id)s",
                    "flavorRef": "%(flavor_id)s",
                    "name": "%(server_name)s"
                    }
                }""" % rax_config
    resp = _http_requests_json(url, headers, body)

    admin_pass = resp["server"]["adminPass"]
    server_id = resp["server"]["id"]
    server_url = resp["server"]["links"][0]["href"]
    print("Server Details\nID:%s\nURL: %s" % (server_url, server_id))
    print("Initial wait time to get server status: %s sec" % initial_wait)

    time.sleep(initial_wait)
    resp = wait_server_to_active(server_url, auth_token)
    print(resp)
    ipv4 = resp["server"]["accessIPv4"]
    print("IPv4 : %s" % ipv4)
    return create_configfile(ipv4, admin_pass)
        


src/o/p/openstack-guest-agents-unix-HEAD/tools/ci/agent_test_runner.py   openstack-guest-agents-unix(Download)
def load_config():
    fabfile = server_creator.create_server(120)
    config = RawConfigParser()
    config.read(os.path.join(os.getcwd(), fabfile))
    hosts = config.get('credentials', 'ipv4')