X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fmachine.py;h=04abc3b9d8ac64d525d936353995ae1099850498;hb=c82b09f55dddef7a72885713bcfd272af479fb5a;hp=181c60cba69afdd22ebead61750a05c35245351a;hpb=a56869a418a68b795817d4f14d4065d11784f09f;p=osm%2FN2VC.git diff --git a/juju/machine.py b/juju/machine.py index 181c60c..04abc3b 100644 --- a/juju/machine.py +++ b/juju/machine.py @@ -29,6 +29,24 @@ class Machine(model.ModelEntity): """ pass + async def set_annotations(self, annotations): + """Set annotations on this machine. + + :param annotations map[string]string: the annotations as key/value + pairs. + + """ + log.debug('Updating annotations on machine %s', self.id) + + self.ann_facade = client.AnnotationsFacade() + self.ann_facade.connect(self.connection) + + ann = client.EntityAnnotations( + entity=self.id, + annotations=annotations, + ) + return await self.ann_facade.Set([ann]) + def scp( self, source_path, user=None, destination_path=None, proxy=False, scp_opts=None):