コード例 #1
0
    def delete_vms(self, names):
        """Recompose the vApp and delete VMs.

        :param names: A list or tuple of names (str) of the VMs to delete
            from the vApp.

        :return:  A :class:`lxml.objectify.StringElement` object representing a
            sparsely populated vApp element.
        """
        params = E.RecomposeVAppParams()
        for name in names:
            vm = self.get_vm(name)
            params.append(E.DeleteItem(href=vm.get('href')))
        return self.client.post_linked_resource(
            self.resource, RelationType.RECOMPOSE,
            EntityType.RECOMPOSE_VAPP_PARAMS.value, params)
コード例 #2
0
ファイル: vapp.py プロジェクト: avisi/pyvcloud
    def delete_vms(self, names):
        """Recompose the vApp and delete vms.

        :param list names: names (str) of vms to delete from the vApp.

        :return: an object containing EntityType.VAPP XML data representing the
            updated vApp.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        params = E.RecomposeVAppParams()
        for name in names:
            vm = self.get_vm(name)
            params.append(E.DeleteItem(href=vm.get('href')))
        return self.client.post_linked_resource(
            self.resource, RelationType.RECOMPOSE,
            EntityType.RECOMPOSE_VAPP_PARAMS.value, params)