{"id":17231944,"url":"https://github.com/eruvanos/openbrokerapi","last_synced_at":"2025-04-05T08:04:29.714Z","repository":{"id":21278620,"uuid":"91414859","full_name":"eruvanos/openbrokerapi","owner":"eruvanos","description":"A python package for the V2 CF Service Broker API","archived":false,"fork":false,"pushed_at":"2025-03-29T23:45:13.000Z","size":1155,"stargazers_count":35,"open_issues_count":32,"forks_count":21,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-01T20:37:10.041Z","etag":null,"topics":["cfbrokerapi","cloudfoundry","openservicebroker","openservicebrokerapi","python","python3"],"latest_commit_sha":null,"homepage":"https://openbrokerapi.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eruvanos.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-16T04:45:14.000Z","updated_at":"2024-08-27T13:21:37.000Z","dependencies_parsed_at":"2024-12-17T01:08:06.758Z","dependency_job_id":"a50fdb52-3a6f-435e-bf54-b3d97daa57b6","html_url":"https://github.com/eruvanos/openbrokerapi","commit_stats":{"total_commits":474,"total_committers":21,"mean_commits":"22.571428571428573","dds":0.6455696202531646,"last_synced_commit":"e78c3be3ba07aff37fa18abf9e390e920325555b"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eruvanos%2Fopenbrokerapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eruvanos%2Fopenbrokerapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eruvanos%2Fopenbrokerapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eruvanos%2Fopenbrokerapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eruvanos","download_url":"https://codeload.github.com/eruvanos/openbrokerapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709914,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfbrokerapi","cloudfoundry","openservicebroker","openservicebrokerapi","python","python3"],"created_at":"2024-10-15T05:00:01.892Z","updated_at":"2025-04-05T08:04:29.679Z","avatar_url":"https://github.com/eruvanos.png","language":"Python","readme":"|Build Status| |Coverage Status| |Known Vulnerabilities| |PYUP| |OpenSSF Best Practices| |Scorecard|\n\nOpen Broker API\n===============\n\nA Python package for building Service Brokers supporting API version 2.13+.\n\nFollowing `Open Service Broker\nAPI Spec \u003chttps://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md\u003e`__ and `Open\nService Broker API \u003chttps://www.openservicebrokerapi.org/\u003e`__\n\nCheck out the documentation_.\n\n.. _documentation: http://openbrokerapi.readthedocs.io/en/latest/\n\nTo find out more about Platform Compatibility for OSBAPI versions, check out\n`Platform Compatibility for OSBAPI \u003chttps://github.com/openservicebrokerapi/servicebroker/blob/master/compatibility.md\u003e`__\n\n Not all features are supported with this library due to conflicting features.\n\nInstallation\n------------\n\nThis package is available for Python 3.8+.\n\n.. code:: bash\n\n    pip3 install openbrokerapi\n\n    # including gevent as server\n    pip3 install openbrokerapi[gevent]\n\n    # recommended production setup\n    pip3 install openbrokerapi[gunicorn]\n\nOr install the development version from github:\n\n.. code:: bash\n\n    pip3 install git+https://github.com/eruvanos/openbrokerapi.git\n\nUsage\n-----\n\nYou can start with a `skeleton project \u003chttps://github.com/eruvanos/openbrokerapi-skeleton\u003e`__ or just from scratch.\n\n.. code:: python\n\n    from typing import Union, List\n\n    import openbrokerapi\n    from openbrokerapi import api\n    from openbrokerapi.api import ServiceBroker\n    from openbrokerapi.catalog import ServicePlan\n    from openbrokerapi.service_broker import (\n        Service,\n        ProvisionDetails,\n        ProvisionedServiceSpec,\n        DeprovisionDetails,\n        DeprovisionServiceSpec\n    )\n\n\n    class MyServiceBroker(ServiceBroker):\n        def catalog(self) -\u003e Union[Service, List[Service]]:\n            return Service(\n                id='service id',\n                name='service name',\n                description='service description',\n                bindable=False,\n                plans=[\n                    ServicePlan(\n                        id='plan id',\n                        name='plan name',\n                        description='plan description',\n                    )\n                ]\n            )\n\n        def provision(self,\n                      instance_id: str,\n                      details: ProvisionDetails,\n                      async_allowed: bool,\n                      **kwargs) -\u003e ProvisionedServiceSpec:\n            # Create service instance\n            # ...\n\n            return ProvisionedServiceSpec()\n\n        def deprovision(self,\n                        instance_id: str,\n                        details: DeprovisionDetails,\n                        async_allowed: bool,\n                        **kwargs) -\u003e DeprovisionServiceSpec:\n            # Delete service instance\n            # ...\n\n            return DeprovisionServiceSpec(is_async=False)\n\n    print('Start server on 127.0.0.1:5000')\n    print('Check the catalog at:')\n    print('\u003e curl 127.0.0.1:5000/v2/catalog -H \"X-Broker-API-Version: 2.14\"')\n    api.serve(MyServiceBroker(), None)\n\n    # Simply start the server\n    # api.serve(ExampleServiceBroker(), api.BrokerCredentials(\"\", \"\"))\n\n    # or start the server without authentication\n    # api.serve(ExampleServiceBroker(), None)\n\n    # or start the server with multiple authentication\n    # api.serve(ExampleServiceBroker(), [api.BrokerCredentials(\"\", \"\"), api.BrokerCredentials(\"\", \"\")])\n\n    # or with multiple service brokers and multiple credentials\n    # api.serve_multiple([ExampleServiceBroker(), ExampleServiceBroker()], [api.BrokerCredentials(\"\", \"\"), api.BrokerCredentials(\"\", \"\")])\n\n    # or register blueprint to your own FlaskApp instance\n    # app = Flask(__name__)\n    # logger = basic_config()  # Use root logger with a basic configuration provided by openbrokerapi.log_util\n    # openbroker_bp = api.get_blueprint(ExampleServiceBroker(), api.BrokerCredentials(\"\", \"\"), logger)\n    # app.register_blueprint(openbroker_bp)\n    # app.run(\"0.0.0.0\")\n\nDeployment\n----------\nThe included :code:`api.serve` function provides a server setup for **local usage only**.\n\nFor productive deployments use the blueprint from :code:`api.get_blueprint` to\nsetup a production ready server like `Waitress \u003chttps://docs.pylonsproject.org/projects/waitress/en/latest/\u003e`__\nor other mentioned in `Flask Deployment Docs \u003chttp://flask.pocoo.org/docs/dev/deploying/wsgi-standalone/\u003e`__\n\nError Types\n-----------\n\nOpenbrokerapi defines a handful of error types in errors.py for some\ncommon error cases that your service broker may encounter. Raise these\nfrom your ServiceBroker methods where appropriate, and openbrokerapi\nwill do the \"right thing\" (™), and give Cloud Foundry an appropriate\nstatus code, as per the Service Broker API specification.\n\n\nBugs or Issues\n--------------\n\nPlease report bugs, issues or feature requests to `Github\nIssues`_\n\n\nHow to contribute\n-----------------\n\nYou want to contribute, I really appreciate!\n\nSo let us check how you can contribute:\n\n- Create an issue in the `Github Issues`_. Please provide all information that you think are usefull to solve it.\n- Use the `Github Issues`_ to create a feature request, so we can discuss and find a good interface for that feature.\n- Create a Pull Request. There are some things that will make it easier to review your Pull Request:\n\n    - Use a new branch for every Pull Request\n    - Include just related commits in this branch\n    - Less commits are better, one would be the best (You can squash them.)\n    - Always add tests for your feature, if you are not familiar with writing tests, ask for help.\n    - Hint: To update your fork with the newest changes, follow `these instructions \u003chttps://stackoverflow.com/a/7244456/2947505\u003e`_.\n\n.. _Github Issues: https://github.com/eruvanos/openbrokerapi/issues\n\n.. |Build Status| image:: https://github.com/eruvanos/openbrokerapi/actions/workflows/python-test.yml/badge.svg\n    :target: https://github.com/eruvanos/openbrokerapi/actions/workflows/python-test.yml\n.. |Coverage Status| image:: https://coveralls.io/repos/github/eruvanos/openbrokerapi/badge.svg?branch=master\n   :target: https://coveralls.io/github/eruvanos/openbrokerapi?branch=main\n.. |Known Vulnerabilities| image:: https://github.com/eruvanos/openbrokerapi/actions/workflows/codeql.yml/badge.svg\n   :target: https://github.com/eruvanos/openbrokerapi/actions/workflows/codeql.yml\n.. |PYUP| image:: https://pyup.io/repos/github/eruvanos/openbrokerapi/shield.svg\n     :target: https://pyup.io/repos/github/eruvanos/openbrokerapi/\n.. |OpenSSF Best Practices| image:: https://bestpractices.coreinfrastructure.org/projects/7220/badge\n     :target: https://www.bestpractices.dev/projects/7220\n.. |Scorecard| image:: https://api.scorecard.dev/projects/github.com/eruvanos/openbrokerapi/badge\n     :target: https://scorecard.dev/viewer/?uri=github.com/eruvanos/openbrokerapi\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feruvanos%2Fopenbrokerapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feruvanos%2Fopenbrokerapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feruvanos%2Fopenbrokerapi/lists"}