

def ex_node_action(self, node, action):
    '\n        Build action representation and instruct node to commit action.\n\n        Build action representation from the compute node ID, and the\n        action which should be carried out on that compute node. Then\n        instruct the node to carry out that action.\n\n        :param node: Compute node instance.\n        :type  node: :class:`Node`\n\n        :param action: Action to be carried out on the compute node.\n        :type  action: ``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
    state = ET.SubElement(compute, 'STATE')
    state.text = action
    xml = ET.tostring(compute)
    url = ('/compute/%s' % compute_node_id)
    resp = self.connection.request(node, method='PUT', data=xml)
    if (resp.status == httplib.BAD_REQUEST):
        return False
    else:
        return True

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py OpenNebulaNodeDriver.ex_node_action/VarMisuse@93/335 `url`->`node`