

def ex_node_set_save_name(self, node, name):
    '\n        Build action representation and instruct node to commit action.\n\n        Build action representation from the compute node ID, the disk image\n        which will be saved, and the name under which the image will be saved\n        upon shutting down the compute node.\n\n        :param node: Compute node instance.\n        :type  node: :class:`Node`\n\n        :param name: Name under which the image should be saved after shutting\n                     down the compute node.\n        :type  name: ``str``\n\n        :return: False if an HTTP Bad Request is received, else, True is\n                 returned.\n        :rtype:  ``bool``\n        '
    compute_node_id = str(node.id)
    compute = ET.Element('COMPUTE')
    compute_id = ET.SubElement(compute, 'ID')
    compute_id.text = compute_node_id
    disk = ET.SubElement(compute, 'DISK', {
        'id': str(node.image.id),
    })
    ET.SubElement(disk, 'STORAGE', {
        'href': ('/storage/%s' % str(node.image.id)),
        'name': node.image.name,
    })
    ET.SubElement(compute_node_id, 'SAVE_AS', {
        'name': str(name),
    })
    xml = ET.tostring(compute)
    url = ('/compute/%s' % compute_node_id)
    resp = self.connection.request(url, method='PUT', data=xml)
    if (resp.status == httplib.BAD_REQUEST):
        return False
    else:
        return True

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py OpenNebula_3_0_NodeDriver.ex_node_set_save_name/VarMisuse@120/386 `disk`->`compute_node_id`