示例#1
0
def list_backends(request):
    """Gets the available backends.

    .. note:: Currently, this is only used by the backend controller in js.

    """

    user = user_from_request(request)
    return methods.list_backends(user)
示例#2
0
def list_backends(request):
    """Gets the available backends.

    .. note:: Currently, this is only used by the backend controller in js.

    """

    user = user_from_request(request)
    return methods.list_backends(user)
示例#3
0
文件: sockio.py 项目: dz0ny/mist.io
def list_backends_from_socket(namespace):
    user = namespace.user
    backends = methods.list_backends(user)
    namespace.emit('list_backends', backends)
    for key, task in (('list_machines', tasks.ListMachines()),
                      ('list_images', tasks.ListImages()), ('list_sizes',
                                                            tasks.ListSizes()),
                      ('list_locations', tasks.ListLocations())):
        for backend_id in user.backends:
            if user.backends[backend_id].enabled:
                cached = task.smart_delay(user.email, backend_id)
                if cached is not None:
                    namespace.emit(key, cached)
示例#4
0
def list_backends_from_socket(namespace):
    user = namespace.user
    backends = methods.list_backends(user)
    namespace.emit('list_backends', backends)
    for key, task in (('list_machines', tasks.ListMachines()),
                      ('list_images', tasks.ListImages()),
                      ('list_sizes', tasks.ListSizes()),
                      ('list_locations', tasks.ListLocations())):
        for backend_id in user.backends:
            if user.backends[backend_id].enabled:
                cached = task.smart_delay(user.email, backend_id)
                if cached is not None:
                    namespace.emit(key, cached)
示例#5
0
文件: sock.py 项目: Gazzonyx/mist.io
 def list_backends(self):
     backends = methods.list_backends(self.user)
     self.send('list_backends', backends)
     for key, task in (('list_machines', tasks.ListMachines()),
                       ('list_images', tasks.ListImages()),
                       ('list_sizes', tasks.ListSizes()),
                       ('list_networks', tasks.ListNetworks()),
                       ('list_locations', tasks.ListLocations()),):
         for backend_id in self.user.backends:
             if self.user.backends[backend_id].enabled:
                 cached = task.smart_delay(self.user.email, backend_id)
                 if cached is not None:
                     log.info("Emitting %s from cache", key)
                     self.send(key, cached)
示例#6
0
 def list_backends(self):
     backends = methods.list_backends(self.user)
     self.send('list_backends', backends)
     for key, task in (('list_machines', tasks.ListMachines()),
                       ('list_images', tasks.ListImages()),
                       ('list_sizes', tasks.ListSizes()),
                       ('list_networks', tasks.ListNetworks()),
                       ('list_locations', tasks.ListLocations()),):
         for backend_id in self.user.backends:
             if self.user.backends[backend_id].enabled:
                 cached = task.smart_delay(self.user.email, backend_id)
                 if cached is not None:
                     log.info("Emitting %s from cache", key)
                     self.send(key, cached)