HubApiClient class

A thin REST client for the Hub HTTP API, used by the CLI's operational commands — and by the web dashboard — so both exercise exactly the same public API surface as any other client.

Constructors

HubApiClient(Uri baseUrl, {String? token, String? principal, ApiTransport? transport})
Creates a client for baseUrl.

Properties

baseUrl Uri
The API base URL (e.g. https://hub.example.com:8443).
final
hashCode int
The hash code for this object.
no setterinherited
principal String?
Optional principal the token was granted to.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String?
Optional bearer token.
final

Methods

close() → void
Releases the underlying transport.
delete(String path) Future
DELETE /api/v1[path].
get(String path) Future
GET /api/v1[path], decoding the JSON body.
getText(String absolutePath) Future<String>
GET a raw text endpoint (e.g. /metrics) outside the versioned API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String path, [Object? body]) Future
POST /api/v1[path] with an optional JSON body.
put(String path, [Object? body]) Future
PUT /api/v1[path] with an optional JSON body.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited