service
pfy service lists, adds, edits, and removes the services of an application. An application's stack has one primary service (created with the application) and any number of backend services, each owning some URL path prefixes. Each service gets its own deployment spec.
Synopsis
pfy service <subcommand> [flags]Description
An application is a stack: exactly one primary service (the default proxy target, carrying the application's own slug) plus any number of backend services that take slices of the path space via route prefixes.
Only backends are creatable and deletable here. The primary is created together with the application, and the Manager refuses both a second primary and the deletion of the only one. The primary can be updated (route semantics, data-env opt-out) but its slug cannot change; renaming an application and its primary together is pfy application update.
Target flags
Every service subcommand names the application whose stack is operated on:
| Flag | Short | Description |
|---|---|---|
--app | Application slug, or ID (overrides project.yaml) | |
--env | -e | Environment alias from project.yaml (supplies the application_id) |
--project | Project slug (resolved to an ID), needed to resolve an --app slug | |
--project-id | Project ID (overrides --project) |
A slug needs a project to resolve against (application slugs are unique within a project); an --app UUID passes straight through with no project needed.
service list
List an application's services, primary first.
pfy service list --app myapp --project my-saasmyapp primary /* (everything not routed to a backend)
api backend /apiThe primary owns everything no backend has claimed, so its route column is always /*. A backend with no route prefixes is flagged: nothing reaches it. An application without services prints No services. Structured output: pfy -o json service list ….
service create
Add a backend service to an application (the kind is always backend; the primary is created with the application).
pfy service create <slug> --app <app-slug> --project <project> [--route-prefix /api]... [--no-data-env]| Flag | Description |
|---|---|
--route-prefix | Path prefix routed to this service, e.g. /api (repeatable) |
--no-data-env | Opt out of managed data-dependency credential injection |
Example
pfy service create api --app myapp --project my-saas --route-prefix /api --route-prefix /webhooksCreated backend service api (/api, /webhooks)service update
Edit a service's slug, route prefixes, or data-env opt-out.
pfy service update <slug> [target flags] [--slug <new>] [--route-prefix <p>]... [--clear-route-prefixes] [--data-env | --no-data-env]| Flag | Description |
|---|---|
--slug | New slug for the service (refused for the primary, whose slug equals the app's) |
--route-prefix | Replaces the whole prefix list (repeatable) |
--clear-route-prefixes | Remove every route prefix from this service |
--data-env | Turn managed data-dependency credential injection on |
--no-data-env | Turn it off (mutually exclusive with --data-env) |
Passing --route-prefix replaces the entire list; emptying it must be asked for explicitly with --clear-route-prefixes. A service's kind is immutable; recreating the service is the deliberate path.
Example
pfy service update api --app myapp --project my-saas --route-prefix /api/v2service delete
Delete a backend service. The primary cannot be deleted: it is the default target for every request no backend has claimed.
pfy service delete <slug> [target flags] [--yes]| Flag | Aliases | Description |
|---|---|---|
--yes | -y, --confirm | Skip the confirmation prompt (required under --ci or without a TTY); --confirm is a legacy alias |
On a TTY without --yes, the service slug must be typed back to confirm (the same gate as data delete). Deleting the primary is refused before any request is made:
Error: service "myapp" is the application's primary service and cannot be deleted: ...Example
pfy service delete api --app myapp --project my-saas --yesSee Also
- application - The application the stack belongs to
- data - Managed data stores injected into these services
- deployment - Per-service deployment specs (
--service <slug>) - nomad - Deploying the stack (
nomad deploy --stack)