diff --git a/api/machines/models.mdx b/api/machines/models.mdx index 780912e33b..2ac5c8513f 100644 --- a/api/machines/models.mdx +++ b/api/machines/models.mdx @@ -74,7 +74,20 @@ These are the data models used across the Machines API requests and responses, g | `org_slug` | `string` | No | | | `region` | `string` | No | | | `service_name` | `string` | No | | -| `type` | `string` | No | | +| `type` | `IPAssignmentType` | No | | + +## AssignIPResponse + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `created_at` | `string` | No | | +| `egress` | `boolean` | No | | +| `ip` | `string` | No | | +| `ip_pair` | `IPPair` | No | ip_pair is returned when "egress-pair" IP type is requested; in this case, ip is null. | +| `network` | `IPAssignmentNetwork` | No | | +| `region` | `string` | No | | +| `service_name` | `string` | No | | +| `shared` | `boolean` | No | | ## authenticateTokenRequest @@ -195,11 +208,18 @@ These are the data models used across the Machines API requests and responses, g | --- | --- | --- | --- | | `expiry` | `string` | No | | +## CreateAppDeployTokenResponse + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `token` | `string` | No | | + ## CreateAppRequest | Property | Type | Required | Description | | --- | --- | --- | --- | | `enable_subdomains` | `boolean` | No | | +| `idempotency_key` | `string` | No | When set, makes a retry of this exact request safe: a second create with the same key and the same name (or no name) returns the app the first request created, instead of erroring on a false name conflict or creating a duplicate. A second create with the same key but a *different* name is rejected outright; it won't silently hand back the first app. | | `name` | `string` | No | | | `network` | `string` | No | | | `org_slug` | `string` | No | | @@ -208,7 +228,8 @@ These are the data models used across the Machines API requests and responses, g | Property | Type | Required | Description | | --- | --- | --- | --- | -| `token` | `string` | No | | +| `created_at` | `integer` | No | | +| `id` | `string` | No | | ## createCustomCertificateRequest @@ -263,7 +284,7 @@ Optional parameters | Property | Type | Required | Description | | --- | --- | --- | --- | -| `type` | `string` | Yes | Backup type. — Enum: full, incr, diff | +| `type` | `string` | Yes | Backup type. Enum: full, incr, diff | ## createPostgresClusterRequest @@ -271,10 +292,10 @@ Optional parameters | --- | --- | --- | --- | | `disk_size_gb` | `integer` | No | Disk size in gigabytes. | | `name` | `string` | No | Name for the cluster. A name is generated when omitted. | -| `org_slug` | `string` | Yes | Slug of the organization that will own the cluster. | -| `pg_major_version` | `string` | No | Postgres major version. — Enum: 16, 17 | -| `plan` | `string` | Yes | Plan slug selecting CPU, memory, and disk sizing. — Enum: basic, starter, launch, scale, Performance | -| `pool_mode` | `string` | No | Connection pooler mode. — Enum: session, transaction | +| `org_slug` | `string` | Yes | Slug of the organization that will own the cluster, or "personal" for the caller's personal organization. | +| `pg_major_version` | `string` | No | Postgres major version. Enum: 16, 17 | +| `plan` | `string` | Yes | Plan slug selecting CPU, memory, and disk sizing. Matched case-insensitively. Enum: basic, starter, launch, scale, Performance | +| `pool_mode` | `string` | No | Connection pooler mode. Enum: session, transaction | | `postgis_enabled` | `boolean` | No | Enable PostGIS support, required to later enable PostGIS extensions. | | `region` | `string` | Yes | Fly region code where the cluster's primary runs. | @@ -282,14 +303,14 @@ Optional parameters | Property | Type | Required | Description | | --- | --- | --- | --- | -| `name` | `string` | Yes | Name of the database to create. | +| `name` | `string` | Yes | Name of the database to create. Must start and end with an alphanumeric character and may contain hyphens and underscores, up to 63 characters. | ## createPostgresUserRequest | Property | Type | Required | Description | | --- | --- | --- | --- | -| `role` | `string` | Yes | Role to grant the user. — Enum: schema_admin, writer, reader | -| `username` | `string` | Yes | Name for the new user. | +| `role` | `string` | Yes | Role to grant the user. Enum: schema_admin, writer, reader | +| `username` | `string` | Yes | Name for the new user. Must start and end with a lowercase alphanumeric character and may contain hyphens and underscores, up to 63 characters. | ## createPostgresUserResponse @@ -442,7 +463,7 @@ Optional parameters | `healthchecks` | `fly.ContainerHealthcheck[]` | No | Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command. | | `image` | `string` | No | Image is the docker image to run. | | `name` | `string` | No | Name is used to identify the container in the machine. | -| `restart` | `fly.MachineRestart` | No | Restart is used to define the restart policy for the container. NOTE: spot-price is not supported for containers. | +| `restart` | `fly.MachineRestart` | No | Restart is used to define the restart policy for the container. | | `secrets` | `fly.MachineSecret[]` | No | Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used. | | `stop` | `fly.StopConfig` | No | Stop is used to define the signal and timeout for stopping the container. | | `user` | `string` | No | UserOverride is used to override the default user of the image. | @@ -458,6 +479,8 @@ Optional parameters Type: `string` +Enum: exited_successfully, healthy, started + ## fly.ContainerHealthcheck | Property | Type | Required | Description | @@ -478,10 +501,14 @@ Type: `string` Type: `string` +Enum: readiness, liveness + ## fly.ContainerHealthcheckScheme Type: `string` +Enum: http, https + ## fly.DNSConfig | Property | Type | Required | Description | @@ -515,7 +542,7 @@ EnvVar defines an environment variable to be populated from a machine field, env | Property | Type | Required | Description | | --- | --- | --- | --- | | `env_var` | `string` | No | EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name. | -| `field_ref` | `string` | No | FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image. — Enum: id, version, app_name, private_ip, region, image | +| `field_ref` | `string` | No | FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image. Enum: id, version, app_name, private_ip, region, image | ## fly.ExecHealthcheck @@ -578,7 +605,7 @@ A file that will be written to the Machine. One of RawValue or SecretName must b | `grace_period` | `string` | No | The time to wait after a VM starts before checking its health | | `headers` | `fly.MachineHTTPHeader[]` | No | | | `interval` | `string` | No | The time between connectivity checks | -| `kind` | `string` | No | Kind of the check (informational, readiness) — Enum: informational, readiness | +| `kind` | `string` | No | Kind of the check (informational, readiness) Enum: informational, readiness | | `method` | `string` | No | For http checks, the HTTP method to use to when making the request | | `path` | `string` | No | For http checks, the path to send the request to | | `port` | `integer` | No | The port to connect to, often the same as internal_port | @@ -629,7 +656,8 @@ A file that will be written to the Machine. One of RawValue or SecretName must b | `kernel_args` | `string[]` | No | | | `max_memory_mb` | `integer` | No | | | `memory_mb` | `integer` | No | | -| `persist_rootfs` | `string` | No | Deprecated: use MachineConfig.Rootfs instead — Enum: never, always, restart | +| `persist_rootfs` | `string` | No | Deprecated: use MachineConfig.Rootfs instead Enum: never, always, restart | +| `required_host_features` | `string[]` | No | | ## fly.MachineHTTPHeader @@ -664,8 +692,10 @@ For http checks, an array of objects with string field Name and array of strings | Property | Type | Required | Description | | --- | --- | --- | --- | | `add_size_gb` | `integer` | No | | +| `add_size_percent` | `integer` | No | AddSizePercent grows by a percentage of the current size, rounded up to GiB. It is mutually exclusive with AddSizeGb. | | `encrypted` | `boolean` | No | | | `extend_threshold_percent` | `integer` | No | | +| `min_add_size_gb` | `integer` | No | MinAddSizeGb is the minimum proportional growth in GiB (default 1). | | `name` | `string` | No | | | `path` | `string` | No | | | `size_gb` | `integer` | No | | @@ -704,9 +734,8 @@ The Machine restart policy defines whether and how flyd restarts a Machine after | Property | Type | Required | Description | | --- | --- | --- | --- | -| `gpu_bid_price` | `number` | No | GPU bid price for spot Machines. | | `max_retries` | `integer` | No | When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop. | -| `policy` | `string` | No | * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price. — Enum: no, always, on-failure, spot-price | +| `policy` | `string` | No | * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. Enum: no, always, on-failure | ## fly.MachineRootfs @@ -729,7 +758,7 @@ A Secret needing to be set in the environment of the Machine. env_var is require | Property | Type | Required | Description | | --- | --- | --- | --- | | `autostart` | `boolean` | No | | -| `autostop` | `string` | No | Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. * "off" or false - Do not autostop the Machine. * "stop" or true - Automatically stop the Machine. * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible. — Enum: off, stop, suspend | +| `autostop` | `string` | No | Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. * "off" or false - Do not autostop the Machine. * "stop" or true - Automatically stop the Machine. * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible. Enum: off, stop, suspend | | `checks` | `fly.MachineServiceCheck[]` | No | An optional list of service checks | | `concurrency` | `fly.MachineServiceConcurrency` | No | | | `force_instance_description` | `string` | No | | @@ -773,6 +802,7 @@ A Secret needing to be set in the environment of the Machine. env_var is require | Property | Type | Required | Description | | --- | --- | --- | --- | +| `fly_src` | `boolean` | No | | | `version` | `string` | No | | ## fly.ReplayCache @@ -783,7 +813,7 @@ A Secret needing to be set in the environment of the Machine. env_var is require | `name` | `string` | No | Name of the cookie or header to key the cache on | | `path_prefix` | `string` | No | | | `ttl_seconds` | `integer` | No | | -| `type` | `string` | No | Currently either "cookie" or "header" — Enum: cookie, header | +| `type` | `string` | No | Currently either "cookie" or "header" Enum: cookie, header | ## fly.Static @@ -819,6 +849,8 @@ A Secret needing to be set in the environment of the Machine. env_var is require Type: `string` +Enum: stop + ## flydv1.ExecResponse | Property | Type | Required | Description | @@ -853,6 +885,7 @@ Type: `string` | Property | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | No | Name for the forked cluster. Defaults to the source name with a -fork suffix. | +| `plan` | `string` | No | Plan slug selecting CPU and memory sizing for the fork. Defaults to the source cluster's plan. Matched case-insensitively. Enum: basic, starter, launch, scale, Performance | ## getPostgresUserCredentialsResponse @@ -875,11 +908,37 @@ Type: `string` | Property | Type | Required | Description | | --- | --- | --- | --- | | `created_at` | `string` | No | | +| `egress` | `boolean` | No | | | `ip` | `string` | No | | +| `network` | `IPAssignmentNetwork` | No | | | `region` | `string` | No | | | `service_name` | `string` | No | | | `shared` | `boolean` | No | | +## IPAssignmentNetwork + +The 6PN network a Flycast (private_v6) address belongs to. Null for all other IP types. + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `name` | `string` | No | Network name; empty for the organization's default network. | +| `org_slug` | `string` | No | | + +## IPAssignmentType + +Type of IP address to allocate. "egress-pair" allocates both v4 and v6 egress IP addresses (recommended when using egress IPs). + +Type: `string` + +Enum: v4, v6, shared_v4, private_v6, egress_v4, egress_v6, egress_pair + +## IPPair + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `v4` | `string` | No | | +| `v6` | `string` | No | | + ## IssuedCertificate | Property | Type | Required | Description | @@ -903,7 +962,8 @@ Type: `string` | Property | Type | Required | Description | | --- | --- | --- | --- | | `apps` | `App[]` | No | | -| `total_apps` | `integer` | No | | +| `next_cursor` | `string` | No | Pagination cursor for the next page. Absent when no more apps remain. Cursors expire 30 minutes after the first page was requested. | +| `total_apps` | `integer` | No | The number of apps matching the request, across all pages. When paginating, it is counted once when the first page is requested and not updated afterwards, so it may differ slightly from the number of apps returned: it excludes apps created later and includes apps deleted while paginating. Apps created in the seconds before the first page may also be counted but missing from the pages. | ## listCertificatesResponse @@ -926,6 +986,12 @@ Type: `string` | --- | --- | --- | --- | | `ips` | `IPAssignment[]` | No | | +## listPostgresActiveQueriesResponse + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `data` | `PostgresActiveQuery[]` | No | | + ## listPostgresBackupsResponse | Property | Type | Required | Description | @@ -950,6 +1016,18 @@ Type: `string` | --- | --- | --- | --- | | `data` | `PostgresExtension[]` | No | | +## listPostgresPlansResponse + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `data` | `PostgresPlan[]` | No | | + +## listPostgresSlowQueriesResponse + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `data` | `PostgresSlowQuery[]` | No | | + ## listPostgresUsersResponse | Property | Type | Required | Description | @@ -979,11 +1057,12 @@ Type: `string` | `cordoned` | `boolean` | No | | | `created_at` | `string` | No | | | `events` | `MachineEvent[]` | No | | +| `host_features` | `string[]` | No | | | `host_status` | `string` | No | Enum: ok, unknown, unreachable | | `id` | `string` | No | | | `image_ref` | `ImageRef` | No | | | `incomplete_config` | `fly.MachineConfig` | No | | -| `instance_id` | `string` | No | InstanceID is unique for each version of the machine | +| `instance_id` | `string` | No | InstanceID is the same value as `version`. Deprecated: use `version`. | | `lease` | `StrippedLease` | No | | | `name` | `string` | No | | | `nonce` | `string` | No | Nonce is only every returned on machine creation if a lease_duration was provided. | @@ -991,6 +1070,7 @@ Type: `string` | `region` | `string` | No | | | `state` | `string` | No | | | `updated_at` | `string` | No | | +| `version` | `string` | No | Version is unique for each version of the machine. Pass it as `current_version` when updating the Machine to reject the update if the Machine has changed since this version. | ## MachineEvent @@ -1097,6 +1177,8 @@ Type: `string` Type: `string` +Enum: unknown, insufficient_capacity, volume_placement_capacity, name_taken + ## main.TokenAccess | Property | Type | Required | Description | @@ -1181,10 +1263,12 @@ Type: `string` | `created_at` | `string` | No | | | `encrypted` | `boolean` | No | | | `fstype` | `string` | No | | +| `host_features` | `string[]` | No | | | `host_status` | `string` | No | Enum: ok, unknown, unreachable | | `id` | `string` | No | | | `name` | `string` | No | | | `region` | `string` | No | | +| `required_host_features` | `string[]` | No | | | `size_gb` | `integer` | No | | | `snapshot_retention` | `integer` | No | | | `state` | `string` | No | | @@ -1221,6 +1305,22 @@ Type: `string` Type: `map` +## PostgresActiveQuery + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `application_name` | `string` | No | Application connected to the backend. | +| `client` | `string` | No | Client address. | +| `database` | `string` | No | Database name. | +| `duration_seconds` | `number` | No | Query duration in seconds. | +| `pid` | `integer` | No | Process ID of the backend running the query. | +| `query` | `string` | No | Full query text. | +| `state` | `string` | No | Current backend state. | +| `state_duration_seconds` | `number` | No | Time spent in the current state, in seconds. | +| `user` | `string` | No | User running the query. | +| `wait_event` | `string` | No | Event the backend is waiting for. | +| `wait_event_type` | `string` | No | Type of event the backend is waiting for. | + ## PostgresAttachedApp | Property | Type | Required | Description | @@ -1244,28 +1344,30 @@ Type: `map` | `size_bytes` | `integer` | No | Backup size in bytes. | | `started_at` | `string` | No | RFC 3339 start timestamp. | | `status` | `string` | No | Backup status. | -| `type` | `string` | No | Backup type. — Enum: full, incr, diff | +| `type` | `string` | No | Backup type. Enum: full, incr, diff | ## PostgresCluster | Property | Type | Required | Description | | --- | --- | --- | --- | | `attached_apps` | `PostgresAttachedApp[]` | No | Apps attached to the cluster. | -| `cpu_kind` | `string` | No | CPU class. — Enum: shared, performance | +| `cpu_kind` | `string` | No | CPU class. Enum: shared, performance | | `cpus` | `integer` | No | vCPUs per node. | | `created_at` | `string` | No | RFC 3339 creation timestamp. | -| `disk_size_gb` | `integer` | No | Disk size in gigabytes. | +| `disk_size_gb` | `integer` | No | Disk size in gigabytes, for one replica. | | `endpoints` | `PostgresClusterEndpoints` | No | Connection endpoints. Populated once the cluster is ready. | | `id` | `string` | No | Cluster ID. | | `memory_mb` | `integer` | No | Memory per node in megabytes. | | `name` | `string` | No | Cluster name. | | `organization` | `OrganizationRef` | No | | -| `pg_major_version` | `string` | No | Postgres major version. — Enum: 16, 17 | -| `plan` | `string` | No | Plan slug. — Enum: basic, starter, launch, scale, Performance | +| `pg_major_version` | `string` | No | Postgres major version. Enum: 16, 17 | +| `plan` | `string` | No | Plan slug. Enum: basic, starter, launch, scale, Performance | | `postgis_enabled` | `boolean` | No | Whether PostGIS support is enabled. | | `region` | `string` | No | Fly region code. | | `replicas` | `integer` | No | Number of replicas. | -| `status` | `string` | No | Current lifecycle status. — Enum: creating, initializing, ready, deleting, deleted, failed | +| `status` | `string` | No | Current lifecycle status. Enum: creating, initializing, ready, deleting, deleted, failed | +| `storage_provisioned_bytes` | `integer` | No | Storage provisioned, summed across the cluster's volumes and measured hourly. Null until first measured. | +| `storage_used_bytes` | `integer` | No | Storage used, summed across the cluster's volumes and measured hourly. Null until first measured. | ## PostgresClusterEndpoints @@ -1282,9 +1384,9 @@ Type: `map` | `deleted_at` | `string` | No | RFC 3339 deletion timestamp; present for deleted clusters. | | `id` | `string` | No | Cluster ID. | | `name` | `string` | No | Cluster name. | -| `plan` | `string` | No | Plan slug. — Enum: basic, starter, launch, scale, Performance | +| `plan` | `string` | No | Plan slug. Enum: basic, starter, launch, scale, Performance | | `region` | `string` | No | Fly region code. | -| `status` | `string` | No | Current lifecycle status. — Enum: creating, initializing, ready, deleting, deleted, failed | +| `status` | `string` | No | Current lifecycle status. Enum: creating, initializing, ready, deleting, deleted, failed | ## PostgresDatabase @@ -1310,6 +1412,7 @@ Type: `map` | Property | Type | Required | Description | | --- | --- | --- | --- | | `error` | `string` | No | Human-readable error message. | +| `status` | `string` | No | Optional machine-readable error status. | ## PostgresExtension @@ -1335,11 +1438,34 @@ Type: `map` | `direct` | `PostgresEndpoint` | No | Unpooled connection to the cluster node. | | `pooler` | `PostgresEndpoint` | No | Pooled connection to the cluster node (through PgBouncer). | +## PostgresPlan + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `cpu_kind` | `string` | No | CPU class. Enum: shared, performance | +| `cpus` | `integer` | No | vCPUs per node. | +| `memory_mb` | `integer` | No | Memory per node in megabytes. | +| `monthly_price_usd` | `integer` | No | Base monthly price in US dollars. | +| `plan` | `string` | No | Plan slug. Pass it as `plan` when creating or forking a cluster. Enum: basic, starter, launch, scale, Performance | + +## PostgresSlowQuery + +| Property | Type | Required | Description | +| --- | --- | --- | --- | +| `calls` | `integer` | No | Cumulative number of executions. | +| `database` | `string` | No | Database name. | +| `max_exec_time_seconds` | `number` | No | Maximum execution time in seconds. | +| `mean_exec_time_seconds` | `number` | No | Mean execution time in seconds. | +| `query` | `string` | No | Full query pattern. | +| `query_id` | `string` | No | Query identifier. | +| `total_exec_time_seconds` | `number` | No | Cumulative total execution time in seconds. | +| `user` | `string` | No | User running the query. | + ## PostgresUser | Property | Type | Required | Description | | --- | --- | --- | --- | -| `role` | `string` | No | User role. — Enum: schema_admin, writer, reader | +| `role` | `string` | No | User role. Enum: schema_admin, writer, reader | | `username` | `string` | No | User name. | ## PostgresUserCredentials @@ -1366,6 +1492,8 @@ Type: `map` Type: `integer` +Enum: 1, 2, 4, 8, 16, 31, 0 + ## restorePostgresClusterRequest | Property | Type | Required | Description | @@ -1492,7 +1620,7 @@ Type: `integer` | Property | Type | Required | Description | | --- | --- | --- | --- | | `config` | `fly.MachineConfig` | No | An object defining the Machine configuration | -| `current_version` | `string` | No | | +| `current_version` | `string` | No | CurrentVersion is an optional optimistic-concurrency guard: the Machine's `version`, as returned by create, get or a previous update. When set and it is no longer the Machine's current version, the update is rejected with 409 Conflict and nothing changes. Omit it to update unconditionally. | | `lease_ttl` | `integer` | No | | | `min_secrets_version` | `integer` | No | | | `name` | `string` | No | Unique name for this Machine. If omitted, one is generated for you | @@ -1513,7 +1641,7 @@ Type: `integer` | Property | Type | Required | Description | | --- | --- | --- | --- | -| `role` | `string` | Yes | New role for the user. — Enum: schema_admin, writer, reader | +| `role` | `string` | Yes | New role for the user. Enum: schema_admin, writer, reader | ## UpdateVolumeRequest @@ -1552,10 +1680,12 @@ Type: `integer` | `created_at` | `string` | No | | | `encrypted` | `boolean` | No | | | `fstype` | `string` | No | | +| `host_features` | `string[]` | No | | | `host_status` | `string` | No | Enum: ok, unknown, unreachable | | `id` | `string` | No | | | `name` | `string` | No | | | `region` | `string` | No | | +| `required_host_features` | `string[]` | No | | | `size_gb` | `integer` | No | | | `snapshot_retention` | `integer` | No | | | `state` | `string` | No | | @@ -1581,4 +1711,4 @@ Type: `integer` | `event_id` | `string` | No | | | `ok` | `boolean` | No | | | `state` | `string` | No | | -| `version` | `string` | No | | \ No newline at end of file +| `version` | `string` | No | |