Пример #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)
Пример #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))
Пример #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')
Пример #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")
Пример #5
0
 def delete(self, cloud):
     return self._delete("/clouds/%s" % base.getid(cloud))