'Convert the request into a node Node'

def _to_node(self, node, headers=None):

    nested = {'props': node['properties'], 'metadata': node['metadata'], 'entities': node['entities']}
    extra = {}
    MAPPED_ATTRS = {'props': {'name': 'name', 'availabilityZone': 'availability_zone', 'bootCdrom': 'boot_cdrom', 'bootVolume': 'boot_volume', 'cores': 'cores', 'cpuFamily': 'cpu_family', 'ram': 'ram', 'vmState': 'vm_state'}, 'metadata': {'createdDate': 'created_date', 'createdBy': 'created_by', 'etag': 'etag', 'lastModifiedBy': 'last_modified_by', 'lastModifiedDate': 'last_modified_date', 'state': 'state'}}
    for (k, v) in MAPPED_ATTRS.items():
        for (original_name, altered_name) in v.items():
            extra[altered_name] = nested[k][original_name]
    if (headers is not None):
        if ('location' in headers):
            extra['status_url'] = headers['location']
    state = self.NODE_STATE_MAP.get(node['properties']['vmState'], NodeState.UNKNOWN)
    extra['entities'] = nested['entities']
    extra['href'] = node['href']
    public_ips = []
    private_ips = []
    if ('nics' in nested['entities']):
        if ('items' in nested['entities']['nics']):
            for nic in nested['entities']['nics']['items']:
                if (nic['properties']['nat'] is True):
                    public_ips += nic['properties']['ips']
                elif (nic['properties']['nat'] is False):
                    private_ips += nic['properties']['ips']
    return Node(id=node['id'], name=nested['props']['name'], state=state, public_ips=public_ips, private_ips=private_ips, driver=self.connection.driver, extra=extra)
