original_docstring:  Create an instance over Nova using HTTP API. 
docstring: Create an instance over Nova using HTTP API.
docstring_tokens: Create an instance over Nova using HTTP API .
code: 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)
code_tokens: def create_server ( initial_wait = 120 ) : 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 )
short_docstring: Create an instance over Nova using HTTP API.
short_docstring_tokens: Create an instance over Nova using HTTP API .
comment: """ Create an instance over Nova using HTTP API. """