PHPackages                             dply/fleet-operator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. dply/fleet-operator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

dply/fleet-operator
===================

PHP middleware, config, and OpenAPI spec for Fleet Console operator APIs (GET …/summary and …/readme).

v1.0.0(3mo ago)04↓88.9%MITPHPPHP ^8.4CI passing

Since Mar 25Pushed 3mo agoCompare

[ Source](https://github.com/shaferllc/fleet-operator)[ Packagist](https://packagist.org/packages/dply/fleet-operator)[ Docs](https://github.com/shaferllc/fleet-operator)[ RSS](/packages/dply-fleet-operator/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

fleet-operator
==============

[](#fleet-operator)

**Repository:** [github.com/shaferllc/fleet-operator](https://github.com/shaferllc/fleet-operator)
**Composer package:** `dply/fleet-operator` · **PHP** `^8.4`

Shared **middleware**, **config**, and **OpenAPI** for applications that expose a Fleet Console–compatible **operator API**:

- `GET {prefix}/summary` — JSON snapshot (see **Summary fields** below); extra keys are stored and can drive `FLEET_ALERT_METRIC_RULES`
- `GET {prefix}/readme` — JSON with required `content` (Markdown is typical); optional `format`, `title`, `subtitle`

Fleet Console polls `summary` and may open `readme` in the UI. Set **`FLEET_OPERATOR_TOKEN`** on this app and store the **same secret** for that service in Fleet Console (**Console → Services** → operator token for that row).

Should I use this package?
--------------------------

[](#should-i-use-this-package)

Use itSkip itMany services, want one auth + contractSingle app, two routes already doneWant a published OpenAPI file per releaseOnly internal docs in a wikiSemver when response/auth rules evolveAPI never changesGitHub Actions
--------------

[](#github-actions)

- **On [shaferllc/fleet-operator](https://github.com/shaferllc/fleet-operator):** workflow **CI** lives at `.github/workflows/ci.yml` on the default branch (`main`). Open **Actions** → **CI** — you should see runs on each push/PR. Use **Run workflow** if you add `workflow_dispatch` (included in this repo) to run without a new commit.
- **Release:** `.github/workflows/release.yml` creates a GitHub Release when you push a tag `v1.2.3` or run the workflow with a version. That file must exist on the package repo (push it if you only see CI in the Actions sidebar).
- **Fleet Console monorepo:** GitHub **does not** run YAML under `fleet-operator/.github/` for the parent repo. Use the monorepo root workflow `package-fleet-operator.yml` (path filter `fleet-operator/**`) — or **Actions → Run workflow** after enabling `workflow_dispatch` on that file.

Install
-------

[](#install)

```
composer require dply/fleet-operator
```

Optional: publish bundled config and OpenAPI into your project when your stack supports tagged package publishing (tags `fleet-operator-config` and `fleet-operator-openapi`).

Set in `.env`:

```
FLEET_OPERATOR_TOKEN=your-long-random-secret
```

Wire HTTP routes (you choose the prefix)
----------------------------------------

[](#wire-http-routes-you-choose-the-prefix)

Typical prefixes are `api/operator` or `api/v1/operator`.

Apply `AuthenticateFleetOperator` to the routes that serve your operator **summary** and **readme** endpoints. Example — adapt to your router and controllers:

```
