def create(self, req, body):
        parser = req.get_parser()(req.headers, req.body)
        scheme = {"category": storage.StorageResource.kind}
        obj = parser.parse()
        validator = occi_validator.Validator(obj)
        validator.validate(scheme)

        attrs = obj.get("attributes", {})
        name = attrs.get("occi.core.title", "OCCI Volume")
        # TODO(enolfc): this should be handled by the validator
        try:
            size = attrs["occi.storage.size"]
        except __HOLE__:
            raise exception.Invalid()

        volume = self.os_helper.volume_create(req, name, size)

        st = storage.StorageResource(title=volume["displayName"],
                                     id=volume["id"],
                                     size=volume["size"],
                                     state=helpers.vol_state(volume["status"]))
        return collection.Collection(resources=[st])
dataset/ETHPy150Open openstack/ooi/ooi/api/storage.py/Controller.create