Documentation
¶
Overview ¶
Package cloudapi talks to Miren Cloud's HTTP API on behalf of a logged-in user. It covers the endpoints the CLI needs to answer "what clusters do I have, and can cloud reach this one", and it owns the base URL, the bearer token, and the request and response decoding that go with them.
Deciding which identity to use, what to render, and how to reach a cluster stays with the caller. This package only makes the calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls one Miren Cloud instance as one identity.
func (*Client) BaseURL ¶
BaseURL is the cloud this client talks to. Callers use it to say which cloud they are talking about, and to notice an unencrypted one.
func (*Client) ClusterOnline ¶
ClusterOnline reports whether cloud currently holds a link to the cluster, which is the precondition for relaying calls to it.
A cluster with no id cannot be asked about, and reports as not online rather than as an error: the caller reaches the same decision either way.
type Cluster ¶
type Cluster struct {
XID string `json:"xid"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Tags map[string]any `json:"tags"`
APIAddresses []string `json:"api_addresses,omitempty"`
CACertFingerprint string `json:"ca_cert_fingerprint,omitempty"`
OrganizationXID string `json:"organization_xid"`
OrganizationName string `json:"organization_name"`
}
Cluster is a cluster as Miren Cloud describes it.
func (Cluster) HasReachableAddress ¶
HasReachableAddress reports whether cloud advertised at least one API address for this cluster. A cluster with none can't be dialed by any client, so it would otherwise be silently hidden from `miren cluster add`. The most common cause is a firewalled inbound port: miren connects over QUIC (UDP 8443), and when cloud's netcheck can't reach that port it drops the discovered public IP, leaving the cluster advertising nothing. See MIR-1316.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cloudapitest provides a stand-in for Miren Cloud's HTTP API, so tests that need cloud to answer something can have it answer without a cloud.
|
Package cloudapitest provides a stand-in for Miren Cloud's HTTP API, so tests that need cloud to answer something can have it answer without a cloud. |