Exemplo n.º 1
0
    def _setup_routes(self, mapper, ext_mgr):
        self.resources['versions'] = versions.create_resource()
        mapper.connect("versions", "/",
                       controller=self.resources['versions'],
                       action='show')

        mapper.redirect("", "/")

        self.resources['volumes'] = volumes.create_resource(ext_mgr)
        mapper.resource("volume", "volumes",
                        controller=self.resources['volumes'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['types'] = types.create_resource()
        mapper.resource("type", "types",
                        controller=self.resources['types'])

        self.resources['snapshots'] = snapshots.create_resource(ext_mgr)
        mapper.resource("snapshot", "snapshots",
                        controller=self.resources['snapshots'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['limits'] = limits.create_resource()
        mapper.resource("limit", "limits",
                        controller=self.resources['limits'])
Exemplo n.º 2
0
    def _setup_routes(self, mapper, ext_mgr):
        self.resources["versions"] = versions.create_resource()
        mapper.connect("versions", "/", controller=self.resources["versions"], action="show")

        mapper.redirect("", "/")

        self.resources["volumes"] = volumes.create_resource(ext_mgr)
        mapper.resource(
            "volume",
            "volumes",
            controller=self.resources["volumes"],
            collection={"detail": "GET"},
            member={"action": "POST"},
        )

        self.resources["types"] = types.create_resource()
        mapper.resource("type", "types", controller=self.resources["types"])

        self.resources["snapshots"] = snapshots.create_resource(ext_mgr)
        mapper.resource(
            "snapshot",
            "snapshots",
            controller=self.resources["snapshots"],
            collection={"detail": "GET"},
            member={"action": "POST"},
        )

        self.resources["limits"] = limits.create_resource()
        mapper.resource("limit", "limits", controller=self.resources["limits"])
Exemplo n.º 3
0
    def _setup_routes(self, mapper, ext_mgr):
        self.resources['versions'] = versions.create_resource()
        mapper.connect("versions",
                       "/",
                       controller=self.resources['versions'],
                       action='show')

        mapper.redirect("", "/")

        self.resources['volumes'] = volumes.create_resource(ext_mgr)
        mapper.resource("volume",
                        "volumes",
                        controller=self.resources['volumes'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['types'] = types.create_resource()
        mapper.resource("type", "types", controller=self.resources['types'])

        self.resources['snapshots'] = snapshots.create_resource(ext_mgr)
        mapper.resource("snapshot",
                        "snapshots",
                        controller=self.resources['snapshots'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['snapshot_metadata'] = \
            snapshot_metadata.create_resource()
        snapshot_metadata_controller = self.resources['snapshot_metadata']

        mapper.resource("snapshot_metadata",
                        "metadata",
                        controller=snapshot_metadata_controller,
                        parent_resource=dict(member_name='snapshot',
                                             collection_name='snapshots'))

        mapper.connect("metadata",
                       "/{project_id}/snapshots/{snapshot_id}/metadata",
                       controller=snapshot_metadata_controller,
                       action='update_all',
                       conditions={"method": ['PUT']})

        self.resources['limits'] = limits.create_resource()
        mapper.resource("limit", "limits", controller=self.resources['limits'])
        self.resources['volume_metadata'] = \
            volume_metadata.create_resource()
        volume_metadata_controller = self.resources['volume_metadata']

        mapper.resource("volume_metadata",
                        "metadata",
                        controller=volume_metadata_controller,
                        parent_resource=dict(member_name='volume',
                                             collection_name='volumes'))

        mapper.connect("metadata",
                       "/{project_id}/volumes/{volume_id}/metadata",
                       controller=volume_metadata_controller,
                       action='update_all',
                       conditions={"method": ['PUT']})
Exemplo n.º 4
0
    def _setup_routes(self, mapper, ext_mgr):
        self.resources['versions'] = versions.create_resource()
        mapper.connect("versions", "/",
                       controller=self.resources['versions'],
                       action='show')

        mapper.redirect("", "/")

        self.resources['volumes'] = volumes.create_resource(ext_mgr)
        mapper.resource("volume", "volumes",
                        controller=self.resources['volumes'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['types'] = types.create_resource()
        mapper.resource("type", "types",
                        controller=self.resources['types'])

        self.resources['snapshots'] = snapshots.create_resource(ext_mgr)
        mapper.resource("snapshot", "snapshots",
                        controller=self.resources['snapshots'],
                        collection={'detail': 'GET'},
                        member={'action': 'POST'})

        self.resources['snapshot_metadata'] = \
            snapshot_metadata.create_resource()
        snapshot_metadata_controller = self.resources['snapshot_metadata']

        mapper.resource("snapshot_metadata", "metadata",
                        controller=snapshot_metadata_controller,
                        parent_resource=dict(member_name='snapshot',
                                             collection_name='snapshots'))

        mapper.connect("metadata",
                       "/{project_id}/snapshots/{snapshot_id}/metadata",
                       controller=snapshot_metadata_controller,
                       action='update_all',
                       conditions={"method": ['PUT']})

        self.resources['limits'] = limits.create_resource()
        mapper.resource("limit", "limits",
                        controller=self.resources['limits'])
        self.resources['volume_metadata'] = \
            volume_metadata.create_resource()
        volume_metadata_controller = self.resources['volume_metadata']

        mapper.resource("volume_metadata", "metadata",
                        controller=volume_metadata_controller,
                        parent_resource=dict(member_name='volume',
                                             collection_name='volumes'))

        mapper.connect("metadata",
                       "/{project_id}/volumes/{volume_id}/metadata",
                       controller=volume_metadata_controller,
                       action='update_all',
                       conditions={"method": ['PUT']})
Exemplo n.º 5
0
    def _setup_routes(self, mapper, ext_mgr):
        self.resources["versions"] = versions.create_resource()
        mapper.connect("versions", "/", controller=self.resources["versions"], action="show")

        mapper.redirect("", "/")

        self.resources["volumes"] = volumes.create_resource(ext_mgr)
        mapper.resource(
            "volume",
            "volumes",
            controller=self.resources["volumes"],
            collection={"detail": "GET"},
            member={"action": "POST"},
        )

        self.resources["types"] = types.create_resource()
        mapper.resource("type", "types", controller=self.resources["types"])

        self.resources["snapshots"] = snapshots.create_resource(ext_mgr)
        mapper.resource(
            "snapshot",
            "snapshots",
            controller=self.resources["snapshots"],
            collection={"detail": "GET"},
            member={"action": "POST"},
        )

        self.resources["limits"] = limits.create_resource()
        mapper.resource("limit", "limits", controller=self.resources["limits"])
        self.resources["volume_metadata"] = volume_metadata.create_resource()
        volume_metadata_controller = self.resources["volume_metadata"]

        mapper.resource(
            "volume_metadata",
            "metadata",
            controller=volume_metadata_controller,
            parent_resource=dict(member_name="volume", collection_name="volumes"),
        )

        mapper.connect(
            "metadata",
            "/{project_id}/volumes/{volume_id}/metadata",
            controller=volume_metadata_controller,
            action="update_all",
            conditions={"method": ["PUT"]},
        )
Exemplo n.º 6
0
 def setUp(self):
     """Run before each test."""
     super(LimitsControllerTest, self).setUp()
     self.controller = limits.create_resource()
Exemplo n.º 7
0
 def setUp(self):
     """Run before each test."""
     super(LimitsControllerTest, self).setUp()
     self.controller = limits.create_resource()