Esempio n. 1
0
    def fetch_vms(self, source):
        """
        Fetches list of VMs from specified source hypervisor..
        """

        body = {
            "os-fetch_vms": {
                "source_id": base.getid(source)
            }
        }
        url = '/vms/%s/action' % base.getid(source)

        return self.api.client.post(url, body=body)
Esempio n. 2
0
    def delete(self, vm):
        """
        Delete a specific instance.

        :param instance: The name or ID of the :class:`VM` to delete.
        """
        self._delete("/vms/%s" % base.getid(vm))
Esempio n. 3
0
    def update(self, cloud, **kwargs):
        """Updates the given cloud."""
        if not kwargs:
            return

        body = {'cloud': kwargs}

        return self._update("/clouds/%s" % base.getid(cloud), body, 'cloud')
Esempio n. 4
0
    def get(self, vm):
        """
        Get a specific source instance.

        :param instance: The ID of the :class:`Instance` to get.

        :rtype: :class:`Instance`
        """
        return self._get("/vms/%s" % base.getid(vm),
                         "vm")
Esempio n. 5
0
 def delete(self, cloud):
     return self._delete("/clouds/%s" % base.getid(cloud))