+ def update_last_boot(self, commit = True):
+ self.update_timestamp('last_boot', commit)
+ def update_last_download(self, commit = True):
+ self.update_timestamp('last_download', commit)
+ def update_last_pcu_reboot(self, commit = True):
+ self.update_timestamp('last_pcu_reboot', commit)
+ def update_last_pcu_confirmation(self, commit = True):
+ self.update_timestamp('last_pcu_confirmation', commit)
+
+ def update_last_contact(self, commit = True):
+ self.update_timestamp('last_contact', commit)
+ def update_last_updated(self, commit = True):
+ self.update_timestamp('last_updated', commit)
+
+ def update_tags(self, tags):
+ from PLC.Shell import Shell
+ from PLC.NodeTags import NodeTags
+ from PLC.Methods.AddNodeTag import AddNodeTag
+ from PLC.Methods.UpdateNodeTag import UpdateNodeTag
+ shell = Shell()
+ for (tagname,value) in tags.items():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument("No such TagType %s"%tagname)
+ node_tags=NodeTags(self.api,{'tagname':tagname,'node_id':node['node_id']})
+ if not node_tags:
+ AddNodeTag(self.api).__call__(shell.auth,node['node_id'],tagname,value)
+ else:
+ UpdateNodeTag(self.api).__call__(shell.auth,node_tags[0]['node_tag_id'],value)
+