Skip to content

Emulator Endpoints

Besides the OCI APIs, floci-oci serves a few endpoints of its own on the main port (4599). They are not part of any OCI contract: use them for health probes, init-hook waits, test isolation and TLS setup. Every Floci emulator (AWS, Azure, GCP, OCI) serves the same endpoints under the same /_floci prefix.

They never need a request signature, even with FLOCI_OCI_AUTH_REQUIRE_SIGNATURE=true, and are never refused for a region the tenancy has not subscribed to.

Method Path Response
GET /_floci/health 200 with the health body
GET /_floci/info 200 with the emulator manifest
GET /_floci/init 200 with the init hook state
POST /_floci/state/reset 200 {"status": "OK"}, after clearing the state of every service
GET /_floci/tls-cert 200 with the TLS certificate (application/x-pem-file), or 404 with a JSON explanation
GET /_floci/ca.pem 200 with the same certificate as /_floci/tls-cert, as text/plain, or the same 404
GET /_floci/sidecar-ca 200 with the CA of sidecar certificates (application/x-pem-file); floci-oci only
any /_floci/<anything else> 404 {"error": "NotFound", "path": "<path>"}

The OKE token webhook, which k3s calls from the sidecar of each Container Engine cluster, is at /_floci/oke/token-webhook/{tenancyId}/{clusterId}.

Legacy paths

  • /health is a permanent alias with the same body as /_floci/health.
  • /_floci-oci/* is deprecated. Every endpoint above still answers under it with the same body, and the first request to each path logs a warning naming its /_floci replacement. It will be removed in a later release, once floci-cli, floci-ui and the Testcontainers modules have moved to /_floci. Use /_floci now.
  • /_floci-oci/oke/token-webhook/{tenancyId}/{clusterId} is the webhook path of clusters created by floci-oci 0.8 and earlier, whose sidecars have it in their kubeconfig. It keeps answering, without the warning, until a floci-oci major release. New clusters use the /_floci path.
  • /_floci-oci/diagnose and /_floci-oci/config were removed. Like any unknown control-plane path, they now answer the JSON 404.

Health

{
  "status": "UP",
  "cloud": "oci",
  "services": {"identity": "running", "objectstorage": "running", "queue": "available"},
  "edition": "community",
  "original_edition": "floci-always-free",
  "version": "0.6.0"
}
Field Meaning
status Always UP with a 200. Another Floci emulator may answer DOWN with a 503 and a problems map
cloud Always oci
services Every service, running when enabled and available when disabled
version The floci-oci release the image was built from (FLOCI_OCI_VERSION), or dev for a local build

The image's HEALTHCHECK probes /_floci/health.

Emulator manifest

GET /_floci/info describes the running emulator, following the Floci Console Contract v2 manifest. A reader must ignore keys it does not know.

{
  "manifest_version": 1,
  "console_contract": 2,
  "cloud": "oci",
  "emulator": "floci-oci",
  "version": "0.6.0",
  "edition": "community",
  "original_edition": "floci-always-free",
  "endpoint": "http://localhost:4599",
  "health_url": "/_floci/health",
  "tls": {"enabled": false},
  "services": {"identity": "enabled", "queue": "disabled"},
  "defaults": {
    "tenancy_id": "ocid1.tenancy.oc1..flocilocaltenancy0000000000000000000000000000000000000000",
    "compartment_id": "ocid1.tenancy.oc1..flocilocaltenancy0000000000000000000000000000000000000000",
    "region": "us-ashburn-1",
    "namespace": "floci-local"
  },
  "ui": {"enabled": false}
}

defaults holds the tenancy used for unsigned requests, its root compartment (the tenancy itself), the default region and the Object Storage namespace. version, edition and original_edition are the keys the info endpoint returned before the manifest; they stay.

Init hooks

GET /_floci/init reports the initialization hooks. completed.ready turns true once the ready hooks have run, which makes it the signal to wait on when a test depends on them:

{
  "completed": {"boot": true, "start": true, "ready": true, "shutdown": false},
  "scripts": {"boot": [], "start": [], "ready": [{"script": "/etc/floci-oci/init/ready.d/seed.sh", "state": "successful", "return_code": 0}], "shutdown": []}
}

TLS certificate

With FLOCI_OCI_TLS_ENABLED=true, GET /_floci/tls-cert returns the certificate the HTTPS endpoint serves: the generated self-signed certificate, or the certificates in FLOCI_OCI_TLS_CERT_PATH. A private key in that file is never returned. Trust it once and every client validates:

curl -s http://localhost:4599/_floci/tls-cert -o floci-oci.pem

GET /_floci/ca.pem returns the same PEM as text/plain. It is the path every Floci emulator serves its trust anchor at, so a client that builds its trust store the same way for every cloud can use it.

When no certificate is available it answers 404:

{"tlsEnabled": false, "error": "TLS is not enabled", "message": "floci-oci is serving plain HTTP only. ..."}

Sidecar CA

Sidecars that serve TLS themselves (every OCI Cache node) present a certificate issued by one CA, which GET /_floci/sidecar-ca returns. Trust it and a client verifies the sidecar, host name included:

curl -s http://localhost:4599/_floci/sidecar-ca -o floci-oci-sidecar-ca.pem
valkey-cli --tls --cacert floci-oci-sidecar-ca.pem -h localhost -p 6379 PING
  • With FLOCI_OCI_TLS_ENABLED=true and the generated self-signed certificate, the CA is that certificate, the same one /_floci/tls-cert returns, so one trust anchor covers floci-oci and its sidecars. It is kept under {persistent-path}/tls and survives restarts.
  • Otherwise (TLS off, or a certificate of your own in FLOCI_OCI_TLS_CERT_PATH, whose CA key floci-oci does not hold) it is a CA generated at startup and never written to disk. Fetch it again after each restart: sidecars started then get certificates from the new CA.