# -*- coding: UTF-8 -*-

from .base import Api

from collections import OrderedDict


class ServerH(Api):
    @staticmethod
    def get(request, handler):
        ip = request.GET.get('ip', '')
        hostname = request.GET.get('hostname', '')
        res = []
        if handler == 'virtual_host':
            res.append(OrderedDict([
                ('is_virtual', 0),
                ('host_hostname', hostname),
                ('host_ip', ip),
                ('vm_host_hostname', hostname),
                ('vm_host_ip', ip),
            ]))
        return res
