FINOS.OpenResourceBroker
1.10.0
Prefix Reserved
See the version list below for details.
dotnet add package FINOS.OpenResourceBroker --version 1.10.0
NuGet\Install-Package FINOS.OpenResourceBroker -Version 1.10.0
<PackageReference Include="FINOS.OpenResourceBroker" Version="1.10.0" />
<PackageVersion Include="FINOS.OpenResourceBroker" Version="1.10.0" />
<PackageReference Include="FINOS.OpenResourceBroker" />
paket add FINOS.OpenResourceBroker --version 1.10.0
#r "nuget: FINOS.OpenResourceBroker, 1.10.0"
#:package FINOS.OpenResourceBroker@1.10.0
#addin nuget:?package=FINOS.OpenResourceBroker&version=1.10.0
#tool nuget:?package=FINOS.OpenResourceBroker&version=1.10.0
FINOS.OpenResourceBroker
.NET / C# client SDK for the
Open Resource Broker (ORB),
published on NuGet as FINOS.OpenResourceBroker.
Prerequisites
ORB is a Python service. Install it before using managed-process mode:
uv tool install 'orb-py>=1.8.3,<2.0.0'
# or: pip install 'orb-py>=1.8.3,<2.0.0'
Verify: orb --version
Then run one-time setup (skip if connecting to an existing server):
orb init
Requirements
- .NET 8 or later
- Linux or macOS (Unix domain socket support is built-in on .NET 8)
Installation
dotnet add package FINOS.OpenResourceBroker
Quick Start
using FINOS.OpenResourceBroker;
await using var client = await OrbClient.CreateAsync(new ClientConfig
{
Process = new ProcessConfig { Binary = "orb" },
});
var templates = await client.ListTemplatesAsync();
Console.WriteLine(templates.Templates.Count);
IPC Model
The SDK communicates with ORB over a Unix domain socket (UDS) via
SocketsHttpHandler.ConnectCallback. When configured for managed-process mode
the SDK spawns ORB as a child process and routes all HTTP traffic through the
socket — no TCP port is allocated.
Operating Modes
Spawn mode (recommended)
using FINOS.OpenResourceBroker;
await using var client = await OrbClient.CreateAsync(new ClientConfig
{
Process = new ProcessConfig { Binary = "orb" },
});
// use client ...
// IAsyncDisposable: DisposeAsync sends SIGTERM, waits, then SIGKILL
Remote mode
await using var client = await OrbClient.CreateAsync(new ClientConfig
{
BaseUrl = "https://orb.example.com",
Auth = AuthOption.Bearer("my-token"),
});
UDS mode (explicit socket)
await using var client = await OrbClient.CreateAsync(new ClientConfig
{
SocketPath = "/run/orb/orb.sock",
});
Usage
using FINOS.OpenResourceBroker;
using FINOS.OpenResourceBroker.Models;
await using var client = await OrbClient.CreateAsync(new ClientConfig
{
Process = new ProcessConfig { Binary = "orb" },
});
// List templates
var templates = await client.ListTemplatesAsync();
if (templates.Templates.Count == 0)
{
Console.WriteLine("No templates registered");
return;
}
// Request machines
var op = await client.RequestMachinesAsync(new RequestMachinesRequest
{
TemplateId = templates.Templates[0].TemplateId,
Count = 2,
});
Console.WriteLine($"Request submitted: {op.RequestId}");
// Wait for completion (streams SSE until terminal status)
var final = await client.WaitForCompletionAsync(op.RequestId);
Console.WriteLine($"Status: {final.Status}, machines: {final.Machines.Count}");
// Return machines
var machineIds = final.Machines.Select(m => m.MachineId).ToList();
if (machineIds.Count > 0)
{
await client.ReturnMachinesAsync(new ReturnMachinesRequest
{
MachineIds = machineIds,
});
}
Authentication
| Mode | AuthOption |
|---|---|
| None | AuthOption.None |
| Bearer token | AuthOption.Bearer("token") |
| AWS SigV4 | AuthOption.SigV4(region: "us-east-1", service: "execute-api") |
var client = await OrbClient.CreateAsync(new ClientConfig
{
BaseUrl = "https://orb.example.com",
Auth = AuthOption.Bearer("my-token"),
});
Scheduler (HostFactory mode)
var client = await OrbClient.CreateAsync(new ClientConfig
{
Process = new ProcessConfig { Binary = "orb" },
Scheduler = Scheduler.HostFactory,
});
When Scheduler = Scheduler.HostFactory is set, the SDK appends
X-ORB-Scheduler: hostfactory to every request header.
Streaming
// IAsyncEnumerable-based SSE stream with reconnect
await foreach (var ev in client.StreamRequestStatusAsync(requestId))
{
Console.WriteLine(ev.Status);
}
// Convenience — blocks until terminal status
var final = await client.WaitForCompletionAsync(requestId, timeoutSeconds: 600);
Error Handling
using FINOS.OpenResourceBroker;
try
{
await client.GetTemplateAsync("unknown");
}
catch (OrbApiException ex) when (ex.StatusCode == 404)
{
Console.WriteLine("Template not found");
}
catch (OrbApiException ex)
{
Console.WriteLine($"HTTP {ex.StatusCode}: {ex.Message}");
}
Version Compatibility
The SDK requires the ORB Python service (orb-py) version 1.8.3 or later and
earlier than 2.0.0.
Documentation
Full documentation, including the SDK overview and the API reference, is at https://finos.github.io/open-resource-broker/. The SDK overview covers all supported languages: https://finos.github.io/open-resource-broker/sdk/.
Instructions for building and testing the SDKs from source are in the developer testing guide.
License
Licensed under the Apache License, Version 2.0. See the LICENSE file.
Open Resource Broker is a project of the Fintech Open Source Foundation (FINOS).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- AWSSDK.Core (>= 4.0.102.16)
- System.Text.Json (>= 10.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.