Skip to content

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 ​

bash
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:

FlagShortDescription
--appApplication slug, or ID (overrides project.yaml)
--env-eEnvironment alias from project.yaml (supplies the application_id)
--projectProject slug (resolved to an ID), needed to resolve an --app slug
--project-idProject 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.

bash
pfy service list --app myapp --project my-saas
myapp                    primary  /* (everything not routed to a backend)
api                      backend  /api

The 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).

bash
pfy service create <slug> --app <app-slug> --project <project> [--route-prefix /api]... [--no-data-env]
FlagDescription
--route-prefixPath prefix routed to this service, e.g. /api (repeatable)
--no-data-envOpt out of managed data-dependency credential injection

Example ​

bash
pfy service create api --app myapp --project my-saas --route-prefix /api --route-prefix /webhooks
Created backend service api (/api, /webhooks)

service update ​

Edit a service's slug, route prefixes, or data-env opt-out.

bash
pfy service update <slug> [target flags] [--slug <new>] [--route-prefix <p>]... [--clear-route-prefixes] [--data-env | --no-data-env]
FlagDescription
--slugNew slug for the service (refused for the primary, whose slug equals the app's)
--route-prefixReplaces the whole prefix list (repeatable)
--clear-route-prefixesRemove every route prefix from this service
--data-envTurn managed data-dependency credential injection on
--no-data-envTurn 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 ​

bash
pfy service update api --app myapp --project my-saas --route-prefix /api/v2

service delete ​

Delete a backend service. The primary cannot be deleted: it is the default target for every request no backend has claimed.

bash
pfy service delete <slug> [target flags] [--yes]
FlagAliasesDescription
--yes-y, --confirmSkip 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 ​

bash
pfy service delete api --app myapp --project my-saas --yes

See 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)