Пример #1
0
    def setUp(self):
        self.body_serializers = {
            'application/json': JSONSerializer(),
            'application/xml': XMLSerializer(),
        }

        self.serializer = wsgi.ResponseSerializer(self.body_serializers,
                                                  HeadersSerializer())
Пример #2
0
    def get_resources(self):
        resources = []

        body_serializers = {
            'application/xml': FloatingIPPoolsSerializer(),
        }

        serializer = wsgi.ResponseSerializer(body_serializers)

        res = extensions.ResourceExtension('os-floating-ip-pools',
                                           FloatingIPPoolsController(),
                                           serializer=serializer,
                                           member_actions={})
        resources.append(res)

        return resources
Пример #3
0
 def __init__(self, application):
     controller = RequestExtensionController(application)
     wsgi.Resource.__init__(self,
                            controller,
                            serializer=wsgi.ResponseSerializer(),
                            deserializer=wsgi.RequestDeserializer())