Skip to content

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

@demoze

Description

@demoze

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions