Skip to main content

Service Broker API

A Python package for building Service Brokers.

Following CF Service Broker API and Open Service Broker API

Installation

This package is available for Python 3.5+.

pip3 install openbrokerapi

Getting started

from openbrokerapi import service_broker
from openbrokerapi.api import *
from flask import Flask

# Implement a service broker by overriding methods of ServiceBroker
class CustomServiceBroker(service_broker.ServiceBroker):
    def catalog(self) -> List[Service]:
        pass

    def provision(self, instance_id: str, service_details: ProvisionDetails, async_allowed: bool) -> ProvisionedServiceSpec:
        pass

    def unbind(self, instance_id: str, binding_id: str, details: UnbindDetails):
        pass

    def update(self, instance_id: str, details: UpdateDetails, async_allowed: bool) -> UpdateServiceSpec:
        pass

    def bind(self, instance_id: str, binding_id: str, details: BindDetails) -> Binding:
        pass

    def deprovision(self, instance_id: str, details: DeprovisionDetails, async_allowed: bool) -> DeprovisionServiceSpec:
        pass

# Simpely start the server
serve(CustomServiceBroker(), BrokerCredentials("", ""))

# or register blueprint to your own FlaskApp instance
app = Flask(__name__)
openbroker_bp = get_blueprint(CustomServiceBroker(), BrokerCredentials("",""))
app.register_blueprint(openbroker_bp)
app.run("0.0.0.0")

Error Types

Brokerapi defines a handful of error types in errors.py for some common error cases that your service broker may encounter. Raise these from your ServiceBroker methods where appropriate, and brokerapi will do the “right thing” (™), and give Cloud Foundry an appropriate status code, as per the Service Broker API specification.

Planned

  • Support async tasks

  • Support VolumeMounts

Not Planned To Support

  • Provisioning

    • Response: 200 - If service already exists, a 409-Conflict will be returned

  • Bind

    • Response: 200 - If binding already exists, a 409-Conflict will be returned

Bugs or Issues

Please report bugs, issues or feature requests to Github Issues

Metadata

Release files for openbrokerapi 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openbrokerapi 0.1
File Size Uploaded Provenance
openbrokerapi-0.1.tar.gz 7.8 kB Without provenance Details

Release files / openbrokerapi-0.1.tar.gz

Download URL openbrokerapi-0.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca7ebcde3fc77f0a4439fae6f4fc3d78c36d071b882aae5ae556e0a36983acb7
BLAKE2b-256 checksum
How to use checksums
4f7a8c010c864aa25413500a35bf1713d1e7541bca0219b3308c5d382db92b92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for openbrokerapi 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page