OpenServiceBroker.Client 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenServiceBroker.Client --version 0.3.0                
NuGet\Install-Package OpenServiceBroker.Client -Version 0.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenServiceBroker.Client" Version="0.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OpenServiceBroker.Client --version 0.3.0                
#r "nuget: OpenServiceBroker.Client, 0.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OpenServiceBroker.Client as a Cake Addin
#addin nuget:?package=OpenServiceBroker.Client&version=0.3.0

// Install OpenServiceBroker.Client as a Cake Tool
#tool nuget:?package=OpenServiceBroker.Client&version=0.3.0                

Add the NuGet package OpenServiceBroker.Client to your project. You can then create an instance of the client like this:

var client = new OpenServiceBrokerClient(new Uri("http://example.com/"));

Asynchronous Operations

All operations that result in HTTP request are async. Non-successful HTTP status codes are mapped to domain-specific exception types (BrokerException and derived). Refer to the libraries XML documentation for details on which exceptions to expect on which invocations.

The Open Service Broker API specification allows for both synchronous/blocking and asynchronous/incomplete/deferred operations. To avoid confusion with the C# language concept of async this library uses the terms "blocking" and "deferred" to describe these API features.

Instances of OpenServiceBrokerClient have three properties that expose the same functionality in different ways:

  • .ServiceInstancesBlocking allows you to request blocking responses from the server. However, you may encounter AsyncRequiredException if the server does not support blocking operations.
  • .ServiceInstancesDeferred allows you to request deferred responses from the server. However, you have to manually handle waiting/polling for the completion of operations.
  • .ServiceInstancesPolling combines the advantages of both. It requests deferred responses from the server and transparently handles the waiting/polling for you. It is the recommended option for most use-cases.

Samples

Read the catalog:

var result = await client.Catalog.ReadAsync();

Provision a service instance:

var result = await client.ServiceInstancesPolling["123"].ProvisionAsync(new ServiceInstanceProvisionRequest
{
    ServiceId = "abc",
    PlanId = "xyz",
    Context = new JObject
    {
        {"platform", "myplatform"}
    },
    Parameters = new JObject
    {
        {"some_option", "some value"}
    }
});

Fetch a service instance:

var result = await client.ServiceInstancesPolling["123"].FetchAsync();

Update a service instance:

var result = await client.ServiceInstancesPolling["123"].UpdateAsync(new ServiceInstanceUpdateRequest
{
    ServiceId = "abc",
    PlanId = "xyz",
    Context = new JObject
    {
        {"platform", "myplatform"}
    },
    Parameters = new JObject
    {
        {"some_option", "some value"}
    }
});

Deprovision a service instance:

await client.ServiceInstancesPolling["123"].DeprovisionAsync(serviceId: "abc", planId: "xyz");

Create a service binding:

var result = await client.ServiceInstancesPolling["123"].ServiceBindings["456"].ProvisionAsync(new ServiceBindingRequest
{
    ServiceId = "abc",
    PlanId = "xyz",
    BindResource = new ServiceBindingResourceObject
    {
        AppGuid = "e490c9df-6627-4699-8db8-55edc2a88e58"
    },
    Context = new JObject
    {
        {"platform", "myplatform"}
    },
    Parameters = new JObject
    {
        {"some_option", "some value"}
    }
});

Fetch a service binding:

var result = await client.ServiceInstancesPolling["123"].ServiceBindings["456"].FetchAsync();

Delete a service binding:

await client.ServiceInstancesPolling["123"].ServiceBindings["456"].UnbindAsync(serviceId: "abc", planId: "xyz");

Versioning

The Client Library specifies the API version it expects by setting the X-Broker-API-Version header for all requests (as defined in the specification).

Currently the Client Library supports the 2.16 feature set but defaults to setting the version header to 2.13 for greater compatibility with older brokers. If the broker you are calling expects a different version and you are sure your request is compliant with that version of the specification you can override this:

client.SetApiVersion(new ApiVersion(2, 16));
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.0 136 3/6/2024
0.4.6 284 3/12/2023
0.4.5 302 1/13/2022
0.4.4 1,112 11/29/2021
0.4.3 338 9/5/2021
0.4.2 341 4/7/2021
0.4.0 894 9/20/2020
0.3.1 431 8/26/2020
0.3.0 451 7/30/2020
0.2.0 510 12/11/2019
0.1.5 584 2/25/2019
0.1.4 621 2/11/2019
0.1.3 856 1/17/2019
0.1.2 836 1/10/2019
0.1.1 712 10/23/2018
0.1.0 772 9/15/2018