Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to support prefix_url when defining a blueprint. #243

Open
demoze opened this issue May 12, 2023 · 0 comments
Open

is there a way to support prefix_url when defining a blueprint. #243

demoze opened this issue May 12, 2023 · 0 comments

Comments

@demoze
Copy link

demoze commented May 12, 2023

Is your feature request related to a problem? Please describe.

I would like the servicebroker to be call by multiple cloud controller with a prefix. Each cloudcontroller will make a call to the broker by prefixing the url.

EG : /<plateform_id>/v2/catalog

This way the broker can handle the request base on wha call him.

The way I use to do that is by passing a url_prefix='/<pfatform_id>' in the bueprint or when registering the bueprint.

openbrokerapi.api.get_blueprint() has no url_prefix option , and trying to do it with app.register_blueprint(api_blueprint, url_prefix='/') will failed later when the request come in.

13/05/2023 00:35:37 - ERROR - root - catalog() got an unexpected keyword argument 'pfatform_id'
Traceback (most recent call last):
  File "D:\Users\abs\PycharmProjects\cf-idzone-service\venv\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "D:\Users\abs\PycharmProjects\cf-idzone-service\venv\lib\site-packages\flask\app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
TypeError: catalog() got an unexpected keyword argument 'pfatform_id'
13/05/2023 00:35:39 - ERROR - root - catalog() got an unexpected keyword argument 'pfatform_id'
Traceback (most recent call last):
  File "D:\Users\abs\PycharmProjects\cf-idzone-service\venv\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "D:\Users\abs\PycharmProjects\cf-idzone-service\venv\lib\site-packages\flask\app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
TypeError: catalog() got an unexpected keyword argument 'pfatform_id'

13/05/2023 00:35:39 - INFO - werkzeug - 127.0.0.1 - - [13/May/2023 00:35:39] "GET /cfy-bgl/v2/catalog HTTP/1.1" 500 -

Describe the solution you'd like
It will be nice, to be able to have url_prefix option on api.get_bleuprint() and add support to handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant