Esempio n. 1
0
    def readable(self, request):
        pFormatted = {'id': self.id,
                      'name': self.name,
                      'description': self.description,
                      'protocol': self.protocol,
                      'health_monitors': self.health_monitors,
                      'provider': self.provider}
        try:
            pFormatted['subnet_id'] = self.subnet_id
            pFormatted['subnet_name'] = neutron.subnet_get(
                request, self.subnet_id).cidr
        except Exception:
            pFormatted['subnet_id'] = self.subnet_id
            pFormatted['subnet_name'] = self.subnet_id

        if self.vip_id is not None:
            try:
                pFormatted['vip_id'] = self.vip_id
                pFormatted['vip_name'] = vip_get(
                    request, self.vip_id).name
            except Exception:
                pFormatted['vip_id'] = self.vip_id
                pFormatted['vip_name'] = self.vip_id
        else:
            pFormatted['vip_id'] = None
            pFormatted['vip_name'] = None

        return self.AttributeDict(pFormatted)
Esempio n. 2
0
    def readable(self, request):
        sFormatted = {
            'id': self.id,
            'name': self.name,
            'description': self.description,
            'admin_state_up': self.admin_state_up,
            'status': self.status,
        }
        try:
            sFormatted['subnet_id'] = self.subnet_id
            sFormatted['subnet_name'] = neutron.subnet_get(
                request, self.subnet_id).cidr
        except Exception:
            sFormatted['subnet_id'] = self.subnet_id
            sFormatted['subnet_name'] = self.subnet_id

        try:
            sFormatted['router_id'] = self.router_id
            sFormatted['router_name'] = neutron.router_get(
                request, self.router_id).name
        except Exception:
            sFormatted['router_id'] = self.router_id
            sFormatted['router_name'] = self.router_id

        return self.AttributeDict(sFormatted)
Esempio n. 3
0
    def readable(self, request):
        pFormatted = {
            'id': self.id,
            'name': self.name,
            'description': self.description,
            'protocol': self.protocol,
            'health_monitors': self.health_monitors,
            'provider': self.provider
        }
        try:
            pFormatted['subnet_id'] = self.subnet_id
            pFormatted['subnet_name'] = neutron.subnet_get(
                request, self.subnet_id).cidr
        except Exception:
            pFormatted['subnet_id'] = self.subnet_id
            pFormatted['subnet_name'] = self.subnet_id

        if self.vip_id is not None:
            try:
                pFormatted['vip_id'] = self.vip_id
                pFormatted['vip_name'] = vip_get(request, self.vip_id).name
            except Exception:
                pFormatted['vip_id'] = self.vip_id
                pFormatted['vip_name'] = self.vip_id
        else:
            pFormatted['vip_id'] = None
            pFormatted['vip_name'] = None

        return self.AttributeDict(pFormatted)
Esempio n. 4
0
    def readable(self, request):
        sFormatted = {'id': self.id,
                      'name': self.name,
                      'description': self.description,
                      'admin_state_up': self.admin_state_up,
                      'status': self.status,
                      }
        try:
            sFormatted['subnet_id'] = self.subnet_id
            sFormatted['subnet_name'] = neutron.subnet_get(
                request, self.subnet_id).cidr
        except Exception:
            sFormatted['subnet_id'] = self.subnet_id
            sFormatted['subnet_name'] = self.subnet_id

        try:
            sFormatted['router_id'] = self.router_id
            sFormatted['router_name'] = neutron.router_get(
                request, self.router_id).name
        except Exception:
            sFormatted['router_id'] = self.router_id
            sFormatted['router_name'] = self.router_id

        return self.AttributeDict(sFormatted)