// @generated by protoc-gen-panel-rust from v1/panel.proto. DO NOT EDIT.
//! The API's messages, enums and oneofs.
//!
//! A struct without `#[non_exhaustive]` is one a request holds: write it as a literal that ends in
//! `..Default::default()`.
//!
//! # JSON
//!
//! Every struct and enum here is `serde`'s `Serialize` and `Deserialize`, and its JSON is the
//! API's own, as the API answers and takes it over HTTP and as
//! [its reference](https://pethost.dev/docs/api/) shows it:
//!
//! - a field under its name in the proto, as the struct has it: `project_id`;
//! - a field that is absent, or an unmarked one at its zero, left out;
//! - an enum as its value's name, `"OPERATION_STATUS_RUNNING"`, and a value this version does
//! not know, `Unrecognized(number)`, as the number;
//! - a 64-bit integer as a string, a time as RFC 3339, bytes as base64;
//! - a oneof as the field of the member that is set, beside its message's other fields. A
//! oneof's enum has no JSON of its own, and its `Unrecognized` is written as no member.
//!
//! Reading takes the same form, and a 64-bit integer as a number too. It refuses a field this
//! version does not know, any other spelling of one (`projectId`) and an enum's name it does
//! not know, as the API refuses a field it does not have: a misspelled field cannot make a call
//! that does something else. The JSON of a later API, with a field added since, is refused so
//! too.
//!
//! ```
//! use pethost::types::{FileChange, FileChangeChange};
//!
//! fn main() -> Result<(), serde_json::Error> {
//! let change = FileChange {
//! path: "/hello.txt".into(),
//! change: Some(FileChangeChange::Text("Hello".into())),
//! ..Default::default()
//! };
//!
//! // The API's JSON, and the message back from it.
//! let json = serde_json::to_string(&change)?;
//! assert_eq!(json, r#"{"path":"/hello.txt","text":"Hello"}"#);
//! assert_eq!(serde_json::from_str::<FileChange>(&json)?, change);
//!
//! // A field the API does not have is refused: here, one misspelled.
//! assert!(serde_json::from_str::<FileChange>(r#"{"pth": "/hello.txt"}"#).is_err());
//! Ok(())
//! }
//! ```
/// What [`Client::get_machine`](crate::Client::get_machine) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetMachineRequest {}
/// What [`Client::get_machine`](crate::Client::get_machine) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetMachineResponse {
pub machine: ::core::option::Option<Machine>,
/// By `project_id`.
pub projects: ::std::vec::Vec<ProjectSummary>,
/// Projects no longer on the machine whose snapshots remain, the most recently backed up first; restore one with [`RunProjectActionRequestAction::RestoreSnapshot`](crate::types::RunProjectActionRequestAction::RestoreSnapshot) and its `project_id`. Current after the machine's own backups and deletes; changes made to the backup repository elsewhere show later. Not known while [`Machine::snapshot_list_time`](crate::types::Machine::snapshot_list_time) is absent.
pub deleted_projects: ::std::vec::Vec<DeletedProject>,
pub github: ::core::option::Option<GithubConnection>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Machine {
/// Its plan's name, e.g. \"Starter\".
pub name: ::std::string::String,
/// Where it runs, e.g. \"Europe\". Empty = not known.
pub location: ::std::string::String,
/// When the figures below were read.
pub sample_time: ::core::option::Option<crate::Timestamp>,
/// By projects and builds.
pub cpu_used_cores: f64,
pub cpu_total_cores: f64,
/// Without page cache, as `docker stats` counts.
pub memory_used_bytes: u64,
/// The machine's, less a reserve for the system.
pub memory_total_bytes: u64,
/// The projects\' disk. The operating system has its own partition outside it, and the machine's own files are left out: a new machine uses 0.
pub disk_used_bytes: u64,
pub disk_total_bytes: u64,
pub disk_usage: ::core::option::Option<DiskUsage>,
/// The machine's name: what the person's own domains point at (a CNAME), and where they log in to a service's container ([`Service::ssh_command`](crate::types::Service::ssh_command)). [`Client::create_transfer`](crate::Client::create_transfer)\'s URLs are on it as well, and no route can take it.
pub hostname: ::std::string::String,
/// \"SHA256:\.\.\.\", to check on the first connection.
pub ssh_host_key_fingerprint: ::std::string::String,
/// The person's public keys: each logs in to every container. Empty = none yet: nobody can log in until [`RunMachineActionRequestAction::AddSshKey`](crate::types::RunMachineActionRequestAction::AddSshKey) adds one.
pub ssh_keys: ::std::vec::Vec<SshKey>,
/// True = every project is backed up nightly, and on demand. False, always written = nothing is backed up: there are no snapshots, and a deleted project or volume is gone for good.
pub backups_enabled: bool,
/// When the machine last read the backup repository's list of snapshots whole. Absent = not yet (`snapshot_list_failure_message` says why, once a read failed), or backups are off: snapshot counts, [`Volume::last_backup_time`](crate::types::Volume::last_backup_time), [`Project::snapshots`](crate::types::Project::snapshots) and [`GetMachineResponse::deleted_projects`](crate::types::GetMachineResponse::deleted_projects) are then not known, rather than none.
pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
/// Why the machine could not read that list, while backups are on and `snapshot_list_time` is absent: the backup repository's error, e.g. a wrong password or a host that does not answer. The machine keeps trying. Empty = no read has failed, or the list is known, or backups are off.
pub snapshot_list_failure_message: ::std::string::String,
/// Snapshots are pruned once they are this many hours older than their project's newest. 0 = kept forever: nothing deletes them.
pub backup_retention_hours: u32,
/// True = a host that no certificate installed on the machine covers gets one from Let's Encrypt once it resolves to the machine. False, always written = such a host serves plain HTTP only.
pub acme_enabled: bool,
/// The person's domain on Pethost, e.g. \"sam.pethost.app\": theirs alone, so \"my domain\" or \"my Pethost domain\" means this one unless they name another. A route's host `<name>.<apps_domain>`, or `apps_domain` itself, works at once over HTTPS, with no DNS record to make, and a web port a project publishes gets such a host by itself ([`Client::create_project`](crate::Client::create_project)). Only the person changes it, in the panel's settings. Empty = there is none: every host is a domain the person owns, and published ports all open on the machine.
pub apps_domain: ::std::string::String,
pub daemon_version: ::std::string::String,
pub docker_version: ::std::string::String,
pub boot_time: ::core::option::Option<crate::Timestamp>,
/// When an update started to need a machine restart. Absent = none is needed.
pub restart_required_time: ::core::option::Option<crate::Timestamp>,
/// When [`RunMachineActionRequestAction::RestartMachine`](crate::types::RunMachineActionRequestAction::RestartMachine) will restart it; later while what it waits for is still going on ([`RestartMachineAction::interrupt_operations`](crate::types::RestartMachineAction::interrupt_operations)). Absent = not scheduled.
pub scheduled_restart_time: ::core::option::Option<crate::Timestamp>,
/// What people have open in the containers now, oldest first: at most 100, the most the machine holds at once.
pub sessions: ::std::vec::Vec<MachineSession>,
/// Where Pethost tells the person of incidents: the account's channels that are on, email first, then the oldest. The person sets them in the panel's Settings → Alerts; no tool does. Empty = alerts reach nobody.
pub alert_channels: ::std::vec::Vec<AlertDestination>,
/// The databases the machine makes ([`Client::create_project`](crate::Client::create_project)\'s `database`), one per engine, with the sizes they may take. Empty = the machine's software predates databases.
pub database_engines: ::std::vec::Vec<DatabaseEngineOffer>,
/// The sum of every service's memory limit (`mem_limit`): what the projects may take together, which `memory_total_bytes` does not reserve.
pub memory_limits_bytes: u64,
}
/// A channel Pethost tells the person of incidents on ([`Machine::alert_channels`](crate::types::Machine::alert_channels)).
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct AlertDestination {
pub kind: AlertChannelKind,
/// The chat's title, or \"#ops · Acme\". Empty for email.
pub label: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum AlertChannelKind {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// The account's email.
Email,
/// A Telegram chat or group.
Telegram,
/// A Slack channel.
Slack,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// Something a person has open in a container: a web terminal (`OpenTerminal`), a database's client (`OpenDatabaseClient`), or, through SSH, a program, SFTP or one connection of a tunnel. It lasts until the program exits or the connection closes; [`RunMachineActionRequestAction::EndSessionId`](crate::types::RunMachineActionRequestAction::EndSessionId) ends it sooner.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineSession {
/// For [`RunMachineActionRequestAction::EndSessionId`](crate::types::RunMachineActionRequestAction::EndSessionId).
pub session_id: ::std::string::String,
pub kind: MachineSessionKind,
pub project_id: ::std::string::String,
pub service: ::std::string::String,
/// TUNNEL: the container's port.
pub port: u32,
pub start_time: ::core::option::Option<crate::Timestamp>,
/// The person's IP address.
pub client_address: ::std::string::String,
/// Through SSH: the key they logged in with, as it was then. Empty for `WEB_TERMINAL` and `DATABASE_CLIENT`.
pub ssh_key_label: ::std::string::String,
pub ssh_key_fingerprint: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum MachineSessionKind {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// The web panel's terminal.
WebTerminal,
/// A program in a terminal, such as `ssh`\'s shell.
SshTerminal,
/// A program without a terminal, such as `ssh ... <command>` or rsync.
SshCommand,
/// scp, sftp or sshfs.
Sftp,
/// One connection of an `ssh -L` tunnel to `port`.
Tunnel,
/// The web panel's client of a database.
DatabaseClient,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// Where the disk goes; the rest of `disk_used_bytes` is the filesystem's own metadata and the machine's small files. Measured every few minutes.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DiskUsage {
pub images_bytes: u64,
/// Absent = not known: Docker cannot size the build cache.
pub build_cache_bytes: ::core::option::Option<u64>,
pub volumes_bytes: u64,
/// What containers wrote outside volumes.
pub container_layers_bytes: u64,
/// Project directories and operation logs.
pub project_files_bytes: u64,
/// Kept on the operating system's partition, outside `disk_used_bytes`; the machine bounds their age and size ([`QueryContainerLogsResponse::oldest_kept_time`](crate::types::QueryContainerLogsResponse::oldest_kept_time)).
pub container_logs_bytes: u64,
/// The HTTP request log.
pub http_traffic_bytes: u64,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct SshKey {
/// The public key, as in `authorized_keys`: \"ssh-ed25519 AAAA\.\.\.\"; never a private key.
pub public_key: ::std::string::String,
/// Shown in the panel and session logs, e.g. \"MacBook Pro\".
pub label: ::std::string::String,
/// \"SHA256:\.\.\.\". Ignored on input.
pub fingerprint: ::std::string::String,
}
/// The panel's GitHub App, one for every account: projects are created from the repositories of the account's own installations of it. Absent = GitHub is not set up on this panel.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GithubConnection {
/// As in https://github.com/apps/\<`app_name`\>.
pub app_name: ::std::string::String,
/// The panel's page that sends a signed-in person to GitHub to install the app on their repositories, or to change which.
pub install_url: ::std::string::String,
/// The repositories of the account's installations, most recently pushed first, at most 200.
pub repositories: ::std::vec::Vec<GithubRepository>,
/// In all.
pub repository_count: u32,
/// False = pushes reach the panel only by its check every 5 minutes, not at once.
pub webhooks_enabled: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GithubRepository {
/// \"owner/name\".
pub repository: ::std::string::String,
pub default_branch: ::std::string::String,
pub private: bool,
pub push_time: ::core::option::Option<crate::Timestamp>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DeletedProject {
pub project_id: ::std::string::String,
/// Restore it to bring the project back as it was last backed up; [`Client::get_project`](crate::Client::get_project) then pages the older ones (`snapshots_before`).
pub newest_snapshot: ::core::option::Option<Snapshot>,
/// In all.
pub snapshot_count: u32,
}
/// What [`Client::run_machine_action`](crate::Client::run_machine_action) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunMachineActionRequest {
pub action: ::core::option::Option<RunMachineActionRequestAction>,
}
/// The oneof [`RunMachineActionRequest::action`](crate::types::RunMachineActionRequest::action): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum RunMachineActionRequestAction {
/// label: one line, ≤100 chars; empty = the key's comment. An existing key gets the new label.
AddSshKey(SshKey),
/// A [`Machine::ssh_keys`](crate::types::Machine::ssh_keys) fingerprint; its sessions end. [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = no such key.
RemoveSshKeyFingerprint(::std::string::String),
/// Containers come back per restart policy. A new call before the restart replaces it; after ([`Machine::boot_time`](crate::types::Machine::boot_time) changed), restarts again.
RestartMachine(RestartMachineAction),
/// True = cancels the scheduled restart.
CancelRestart(bool),
/// A [`Machine::sessions`](crate::types::Machine::sessions) id: ends it now (its key can open new ones until removed). [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = ended.
EndSessionId(::std::string::String),
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RestartMachineAction {
/// Absent = now, or `at_maintenance_window`. [`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument) = in the past.
pub restart_time: ::core::option::Option<crate::Timestamp>,
/// True = the next nightly window ([`Machine::scheduled_restart_time`](crate::types::Machine::scheduled_restart_time)). Not with `restart_time`.
pub at_maintenance_window: bool,
/// False = wait for operations and nightly backups to end; true = cut them short.
pub interrupt_operations: bool,
}
/// What [`Client::run_machine_action`](crate::Client::run_machine_action) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunMachineActionResponse {
/// As changed.
pub machine: ::core::option::Option<Machine>,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectMetadata {
/// Empty = none: people see the id.
pub name: ::core::option::Option<::std::string::String>,
pub emoji: ::core::option::Option<::std::string::String>,
/// One line.
pub description: ::core::option::Option<::std::string::String>,
/// Free text.
pub notes: ::core::option::Option<::std::string::String>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectSummary {
pub project_id: ::std::string::String,
pub metadata: ::core::option::Option<ProjectMetadata>,
/// Most urgent first. Empty = nothing wrong.
pub problems: ::std::vec::Vec<ProjectProblem>,
/// By name.
pub services: ::std::vec::Vec<ServiceSummary>,
/// The first route's host as a URL, e.g. \"https://recipes.example.com\". Empty = no route.
pub url: ::std::string::String,
/// Every host its routes use, in the routes\' order.
pub hosts: ::std::vec::Vec<::std::string::String>,
/// The last day's requests, 5xx responses and latency, as in Project: [`Client::query_http_traffic`](crate::Client::query_http_traffic) says which paths. Absent = no request.
pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
pub cpu_used_cores: f64,
pub memory_used_bytes: u64,
/// As in Project.
pub deploy_time: ::core::option::Option<crate::Timestamp>,
/// Operations in progress, newest first: a backup can run beside another one.
pub running_operations: ::std::vec::Vec<Operation>,
/// A github project stays on its commit: [`GithubSource::pinned`](crate::types::GithubSource::pinned).
pub pinned: bool,
/// Its volumes, files, what its containers wrote outside volumes, and its images: one it shares with another project counts in both. Measured every few minutes.
pub disk_used_bytes: u64,
/// Set = a database project ([`Client::create_project`](crate::Client::create_project) `database`).
pub database: ::core::option::Option<DatabaseSummary>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ServiceSummary {
pub service: ::std::string::String,
pub state: ServiceState,
}
/// Something that needs attention. A service has at most one, its cause first.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectProblem {
pub kind: ProjectProblemKind,
/// Empty = not about one service. `DEPLOY_FAILED`: the service that failed it, when one did.
pub service: ::std::string::String,
/// `DEPLOY_FAILED`, `DEPLOY_CANCELLED`, `BACKUP_FAILED`, `RESTORE_FAILED`: the operation; [`Client::get_operation`](crate::Client::get_operation) gives its log.
pub operation_id: ::std::string::String,
/// `DEPLOY_FAILED`, `DEPLOY_CANCELLED`, `BACKUP_FAILED`, `RESTORE_FAILED`: the operation's end. `SERVICE_EXITED`, RESTARTING and `OUT_OF_MEMORY`: when its last run ended, once it did; else its last start. `AUTO_DEPLOY_REFUSED`: when auto-deploy tried the commit. Absent = not known, as for UNHEALTHY.
pub since_time: ::core::option::Option<crate::Timestamp>,
/// One sentence for people, without a time of day (`since_time` has it), e.g. \"bot fails its healthcheck: 11 failures in a row\". A failed or cancelled deploy's also says whether it changed the project.
pub problem_message: ::std::string::String,
/// The open incident that records it ([`Project::incidents`](crate::types::Project::incidents)). Empty = none yet.
pub incident_id: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ProjectProblemKind {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// The latest deploy failed. Its operation says why, and with `made_current` whether its files were applied (then some containers may run the old configuration).
DeployFailed,
/// Running; its healthcheck fails.
ServiceUnhealthy,
/// Docker is restarting it, or it runs and Docker restarted it recently: likely a crash loop.
ServiceRestarting,
/// Its last run was killed for exceeding its memory, or a process of it was since it started. A loop whose runs last 10 s or more shows as RESTARTING: Docker forgets the kill when it starts it again.
ServiceOutOfMemory,
/// The latest backup failed; its operation says why.
BackupFailed,
/// The latest deploy was cancelled; its operation says, with `made_current`, whether its files were applied.
DeployCancelled,
/// It exited on its own with a non-zero code ([`Service::exit_code`](crate::types::Service::exit_code)) and stays down: its restart policy does not restart it. A service a person stopped is no problem.
ServiceExited,
/// A restore failed or was cancelled, or a machine restart cut it short, and its harm remains: services it stopped are still stopped (starting them ends it); unless a restore that succeeded since replaced them, its volumes may be partly restored, and its operation's `undo_snapshot_id` holds them as they were. Or it brought a deleted project back, and no deploy has replaced it. The newest such restore counts; one that changed nothing does not.
RestoreFailed,
/// Auto-deploy is on, and the machine refused the commit it last tried, the branch's newest then, which the files are not; the message says why. Each commit is tried once: fix it and push, or [`Client::deploy_project`](crate::Client::deploy_project) with `newest_commit`, whose refusal gives the violations.
AutoDeployRefused,
/// It runs and does not listen on the port a route sends to (or only at 127.0.0.1, which the proxy cannot reach): the route answers 502. The message names the ports it does listen on ([`Service::listening_ports`](crate::types::Service::listening_ports)): change the route's port with [`DeployProjectRequest::x_pethost`](crate::types::DeployProjectRequest::x_pethost), or the app.
ServicePortClosed,
/// A site check ([`Project::alerts`](crate::types::Project::alerts)) failed 3 times in a row; service: the one its route sends to.
SiteDown,
/// A traffic rule on 5xx holds.
HttpErrors,
/// A traffic rule on p95 holds.
HttpSlow,
/// A database the machine has not set up for 2 minutes since it started, or whose apps\' user is gone: the message says the engine's error.
DatabaseSetup,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What [`Client::get_project`](crate::Client::get_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetProjectRequest {
pub project_id: ::std::string::String,
/// True = include env-file values ([`EnvironmentVariable::secret`](crate::types::EnvironmentVariable::secret)) and a database's password ([`Project::database`](crate::types::Project::database)`.connection`). To edit .env: [`Client::read_path`](crate::Client::read_path) /.env.
pub include_secret_values: bool,
/// Only older snapshots: the oldest `create_time` seen, to page back. Absent = the newest.
pub snapshots_before: ::core::option::Option<crate::Timestamp>,
/// Only snapshots holding this volume ([`Volume::snapshot_count`](crate::types::Volume::snapshot_count)). Empty = all.
pub snapshots_volume: ::std::string::String,
/// Only incidents that opened before it: the oldest `open_time` seen, to page back. Absent = the newest.
pub incidents_before: ::core::option::Option<crate::Timestamp>,
/// ≤90: [`Project::uptime_days`](crate::types::Project::uptime_days). 0 = none.
pub uptime_day_count: u32,
/// With `incidents_before`: the `incident_id` of the oldest seen, so that those that opened at the same time are not skipped.
pub incidents_before_id: ::std::string::String,
}
/// What [`Client::get_project`](crate::Client::get_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetProjectResponse {
pub project: ::core::option::Option<Project>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Project {
pub project_id: ::std::string::String,
pub metadata: ::core::option::Option<ProjectMetadata>,
pub problems: ::std::vec::Vec<ProjectProblem>,
/// As in [`ProjectSummary`](crate::types::ProjectSummary).
pub url: ::std::string::String,
pub cpu_used_cores: f64,
pub memory_used_bytes: u64,
/// The `operation_id` of the deploy whose files the project has. For a deleted project brought back, the RESTORE that did it. Empty = no deploy yet.
pub deploy_id: ::std::string::String,
/// How that operation went, or is going. Unspecified = no deploy yet.
pub deploy_status: OperationStatus,
/// When the current deploy made its files the project's. Absent = no deploy yet, or one that failed or was cancelled leaving no service with a container: nothing runs.
pub deploy_time: ::core::option::Option<crate::Timestamp>,
/// True = the current deploy succeeded and every service has a container, so a deploy whose files differ only inside `x-pethost` (or not at all) applies at once, with no build or pull, and no restart but the one [`Client::deploy_project`](crate::Client::deploy_project) names. False = the next deploy runs in full.
pub x_pethost_applies_at_once: bool,
/// By name.
pub services: ::std::vec::Vec<Service>,
/// Every one the machine holds for the project, by name.
pub volumes: ::std::vec::Vec<Volume>,
/// x-pethost.routes as the machine holds them, in order: the list `x_pethost.routes` replaces, so send these back with your change to add, change or remove one.
pub routes: ::std::vec::Vec<Route>,
/// Every host of the routes, in the order of its first route.
pub hosts: ::std::vec::Vec<Host>,
/// True = every route asks visitors for the project's password (`x_pethost.password`). The password itself is never returned.
pub password_protected: bool,
/// Newest first, every one the machine keeps: the newest 20, any still in progress, and however old, the current deploy's (`deploy_id`) and those whose files it keeps for a rollback ([`Operation::files_kept`](crate::types::Operation::files_kept)). Older ones are gone.
pub operations: ::std::vec::Vec<Operation>,
/// The newest 10, newest first, of those [`GetProjectRequest`](crate::types::GetProjectRequest)\'s `snapshots_before` and `snapshots_volume` select. Empty while backups are off or the list is not read yet (`snapshot_list_time`).
pub snapshots: ::std::vec::Vec<Snapshot>,
/// The project's, in all; see `snapshot_list_time`.
pub snapshot_count: u32,
/// When the machine read the list of snapshots that `snapshot_count`, [`Volume::snapshot_count`](crate::types::Volume::snapshot_count) and [`Volume::last_backup_time`](crate::types::Volume::last_backup_time) come from ([`Machine::snapshot_list_time`](crate::types::Machine::snapshot_list_time), as sampled with them). Absent = the list is not known: backups are off, or it is not read yet ([`Machine::snapshot_list_failure_message`](crate::types::Machine::snapshot_list_failure_message) says why); a count of 0 then does not mean none.
pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
/// Measured every few minutes.
pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
pub source: ::core::option::Option<ProjectSource>,
/// The `start_services`, `stop_services` or `restart_services` that runs now, whoever called it ([`Client::run_project_action`](crate::Client::run_project_action) waits for its end). Until then the project takes no other action or deploy, and [`Service::state`](crate::types::Service::state) is still what it was before. Absent = none.
pub running_services_action: ::core::option::Option<RunningServicesAction>,
/// What Pethost watches and how each part stands. Absent = the machine's software predates alerts: they come with its next update.
pub alerts: ::core::option::Option<ProjectAlerts>,
/// The newest 5 that [`GetProjectRequest::incidents_before`](crate::types::GetProjectRequest::incidents_before) selects, newest first: an open one in full but its evidence (`GetIncident`), a resolved one as its id, kind, times, message, `after_operation_id`, `quiet_reason` and flapping.
pub incidents: ::std::vec::Vec<Incident>,
/// True = older ones remain: page with `incidents_before` and `incidents_before_id`.
pub more_incidents: bool,
/// Oldest first, [`GetProjectRequest::uptime_day_count`](crate::types::GetProjectRequest::uptime_day_count) of them, today's last.
pub uptime_days: ::std::vec::Vec<UptimeDay>,
/// Set = a database project ([`Client::create_project`](crate::Client::create_project) `database`): its engine, its state and how apps sign in.
pub database: ::core::option::Option<Database>,
/// The database projects this one reaches ([`Client::link_database`](crate::Client::link_database)), each at the host of its `project_id`.
pub linked_databases: ::std::vec::Vec<::std::string::String>,
}
/// A start, stop or restart of services that has not ended yet.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunningServicesAction {
pub kind: ServicesActionKind,
/// Those it acts on.
pub services: ::std::vec::Vec<::std::string::String>,
pub start_time: ::core::option::Option<crate::Timestamp>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ServicesActionKind {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Start,
Stop,
Restart,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// Where the files come from (THE PROJECT IS ITS DIRECTORY).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectSource {
pub kind: ::core::option::Option<ProjectSourceKind>,
}
/// The oneof [`ProjectSource::kind`](crate::types::ProjectSource::kind): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum ProjectSourceKind {
/// True = the files live on the machine.
Files(bool),
Github(GithubSource),
/// A member this version of the crate does not know: the API set none it knows, and sent
/// fields it does not know. Sent, it counts as no member.
Unrecognized,
}
/// Input: an absent field keeps its value (`set_source`) or takes its default (new source).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GithubSource {
/// \"owner/name\", one of [`GetMachineResponse::github`](crate::types::GetMachineResponse::github)`.repositories`.
pub repository: ::core::option::Option<::std::string::String>,
/// Empty = the default branch, also when absent on a new source.
pub branch: ::core::option::Option<::std::string::String>,
/// The project's directory in it, e.g. \"apps/web\"; empty = the root.
pub directory: ::core::option::Option<::std::string::String>,
/// True = deploy each new `newest_commit`, each tried once. Deploying another commit turns it off; only `set_source` turns it on. Default true; always written on output.
pub auto_deploy: ::core::option::Option<bool>,
/// Output: the branch's newest commit touching the directory, as of the last push or 5-minute check.
pub newest_commit: ::core::option::Option<GithubCommit>,
/// Output: the commit the files are at. Absent = no deploy, or the files came from another source.
pub deployed_commit: ::core::option::Option<GithubCommit>,
/// Output: `deployed_commit` set and `auto_deploy` off, e.g. after a rollback.
pub pinned: bool,
/// Output: true = auto-deploy will deploy `newest_commit` (not yet tried) once the project is free. A tried commit that failed or was refused waits for a person: [`Client::deploy_project`](crate::Client::deploy_project) or a new push.
pub auto_deploy_pending: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GithubCommit {
/// Full.
pub sha: ::std::string::String,
/// First line of its message. Untrusted.
pub title: ::std::string::String,
/// On github.com.
pub url: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Service {
pub service: ::std::string::String,
pub state: ServiceState,
/// True = its container runs, as [`Client::run_service_command`](crate::Client::run_service_command), `OpenTerminal` and [`Client::read_path`](crate::Client::read_path) of its own files (outside volumes) need: in RUNNING, HEALTHY and UNHEALTHY, and in STARTING once its process started.
pub container_running: bool,
/// The image as compose.yaml names it; for `build:` without `image:`, the name Compose gives.
pub image: ::std::string::String,
/// Built on the machine from a `build:` section.
pub builds_image: bool,
/// The registry digest it was pulled as, \"sha256:\.\.\.\". Empty for a built image.
pub image_digest: ::std::string::String,
/// Absent until the machine next measures sizes, every few minutes, as after a build or pull.
pub image_size_bytes: u64,
/// What the main process runs, as compose.yaml writes it (entrypoint, then command), `${...}` not interpolated, so that no value of an env file shows; the image's own argv when compose.yaml writes neither. Empty = not known without those values: compose.yaml loads only interpolated, e.g. with an `include` path from .env.
pub command: ::std::vec::Vec<::std::string::String>,
pub run_as_user: ::std::string::String,
/// Of the current or last run.
pub start_time: ::core::option::Option<crate::Timestamp>,
/// Set once it exited, and while Docker waits to restart it: when, with what code (0 = a clean exit: a job that finished, or a server stopped; 137 = killed), and whether a process of it was killed for exceeding its memory.
pub finish_time: ::core::option::Option<crate::Timestamp>,
pub exit_code: ::core::option::Option<i32>,
pub out_of_memory: bool,
/// Restarts by Docker since the container was created.
pub restart_count: u32,
pub cpu_used_cores: f64,
pub memory_used_bytes: u64,
/// 0 = no limit: it shares the machine.
pub memory_limit_bytes: u64,
/// 0 = no limit.
pub cpu_limit_cores: f64,
/// Written outside volumes: lost on a recreate.
pub writable_layer_bytes: u64,
/// The ports it is reached at, as far as the machine knows: those compose.yaml or its image declares and those its routes send to. The project's other services reach it at `<service>:<port>`.
pub ports: ::std::vec::Vec<u32>,
/// The TCP ports its processes listen on now, at an address the proxy and the other services reach: a route's port must be one of them. Empty = it does not run, or listens on none.
pub listening_ports: ::std::vec::Vec<u32>,
/// The ports `ports:` opens on the machine now: not one a route serves, nor one bound to 127.0.0.1.
pub published_ports: ::std::vec::Vec<PublishedPort>,
pub volume_mounts: ::std::vec::Vec<VolumeMount>,
pub restart_policy: RestartPolicy,
/// Absent = no healthcheck.
pub health_check: ::core::option::Option<HealthCheck>,
/// What the container is configured with, not what its image sets.
pub environment: ::std::vec::Vec<EnvironmentVariable>,
/// The files its `env_file:` names, as compose.yaml writes them, e.g. \"./.env\": relative to the project directory. Change them with [`DeployProjectRequest::files`](crate::types::DeployProjectRequest::files).
pub env_files: ::std::vec::Vec<::std::string::String>,
/// What the person runs in their own terminal for a shell in its container, e.g. \"ssh web.notes@m1.pethost.dev\"; scp, sftp, rsync and `ssh -L` tunnels take the same address. It works once one of their public keys is among [`Machine::ssh_keys`](crate::types::Machine::ssh_keys).
pub ssh_command: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ServiceState {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// Declared; no container yet.
NotCreated,
/// Starting, or created while an operation that starts containers runs (deploy, `recreate_service`, restore); its healthcheck has not passed yet.
Starting,
/// Running, without a healthcheck.
Running,
/// Running; its healthcheck passes.
Healthy,
/// Running; its healthcheck fails.
Unhealthy,
/// Exited and Docker is restarting it.
Restarting,
/// Not running: stopped by `stop_services` or a restore, never started, paused or dead.
Stopped,
/// Not running: it exited on its own (see `exit_code`; 0 = a job that finished).
Exited,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// A port that `ports:` opens on the machine directly, to anyone, bypassing the proxy.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct PublishedPort {
/// 0 = Docker picks one when the container starts.
pub machine_port: u32,
pub container_port: u32,
/// \"tcp\", \"udp\" or \"sctp\".
pub protocol: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct VolumeMount {
pub volume: ::std::string::String,
/// E.g. \"/var/lib/postgresql/data\".
pub container_path: ::std::string::String,
}
/// Docker's restart policies: what happens when the process exits, and when the machine starts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum RestartPolicy {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// Never restarted.
No,
/// Restarted when it exits non-zero. When the machine or Docker restarts it comes back unless it exited 0 (a finished job), so one stopped with `stop_services` comes back too. The default when compose.yaml sets none.
OnFailure,
/// Always restarted, unless stopped with [`RunProjectActionRequestAction::StopServices`](crate::types::RunProjectActionRequestAction::StopServices).
UnlessStopped,
Always,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// The healthcheck Docker runs: compose.yaml's, else the image's HEALTHCHECK.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HealthCheck {
/// The program and its arguments, e.g. \[\"curl\", \"-f\", \"http://localhost:8000/health\"\]; a test written as a shell line is \[\"/bin/sh\", \"-c\", \<line\>\]. Written and known as [`Service::command`](crate::types::Service::command) is: compose.yaml's `healthcheck.test`, else the image's.
pub command: ::std::vec::Vec<::std::string::String>,
/// How often Docker runs it.
pub interval_seconds: u32,
/// Absent while the service is not running.
pub status: HealthStatus,
pub consecutive_failure_count: u32,
/// Up to the last 5 checks, oldest first.
pub recent_results_passed: ::std::vec::Vec<bool>,
/// Of the latest failed check, at most 4 KiB. Untrusted.
pub last_failure_output: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum HealthStatus {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Starting,
Healthy,
Unhealthy,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct EnvironmentVariable {
pub name: ::std::string::String,
/// Absent when empty, when `secret` and [`Client::get_project`](crate::Client::get_project) had no `include_secret_values`, or when `value_left_out`.
pub value: ::std::string::String,
/// True = its value is not empty and comes from an env file, directly or through `${...}` in compose.yaml: env files hold the secrets. Empty values, and values written in compose.yaml itself, are not secret. The machine hides these values in operation logs too.
pub secret: bool,
/// The file to edit to change it, absolute in the project's directory: \"/compose.yaml\" (the service's `environment:`, which wins) or the env file it comes from, e.g. \"/.env\", \"/web.env\". Empty = the machine cannot tell, as when compose.yaml takes that file's path from .env.
pub source_file: ::std::string::String,
/// When compose.yaml builds it from `${...}`: the .env variables to edit to change it.
pub from_env_file_variables: ::std::vec::Vec<::std::string::String>,
/// True = the value is left out: the project's values together hold more than about 64 KiB. Read `source_file` with [`Client::read_path`](crate::Client::read_path).
pub value_left_out: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Volume {
pub volume: ::std::string::String,
/// Measured every few minutes.
pub size_bytes: u64,
pub mounted_by: ::std::vec::Vec<VolumeMountedBy>,
/// Of the newest snapshot that holds this volume. Absent = no snapshot holds it, or the list is not known ([`Project::snapshot_list_time`](crate::types::Project::snapshot_list_time)).
pub last_backup_time: ::core::option::Option<crate::Timestamp>,
/// The snapshots that hold it, in all; [`GetProjectRequest::snapshots_volume`](crate::types::GetProjectRequest::snapshots_volume) lists them. See [`Project::snapshot_list_time`](crate::types::Project::snapshot_list_time).
pub snapshot_count: u32,
/// False, always written = compose.yaml no longer declares it, so no service mounts it: it keeps its data and is in every backup until [`RunProjectActionRequestAction::DeleteVolume`](crate::types::RunProjectActionRequestAction::DeleteVolume) or the project is deleted. [`Client::read_path`](crate::Client::read_path) reads it with the volume root, `restore_snapshot` restores it, and declaring it again mounts it as it is.
pub declared: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct VolumeMountedBy {
pub service: ::std::string::String,
pub container_path: ::std::string::String,
}
/// A host of [`Project::routes`](crate::types::Project::routes), with its certificate.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Host {
/// As x-pethost.routes\[\].host.
pub host: ::std::string::String,
/// \"https://\<host\>\" once its certificate is served, and plain HTTP is redirected there; until then \"http://\<host\>\", which reaches the services. For AUTOMATIC, the host must resolve to the machine first. A protected project ([`Project::password_protected`](crate::types::Project::password_protected)) is never served over plain HTTP: it is always redirected, so the host answers only once its certificate is served.
pub url: ::std::string::String,
pub certificate_source: CertificateSource,
/// When the certificate served expires. Absent = none is served yet.
pub certificate_expire_time: ::core::option::Option<crate::Timestamp>,
/// Why the host answers nobody: a name under the panel's domain that is not one label under [`Machine::apps_domain`](crate::types::Machine::apps_domain) (another account's, a former `apps_domain` of this one, or two labels deep). Change its host. Empty = it answers, or it is the person's own domain.
pub unavailable_message: ::std::string::String,
}
/// An x-pethost route: requests for `host` under `path` go to `port` of `service`. The field names are the YAML keys.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct Route {
/// `<name>.<Machine.apps_domain>`, the person's domain on Pethost: HTTPS at once, nothing to set up. Or a domain they own: a CNAME to [`Machine::hostname`](crate::types::Machine::hostname) (an ALIAS at the apex, never an IP address), certified once it resolves.
pub host: ::std::string::String,
/// Whole segments, the longest wins. Empty = \"/\": every path.
pub path: ::std::string::String,
pub service: ::std::string::String,
/// The port the service listens on in its container, at 0.0.0.0.
pub port: u32,
/// True = the path's prefix is removed from the request.
pub strip_path: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum CertificateSource {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// No certificate will come: plain HTTP only. As when [`Machine::acme_enabled`](crate::types::Machine::acme_enabled) is off, or for an IP address or another name Let's Encrypt does not issue for.
None,
/// A certificate installed on the machine covers it.
Installed,
/// From Let's Encrypt, renewed automatically.
Automatic,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Operation {
pub operation_id: ::std::string::String,
pub kind: OperationKind,
pub status: OperationStatus,
pub start_time: ::core::option::Option<crate::Timestamp>,
/// Absent while in progress.
pub finish_time: ::core::option::Option<crate::Timestamp>,
/// When FAILED: why, for people. The log says more.
pub failure_message: ::std::string::String,
/// DEPLOY or `RECREATE_SERVICE` that FAILED: why, to branch on.
pub deploy_failure_reason: DeployFailureReason,
/// DEPLOY, or a RESTORE that brought a deleted project back: true = it made its files the project's. It stays true once a later deploy replaces them: [`Project::deploy_id`](crate::types::Project::deploy_id) names the one whose files the project has now. A deploy switches the files partway, when it starts the containers, so one that FAILED or was CANCELLED without it left the files as they were: to retry, send all its changes again. A project's first deploy has it from its start: its files stay however it ends, to fix and deploy again.
pub made_current: bool,
/// `RECREATE_SERVICE`: the service. A failed DEPLOY or `RECREATE_SERVICE`: the service that failed.
pub service: ::std::string::String,
/// DEPLOY or `RECREATE_SERVICE` that failed `CONTAINER_EXITED`.
pub failed_exit_code: i32,
/// BACKUP, or DELETE's final backup, that succeeded: the snapshot taken. RESTORE: the snapshot restored.
pub snapshot_id: ::std::string::String,
/// RESTORE: the volumes it replaced.
pub restored_volumes: ::std::vec::Vec<::std::string::String>,
/// RESTORE: the backup taken first; restore it to undo. Empty = none was taken.
pub undo_snapshot_id: ::std::string::String,
/// DEPLOY of a github project: the commit its files are, also when it changed only /.env or x-pethost.
pub github_commit: ::core::option::Option<GithubCommit>,
/// DEPLOY of an uploaded archive: its file name.
pub archive_name: ::std::string::String,
/// DEPLOY: what making that version changed that its request did not write, for people: the earlier deploy whose files it took, the compose file it took or wrote for a Dockerfile, the compose files it left out, the project's /.env and x-pethost kept in place of the version's own. Nothing else in the compose file is changed: it runs as written.
pub adjustments: ::std::vec::Vec<::std::string::String>,
/// DEPLOY: the paths its request changed, for people, the first 10: [`DeployProjectRequest::files`](crate::types::DeployProjectRequest::files), or [`Client::create_project`](crate::Client::create_project)\'s files; a move lists both paths. A commit's or an archive's own files are not listed: `github_commit` or `archive_name` says what they brought.
pub changed_paths: ::std::vec::Vec<::std::string::String>,
/// DEPLOY: the paths its request changed, in all.
pub changed_path_count: u32,
/// DEPLOY: true = the machine keeps the files it deployed, which are no longer the project's: [`DeployProjectRequestVersion::RollbackDeployId`](crate::types::DeployProjectRequestVersion::RollbackDeployId) puts them back. It keeps the 3 newest versions of the files before the current one; of deploys that changed only /.env or x-pethost, whose files are the same, the newest has it.
pub files_kept: bool,
/// DEPLOY: the deploy that first deployed its files: itself when its request brought or changed files (a commit, an archive, a file other than /.env); else an earlier one, as after a deploy that changed only /.env or x-pethost.
pub files_operation_id: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OperationKind {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Deploy,
RecreateService,
Backup,
Restore,
Delete,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OperationStatus {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
InProgress,
Succeeded,
Failed,
Cancelled,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum DeployFailureReason {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// A wrong name or tag, or a private image.
ImagePullFailed,
ImageBuildFailed,
/// E.g. the command does not exist.
ContainerStartFailed,
DiskFull,
/// Includes a machine restart during the operation.
Internal,
/// A `ports:` machine port is taken.
PortUnavailable,
/// Exited, or kept restarting, after starting.
ContainerExited,
ContainerUnhealthy,
TimedOut,
/// The image declares a VOLUME no mount covers: it would never be backed up. Mount a named volume there.
UncoveredImageVolume,
/// The running projects leave too little memory for a build; the message says how much.
BuildMemoryUnavailable,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Snapshot {
pub snapshot_id: ::std::string::String,
pub create_time: ::core::option::Option<crate::Timestamp>,
/// Of its files, the directory and every volume. 0 = not known.
pub size_bytes: u64,
/// The volumes it holds, besides the project's directory.
pub volumes: ::std::vec::Vec<::std::string::String>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpTrafficSummary {
pub request_count: u64,
/// 5xx responses.
pub server_error_count: u64,
/// Of responses: WebSockets, logged when they close, count as requests but not here.
pub latency_p50_ms: u32,
pub latency_p95_ms: u32,
}
/// What [`Client::create_project`](crate::Client::create_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CreateProjectRequest {
/// New, \[a-z0-9\]\[a-z0-9\_-\]\*, ≤63 chars; immutable.
pub project_id: ::std::string::String,
/// Set = a GitHub project: {github: {repository}}. Absent = the files of this request.
pub source: ::core::option::Option<ProjectSource>,
/// An archive of the project's directory, from [`CreateTransferRequestTransfer::UploadArchive`](crate::types::CreateTransferRequestTransfer::UploadArchive), unpacked first. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = not arrived; [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = expired or used. One the machine refused (its PUT said why) answers with its `violations`.
pub upload_id: ::std::string::String,
/// The project's files, e.g. \[{path: \"/compose.yaml\", text: \"…\"}, {path: \"/.env\", text: \"…\"}\], or those to write over the archive's or the commit's. A github source takes only /.env.
pub files: ::std::vec::Vec<FileChange>,
/// Changes to the files\' x-pethost: the name people see, the routes, a password.
pub x_pethost: ::core::option::Option<ProjectExtension>,
/// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `timeout_seconds`.
pub timeout_seconds: u32,
/// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `operation_id`.
pub operation_id: ::std::string::String,
/// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `wait_seconds`.
pub wait_seconds: ::core::option::Option<u32>,
/// Set = a database (Postgres or Valkey) the machine writes and deploys; leave files, `upload_id`, source, `x_pethost` out.
pub database: DatabaseEngine,
}
/// What [`Client::create_project`](crate::Client::create_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct CreateProjectResponse {
/// The first deploy: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)). Absent when violations stopped it: nothing was created.
pub operation: ::core::option::Option<Operation>,
pub violations: ::std::vec::Vec<SpecViolation>,
/// With violations: what the machine had changed, as in [`Operation::adjustments`](crate::types::Operation::adjustments). A deploy that started lists them in operation.adjustments only.
pub adjustments: ::std::vec::Vec<::std::string::String>,
/// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
pub project: ::core::option::Option<Project>,
/// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
pub log: ::std::vec::Vec<OperationLogLine>,
}
/// What [`Client::deploy_project`](crate::Client::deploy_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct DeployProjectRequest {
pub project_id: ::std::string::String,
/// [`Project::deploy_id`](crate::types::Project::deploy_id) as you read it: [`ErrorCode::Aborted`](crate::ErrorCode::Aborted) if the project was deployed since. Empty = no check.
pub base_deploy_id: ::std::string::String,
/// Written in order over the current files, or over the new version's: e.g. \[{path: \"/.env\", text: \"…\"}\] writes that file whole, and the files not named stay. With no new version pethost.compose.yaml is refused: write /compose.yaml. github: only /.env. None = redeploy.
pub files: ::std::vec::Vec<FileChange>,
/// Edits x-pethost by part, after `files`: metadata by key; routes all at once.
pub x_pethost: ::core::option::Option<ProjectExtension>,
/// Not with `upload_id`, or github.
pub mount_volume: ::core::option::Option<MountVolume>,
/// For the whole deploy, builds included; 0 = default.
pub timeout_seconds: u32,
/// For a safe retry: the same id returns the first call's operation and starts nothing. \[A-Za-z0-9\]\[A-Za-z0-9.\_-\]\*, ≤128 chars; empty = generated.
pub operation_id: ::std::string::String,
/// A new version of the files; none = the current one.
pub version: ::core::option::Option<DeployProjectRequestVersion>,
/// Seconds to wait for the deploy's end, ≤45. Absent = 45; 0 = answer once it started. Still `IN_PROGRESS` then: [`Client::get_operation`](crate::Client::get_operation) waits on.
pub wait_seconds: ::core::option::Option<u32>,
}
/// The oneof [`DeployProjectRequest::version`](crate::types::DeployProjectRequest::version): one of its members.
///
/// A new version of the files; none = the current one.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum DeployProjectRequestVersion {
/// files project: an archive from [`Client::create_transfer`](crate::Client::create_transfer); replaces all files but /.env and x-pethost.
UploadId(::std::string::String),
/// github project: a commit of its branch (SHA, ≥7 chars), from [`Client::list_commits`](crate::Client::list_commits).
Commit(::std::string::String),
/// github project: true = [`GithubSource::newest_commit`](crate::types::GithubSource::newest_commit), read now.
NewestCommit(bool),
/// files project, a rollback: the `operation_id` of an earlier deploy with `files_kept` ([`Project::operations`](crate::types::Project::operations)). Its files return as a new version; /.env, x-pethost and volumes stay.
RollbackDeployId(::std::string::String),
}
/// Adds `<volume>:<container_path>` to the service, declaring the volume if needed.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct MountVolume {
/// A service of compose.yaml.
pub service: ::std::string::String,
/// New, or one of [`Project::volumes`](crate::types::Project::volumes).
pub volume: ::std::string::String,
/// Absolute, e.g. \"/data\".
pub container_path: ::std::string::String,
}
/// x-pethost as data. Absent parts stay.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectExtension {
/// Sets the fields given; an empty one is removed.
pub metadata: ::core::option::Option<ProjectMetadata>,
/// The project's routes from now on: these replace all it has, so send [`Project::routes`](crate::types::Project::routes) with your change to add, change or remove one. Empty = they stay.
pub routes: ::std::vec::Vec<Route>,
/// True = the project has no route from now on. Not with routes.
pub remove_routes: bool,
/// Visitors of every route must enter it. Empty = it stays.
pub password: ::std::string::String,
/// True = no password. Not with password.
pub remove_password: bool,
}
/// `path` and exactly one change.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct FileChange {
/// Absolute in the project's directory.
pub path: ::std::string::String,
pub change: ::core::option::Option<FileChangeChange>,
/// With text or data: mode 0755, not 0644.
pub executable: bool,
}
/// The oneof [`FileChange::change`](crate::types::FileChange::change): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum FileChangeChange {
/// Writes the file as UTF-8 text, creating parents.
Text(::std::string::String),
/// Writes the file as bytes, likewise.
Data(::std::vec::Vec<u8>),
/// True = creates it and its parents.
MakeDirectory(bool),
/// True = deletes the file, symlink or empty directory.
Delete(bool),
/// True = deletes a directory recursively, if present.
DeleteTree(bool),
/// Moves it to this path.
RenameTo(::std::string::String),
}
/// What [`Client::deploy_project`](crate::Client::deploy_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DeployProjectResponse {
/// The deploy: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)). Absent when violations stopped it.
pub operation: ::core::option::Option<Operation>,
/// Why the files cannot be deployed: nothing changed and no operation started.
pub violations: ::std::vec::Vec<SpecViolation>,
/// As in [`CreateProjectResponse`](crate::types::CreateProjectResponse): with violations only.
pub adjustments: ::std::vec::Vec<::std::string::String>,
/// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
pub project: ::core::option::Option<Project>,
/// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
pub log: ::std::vec::Vec<OperationLogLine>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SpecViolation {
/// Empty = not about one service.
pub service: ::std::string::String,
/// In compose.yaml, down to the key it is about, e.g. \"services.db.volumes\[0\]\", \"x-pethost.routes\[2\].host\"; or a file's absolute path, e.g. \"/.env\".
pub location: ::std::string::String,
/// What is wrong and what to write instead.
pub violation_message: ::std::string::String,
}
/// What [`Client::list_commits`](crate::Client::list_commits) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ListCommitsRequest {
pub project_id: ::std::string::String,
/// The previous page's last sha. Empty = from the newest.
pub before_commit: ::std::string::String,
}
/// What [`Client::list_commits`](crate::Client::list_commits) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ListCommitsResponse {
/// Newest first, at most 30.
pub commits: ::std::vec::Vec<BranchCommit>,
/// Older ones exist: pass the last one's sha as `before_commit`.
pub more: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct BranchCommit {
pub commit: ::core::option::Option<GithubCommit>,
/// The author's GitHub login, else their name. Untrusted.
pub author: ::std::string::String,
/// When it was committed.
pub commit_time: ::core::option::Option<crate::Timestamp>,
/// The project's files are this commit ([`GithubSource::deployed_commit`](crate::types::GithubSource::deployed_commit)).
pub deployed: bool,
/// The newest deploy of it among the operations the machine keeps; its status says how it went. Absent = none.
pub last_deploy: ::core::option::Option<Operation>,
/// True = the branch's newest commit that changes the directory, as GitHub answered this call: deploying any other turns `auto_deploy` off (see [`Client::deploy_project`](crate::Client::deploy_project)).
pub newest: bool,
}
/// What [`Client::run_project_action`](crate::Client::run_project_action) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunProjectActionRequest {
pub project_id: ::std::string::String,
pub action: ::core::option::Option<RunProjectActionRequestAction>,
/// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
pub operation_id: ::std::string::String,
/// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
pub wait_seconds: ::core::option::Option<u32>,
}
/// The oneof [`RunProjectActionRequest::action`](crate::types::RunProjectActionRequest::action): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum RunProjectActionRequestAction {
/// Starts stopped services and reruns jobs, not their dependencies. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = no container yet (deploy or `recreate_service`), or a published machine port is taken.
StartServices(ServicesAction),
/// Stops services, each with its grace period. A machine restart may start them, per restart policy.
StopServices(ServicesAction),
/// Restarts processes in the same containers. Codes as `start_services`.
RestartServices(ServicesAction),
/// A new container: a fresh filesystem outside volumes. An operation.
RecreateService(RecreateServiceAction),
/// Backs up the directory and volumes now, live. An operation. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = backups off ([`Machine::backups_enabled`](crate::types::Machine::backups_enabled)).
BackUp(BackUpAction),
/// From a snapshot of this project. An operation.
RestoreSnapshot(RestoreSnapshotAction),
/// Stops a running or starting operation: it ends CANCELLED, leaving what a failure would; one only starting answers CANCELLED from its own call. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = a delete past its final backup.
CancelOperation(CancelOperationAction),
/// An operation: a final backup while backups are on, then containers, volumes, files, hosts, logs. Snapshots stay ([`GetMachineResponse::deleted_projects`](crate::types::GetMachineResponse::deleted_projects)), and restoring one brings the project back, source included; with backups off there is none, and it is gone for good.
DeleteProject(DeleteProjectAction),
/// Changes the source. To files: keeps the current files. To github: only the fields set change, e.g. {github: {`auto_deploy`: true}} follows pushes again; from files, repository is required. Deploys the newest commit if `auto_deploy` is on and the files are not at it. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = as [`Client::create_project`](crate::Client::create_project).
SetSource(ProjectSource),
/// A volume compose.yaml no longer declares ([`Volume::declared`](crate::types::Volume::declared) false). Its data then lives only in snapshots. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = declared or in use.
DeleteVolume(::std::string::String),
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ServicesAction {
/// Empty = all (start: those with a container; restart: running ones).
pub services: ::std::vec::Vec<::std::string::String>,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RecreateServiceAction {
pub service: ::std::string::String,
/// True = pull the tag's newest image, or rebuild on the newest base images.
pub pull_latest_image: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct BackUpAction {}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RestoreSnapshotAction {
pub snapshot_id: ::std::string::String,
/// Existing project: the volumes to replace (≥1); it is backed up first ([`Operation::undo_snapshot_id`](crate::types::Operation::undo_snapshot_id)), stopped and restarted; files stay. Deleted project: files, source and volumes return, then it deploys.
pub volumes: ::std::vec::Vec<::std::string::String>,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CancelOperationAction {
/// Required.
pub operation_id: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct DeleteProjectAction {
/// True = no final backup, while backups are on: changes since the newest snapshot are lost.
pub skip_final_backup: bool,
}
/// What [`Client::run_project_action`](crate::Client::run_project_action) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunProjectActionResponse {
/// Set when the action runs as an operation: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)); for `set_source`, the deploy it started, if any; for `cancel_operation`, the operation it stopped, if the machine had recorded it (see `cancel_operation`).
pub operation: ::core::option::Option<Operation>,
/// The project as [`Client::get_project`](crate::Client::get_project) returns it, after the action, or once its operation ended: after `set_source`, its source says what it now is. Absent while the operation runs, and once `delete_project` has deleted it.
pub project: ::core::option::Option<Project>,
/// The operation's last log lines, unless it SUCCEEDED.
pub log: ::std::vec::Vec<OperationLogLine>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum DatabaseEngine {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Postgres,
Valkey,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// A database project: one service running Postgres or Valkey, whose files the machine wrote.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Database {
pub engine: DatabaseEngine,
/// As it was made, e.g. 18.
pub major_version: u32,
/// What the server says it runs, e.g. \"18.6\". Empty = not answering.
pub server_version: ::std::string::String,
/// Its size: its service's `mem_limit` in compose.yaml.
pub memory_limit_bytes: u64,
/// Postgres: its databases\' size; Valkey: its data in memory. On disk: [`Project::volumes`](crate::types::Project::volumes).
pub data_bytes: u64,
/// Open now.
pub connections: u32,
/// Valkey: maxclients.
pub max_connections: u32,
/// The projects that reach it ([`Client::link_database`](crate::Client::link_database)).
pub linked_projects: ::std::vec::Vec<::std::string::String>,
pub connection: ::core::option::Option<DatabaseConnection>,
/// The service of [`Project::services`](crate::types::Project::services) that runs the database.
pub service: ::std::string::String,
/// The volume of [`Project::volumes`](crate::types::Project::volumes) that holds its data.
pub volume: ::std::string::String,
/// The console, for `OpenTerminal` in `service`: psql signed in as the superuser, or valkey-cli.
pub console_command: ::std::vec::Vec<::std::string::String>,
}
/// How a linked project signs in, as the apps\' user.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DatabaseConnection {
/// The database's `project_id`.
pub host: ::std::string::String,
pub port: u32,
/// \"app\"; Valkey: \"default\".
pub user: ::std::string::String,
/// \"app\"; Valkey: \"0\".
pub database: ::std::string::String,
/// Only with [`Client::get_project`](crate::Client::get_project)\'s `include_secret_values`.
pub password: ::std::string::String,
/// For the app's .env, e.g. `DATABASE_URL`=\<url\>. Without `include_secret_values`, \*\*\*\* stands for the password.
pub url: ::std::string::String,
/// As url, at localhost: what the SSH tunnel to its service gives ([`Service::ssh_command`](crate::types::Service::ssh_command)).
pub local_url: ::std::string::String,
}
/// A database project in brief ([`ProjectSummary::database`](crate::types::ProjectSummary::database)).
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DatabaseSummary {
pub engine: DatabaseEngine,
pub major_version: u32,
/// As in Database.
pub data_bytes: u64,
pub connections: u32,
pub linked_projects: ::std::vec::Vec<::std::string::String>,
/// As in Database: empty = not answering, its figures are zero.
pub server_version: ::std::string::String,
}
/// An engine the machine makes databases of ([`Machine::database_engines`](crate::types::Machine::database_engines)).
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DatabaseEngineOffer {
pub engine: DatabaseEngine,
/// The major a new database gets, e.g. 18.
pub major_version: u32,
/// Smallest first.
pub sizes: ::std::vec::Vec<DatabaseSizeChoice>,
/// The size [`Client::create_project`](crate::Client::create_project)\'s `database` gives.
pub default_memory_limit_bytes: u64,
}
/// A size a database may take.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DatabaseSizeChoice {
pub memory_limit_bytes: u64,
}
/// What [`Client::link_database`](crate::Client::link_database) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct LinkDatabaseRequest {
pub database_project_id: ::std::string::String,
/// App `project_ids` to link.
pub link: ::std::vec::Vec<::std::string::String>,
/// App `project_ids` to unlink.
pub unlink: ::std::vec::Vec<::std::string::String>,
}
/// What [`Client::link_database`](crate::Client::link_database) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct LinkDatabaseResponse {
/// The database, as [`Client::get_project`](crate::Client::get_project) returns it.
pub project: ::core::option::Option<Project>,
}
/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct SetProjectAlertsRequest {
pub project_id: ::std::string::String,
/// ≤10. Given = the whole list.
pub checks: ::std::vec::Vec<SiteCheck>,
/// True = none, not even the default check.
pub remove_checks: bool,
/// ≤10. Given = the whole list.
pub traffic_rules: ::std::vec::Vec<TrafficRule>,
/// True = none.
pub remove_traffic_rules: bool,
/// True = incidents are recorded, nothing is sent. Absent = stays.
pub off: ::core::option::Option<bool>,
/// ≤10080; 0 = unmute. Incidents opened meanwhile are not sent. Absent = stays.
pub mute_minutes: ::core::option::Option<u32>,
}
/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SetProjectAlertsResponse {
/// As changed.
pub alerts: ::core::option::Option<ProjectAlerts>,
}
/// An address of the project the machine opens every minute through its proxy, from inside the machine. Down = no connection, a bad certificate, no answer in 10 s, the wrong status, or `must_contain` missing; 3 failures in a row open `SITE_DOWN`. A password page is passed.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct SiteCheck {
/// A [`Host::host`](crate::types::Host::host) of the project.
pub host: ::std::string::String,
/// \"/…\", ≤200 chars, a query allowed. Empty = \"/\".
pub path: ::std::string::String,
/// 100-599. 0 = any status below 500 is up: 401, 404 and redirects too.
pub expect_status: u32,
/// ≤100 chars, in the body's first 64 KiB. Empty = not looked for.
pub must_contain: ::std::string::String,
}
/// Fires when `metric`, over the last `window_minutes` of the requests `filter` selects, reaches `threshold` 2 minutes in a row; clears after 3 below.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TrafficRule {
pub metric: TrafficMetric,
/// `status_class` not taken.
pub filter: ::core::option::Option<HttpTrafficFilter>,
/// A count, a percent (0-100) or ms.
pub threshold: f64,
/// 1-60. 0 = 5.
pub window_minutes: u32,
/// Percent and p95: fewer requests in the window leave the rule as it was. ≤10000. 0 = 20.
pub min_requests: u32,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum TrafficMetric {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// 5xx responses in the window.
ServerErrors,
/// 5xx, of the window's requests (WebSockets too).
ServerErrorPercent,
LatencyP95Ms,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What Pethost watches on a project ([`Client::set_project_alerts`](crate::Client::set_project_alerts)), and how each part stands now. Service crashes, running out of memory, failed healthchecks, and failed backups, restores and auto-deploys are always watched.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectAlerts {
/// Until set: the project's URL at \"/\" (`machine_default`); none without a route.
pub checks: ::std::vec::Vec<SiteCheckState>,
/// Until set: 10 or more 5xx in 5 minutes, of every request (`machine_default`); none without a route.
pub traffic_rules: ::std::vec::Vec<TrafficRuleState>,
/// True = incidents are recorded, nothing is sent.
pub off: bool,
/// Absent = not muted.
pub mute_end_time: ::core::option::Option<crate::Timestamp>,
/// Of the time the checks ran in the last 30 days, the share they were up, e.g. 99.97. Absent = no check ran.
pub uptime_percent: ::core::option::Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SiteCheckState {
pub check: ::core::option::Option<SiteCheck>,
/// The default check, as no list was set.
pub machine_default: bool,
pub status: AlertStatus,
/// Absent = not run yet.
pub last_result: ::core::option::Option<SiteCheckResult>,
/// The open incident. Empty = none.
pub incident_id: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SiteCheckResult {
pub check_time: ::core::option::Option<crate::Timestamp>,
/// 0 = no HTTP answer: `failure_message` says why.
pub status: u32,
pub duration_ms: u32,
/// E.g. \"connection refused\", \"status 502\", \"the text is missing\". Empty = up.
pub failure_message: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TrafficRuleState {
pub rule: ::core::option::Option<TrafficRule>,
/// The default rule, as no list was set.
pub machine_default: bool,
pub status: AlertStatus,
/// The metric at the last evaluation.
pub value: f64,
/// In the window then.
pub request_count: u64,
/// The open incident. Empty = none.
pub incident_id: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum AlertStatus {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Ok,
/// It holds or cleared, not confirmed yet.
Pending,
/// An incident is open.
Firing,
/// Not checked now: a deploy or restore runs or just ended, the project is stopped, or no route has the check's host.
Paused,
/// Not evaluated yet, or too few requests.
NoData,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// A period during which something of a project needed attention, from its confirmation to its end.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Incident {
pub incident_id: ::std::string::String,
/// `DEPLOY_CANCELLED` opens none.
pub kind: ProjectProblemKind,
/// As in its [`ProjectProblem`](crate::types::ProjectProblem).
pub service: ::std::string::String,
/// `SITE_DOWN`.
pub check: ::core::option::Option<SiteCheck>,
/// `HTTP_ERRORS`, `HTTP_SLOW`.
pub traffic_rule: ::core::option::Option<TrafficRule>,
/// `DEPLOY_FAILED`, `BACKUP_FAILED`, `RESTORE_FAILED`.
pub operation_id: ::std::string::String,
pub open_time: ::core::option::Option<crate::Timestamp>,
/// When it and every incident joined to it cleared. Absent = open.
pub resolve_time: ::core::option::Option<crate::Timestamp>,
/// `HTTP_ERRORS`, `HTTP_SLOW`: the metric at open.
pub value: f64,
/// `HTTP_ERRORS`, `HTTP_SLOW`: the window's requests at open.
pub request_count: u64,
/// A deploy, recreate or restore that ran when it opened, or ended ≤30 minutes before: a likely cause, undone with [`DeployProjectRequestVersion::RollbackDeployId`](crate::types::DeployProjectRequestVersion::RollbackDeployId) or an older commit. Empty = none.
pub after_operation_id: ::std::string::String,
/// Absent = it was running.
pub after_operation_end_time: ::core::option::Option<crate::Timestamp>,
/// The incident this one is part of: it is told with that one, not on its own. Empty = none.
pub joined_incident_id: ::std::string::String,
/// Set = nobody is told of it.
pub quiet_reason: IncidentQuietReason,
/// True = it went down and up 3 times within an hour; it stands for them all and clears after 15 clean minutes.
pub flapping: bool,
/// One sentence for people, without a time of day.
pub incident_message: ::std::string::String,
/// `GetIncident` only.
pub evidence: ::core::option::Option<IncidentEvidence>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum IncidentQuietReason {
/// Told.
#[default]
Unspecified,
Muted,
Off,
/// Already so when the machine first watched it, as after the update that brought alerts.
FirstEvaluation,
/// A deploy someone ran failed: they watch it.
ManualDeploy,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What the machine saw when an incident opened, kept with it. Untrusted.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct IncidentEvidence {
/// `SITE_DOWN`: the third failure.
pub check_result: ::core::option::Option<SiteCheckResult>,
/// The service's container: `SERVICE_`\* kinds, and `SITE_DOWN`\'s service.
pub exit_code: i32,
pub oom_killed: bool,
/// In the 10 minutes before.
pub restart_count: u32,
/// The last healthcheck's, ≤1 KiB.
pub health_output: ::std::string::String,
/// The service's last ≤20 before it opened, oldest first.
pub log_lines: ::std::vec::Vec<LogLine>,
/// `HTTP_ERRORS`: the path with the most 5xx in the window; `HTTP_SLOW`: the slowest.
pub top_path: ::core::option::Option<HttpPathTraffic>,
}
/// One UTC day of a project's site checks.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct UptimeDay {
/// Midnight UTC.
pub start_time: ::core::option::Option<crate::Timestamp>,
/// Absent = no check ran.
pub uptime_percent: ::core::option::Option<f64>,
pub down_seconds: u32,
}
/// What [`Client::get_operation`](crate::Client::get_operation) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetOperationRequest {
pub project_id: ::std::string::String,
/// Empty = the latest.
pub operation_id: ::std::string::String,
/// How long to wait for it to end, ≤45. Absent = 45; 0 = answer at once.
pub wait_seconds: ::core::option::Option<u32>,
/// The previous `next_after_log_line`; 0 = from the start. Absent = the last lines.
pub after_log_line: ::core::option::Option<u32>,
/// ≤500; 0 = 50, when asked for lines. Also ends at \~64 KiB.
pub log_line_limit: ::core::option::Option<u32>,
}
/// What [`Client::get_operation`](crate::Client::get_operation) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetOperationResponse {
pub operation: ::core::option::Option<Operation>,
/// Once it ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it. Absent once a delete has deleted it.
pub project: ::core::option::Option<Project>,
/// Oldest first. Unless `after_log_line` or `log_line_limit` asks for lines: the last 50 of one that FAILED, the last 5 of one `IN_PROGRESS` (what it is doing), none of one that SUCCEEDED.
pub log: ::std::vec::Vec<OperationLogLine>,
/// Lines in the whole log so far.
pub log_line_count: u32,
/// Pass it as `after_log_line` to get the lines after these; absent = 0. The machine keeps every line of the log.
pub next_after_log_line: u32,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct OperationLogLine {
pub time: ::core::option::Option<crate::Timestamp>,
/// From Compose, BuildKit, restic or the daemon, as [`LogLine::text`](crate::types::LogLine::text) is kept; at most 2 KiB, a longer line is cut.
pub text: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct HttpTrafficFilter {
/// As [`Host::host`](crate::types::Host::host); a removed host still matches.
pub host: ::std::string::String,
/// E.g. \"GET\".
pub method: ::std::string::String,
/// Without the query; any case.
pub path_contains: ::std::string::String,
/// As [`HttpPathTraffic::path_pattern`](crate::types::HttpPathTraffic::path_pattern), e.g. \"/recipes/\*\".
pub path_pattern: ::std::string::String,
/// 1-5: 5 = 5xx.
pub status_class: u32,
}
/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct QueryHttpTrafficRequest {
pub project_id: ::std::string::String,
pub filter: ::core::option::Option<HttpTrafficFilter>,
/// Absent = a day before `end_time`.
pub start_time: ::core::option::Option<crate::Timestamp>,
/// Absent = now.
pub end_time: ::core::option::Option<crate::Timestamp>,
/// The range ending at `end_time`, e.g. 3600 = the last hour. Not with `start_time`.
pub last_seconds: u32,
/// Time series bucket width; ≤500 buckets. 0 = no series.
pub bucket_width_seconds: u32,
/// Requests to return, newest first; ≤200. 0 = aggregates only.
pub request_limit: u32,
/// The previous `next_page_token`, other fields unchanged: older requests only.
pub page_token: ::std::string::String,
}
/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct QueryHttpTrafficResponse {
/// The range queried, as the machine resolved it: defaults applied, on its clock.
pub start_time: ::core::option::Option<crate::Timestamp>,
pub end_time: ::core::option::Option<crate::Timestamp>,
/// Of the oldest request the machine keeps for the project. Absent = none is kept.
pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
pub summary: ::core::option::Option<HttpTrafficSummary>,
/// Oldest first, each `bucket_width_seconds` wide; one with no request is left out.
pub buckets: ::std::vec::Vec<HttpTrafficBucket>,
/// The 10 busiest, busiest first.
pub top_paths: ::std::vec::Vec<HttpPathTraffic>,
/// The sequence of the newest request the machine had logged: summary, buckets and `top_paths` count every one up to it, and [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) streams the later ones. 0 = none was logged.
pub newest_sequence: u64,
pub requests: ::std::vec::Vec<HttpRequest>,
/// Empty = no more requests.
pub next_page_token: ::std::string::String,
/// Where [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) goes on from (`after_sequence`), so it misses no request newer than these: set on a first page with `request_limit`, empty or not. 0 = the machine had logged none.
pub tail_sequence: u64,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpTrafficBucket {
pub start_time: ::core::option::Option<crate::Timestamp>,
pub summary: ::core::option::Option<HttpTrafficSummary>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpPathTraffic {
pub method: ::std::string::String,
/// The path with id-like segments as `*`, e.g. \"/recipes/\*\": requests to one endpoint.
pub path_pattern: ::std::string::String,
pub summary: ::core::option::Option<HttpTrafficSummary>,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpRequest {
/// Unique and increasing on the machine: [`Client::tail_http_traffic`](crate::Client::tail_http_traffic)\'s cursor.
pub sequence: u64,
/// When the response finished. A WebSocket is logged when it closes, with status 0.
pub finish_time: ::core::option::Option<crate::Timestamp>,
pub host: ::std::string::String,
pub method: ::std::string::String,
/// With the query. Untrusted.
pub path: ::std::string::String,
pub path_pattern: ::std::string::String,
/// The route that matched.
pub route_path: ::std::string::String,
/// That answered. Empty = of a route the project no longer has.
pub service: ::std::string::String,
pub port: u32,
/// 0 = a WebSocket; 499 = the client left before the response. A 401, 303 or 429 of a protected project ([`Project::password_protected`](crate::types::Project::password_protected)) may be its password page's, not the service's.
pub status_code: u32,
pub response_size_bytes: u64,
/// In total.
pub duration_ms: u32,
/// Of which inside the service.
pub service_duration_ms: u32,
pub client_ip_address: ::std::string::String,
/// Untrusted.
pub user_agent: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ContainerLogFilter {
/// Empty = all, removed services too.
pub service: ::std::string::String,
/// Absent = both.
pub stream: OutputStream,
/// Literal, any ASCII case, ignoring escape sequences. Length limited ([`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument)).
pub text_contains: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OutputStream {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
Stdout,
Stderr,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What [`Client::query_container_logs`](crate::Client::query_container_logs) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct QueryContainerLogsRequest {
pub project_id: ::std::string::String,
pub filter: ::core::option::Option<ContainerLogFilter>,
/// Absent = the oldest kept.
pub start_time: ::core::option::Option<crate::Timestamp>,
/// Absent = now.
pub end_time: ::core::option::Option<crate::Timestamp>,
/// As in [`Client::query_http_traffic`](crate::Client::query_http_traffic).
pub last_seconds: u32,
/// ≤500; 0 = 100. Also ends at \~64 KiB.
pub limit: u32,
/// False = the newest before `end_time`; true = the oldest after `start_time`.
pub from_start: bool,
/// The previous `next_page_token`, other fields unchanged.
pub page_token: ::std::string::String,
}
/// What [`Client::query_container_logs`](crate::Client::query_container_logs) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct QueryContainerLogsResponse {
/// The range queried, as the machine resolved it: defaults applied, on its clock.
pub start_time: ::core::option::Option<crate::Timestamp>,
pub end_time: ::core::option::Option<crate::Timestamp>,
/// Of the oldest line of container output the machine keeps: nothing older can be queried. Absent = none is kept.
pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
pub lines: ::std::vec::Vec<LogLine>,
/// Empty = no more.
pub next_page_token: ::std::string::String,
/// Where [`Client::tail_container_logs`](crate::Client::tail_container_logs) goes on from (`after_cursor`), so it misses no line newer than these: set on every page, an empty one too. Empty = the machine had logged no line.
pub tail_cursor: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct LogLine {
pub time: ::core::option::Option<crate::Timestamp>,
pub service: ::std::string::String,
pub stream: OutputStream,
/// A line as written, with its colour codes (SGR escape sequences); other escape sequences, and control characters but tab, are removed. A line over 4 KiB is cut (over 16 KiB in streams). Untrusted.
pub text: ::std::string::String,
}
/// What [`Client::run_service_command`](crate::Client::run_service_command) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunServiceCommandRequest {
pub project_id: ::std::string::String,
pub service: ::std::string::String,
/// E.g. \[\"psql\", \"-c\", \"select 1\"\]; a shell line: \[\"sh\", \"-c\", \"ls | head\"\].
pub command: ::std::vec::Vec<::std::string::String>,
/// Written to stdin, then closed.
pub stdin: ::std::string::String,
/// Empty = the container's. \"root\" can install packages.
pub run_as_user: ::std::string::String,
/// Empty = the container's.
pub working_directory: ::std::string::String,
/// 0 = default. Kills the main process only. Over \~50 may outlast your client: background long jobs.
pub timeout_seconds: u32,
}
/// What [`Client::run_service_command`](crate::Client::run_service_command) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunServiceCommandResponse {
pub exit_code: i32,
/// True = the machine killed it at the timeout; `exit_code` is then -1.
pub timed_out: bool,
/// The last 32 KiB of each, as the machine kept them. Invalid UTF-8, and control characters other than tab, newline and carriage return (colour codes included), become U+FFFD. Untrusted.
pub stdout: ::std::string::String,
pub stderr: ::std::string::String,
/// True = the start of stdout or stderr was cut.
pub output_truncated: bool,
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct FileEntry {
/// Without its directory.
pub name: ::std::string::String,
pub r#type: FileType,
/// Of a regular file; 0 otherwise.
pub size_bytes: u64,
pub modify_time: ::core::option::Option<crate::Timestamp>,
/// Permission bits in octal, e.g. \"0644\".
pub mode: ::std::string::String,
/// As inside the container.
pub owner_uid: u32,
pub owner_gid: u32,
/// When SYMLINK.
pub symlink_target: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum FileType {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
File,
Directory,
Symlink,
/// A device, socket or FIFO.
Other,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// Where a path of a service's container lies, which says whether it lasts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum FileLocation {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// The container's own files, its image and what it wrote outside volumes, and its scratch space (an anonymous volume, a tmpfs): lost when it is recreated.
Container,
/// A named volume ([`ReadPathResponse::volume`](crate::types::ReadPathResponse::volume)): kept across deploys and backed up.
Volume,
/// The project's files, mounted read-only from its source as deployed: change them with [`Client::deploy_project`](crate::Client::deploy_project).
ProjectFiles,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What [`Client::read_path`](crate::Client::read_path) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ReadPathRequest {
pub project_id: ::std::string::String,
/// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
pub root: ::core::option::Option<ReadPathRequestRoot>,
/// From the root, e.g. \"/compose.yaml\", \"/data/uploads\". Empty = \"/\": the root's entries.
pub path: ::std::string::String,
/// 0 = 200. Also ends at \~64 KiB.
pub entry_limit: u32,
/// File offset.
pub offset_bytes: u64,
/// ≤1 MiB; 0 = 64 KiB.
pub length_bytes: u32,
/// The previous `next_entry_page_token`, other fields unchanged.
pub entry_page_token: ::std::string::String,
}
/// The oneof [`ReadPathRequest::root`](crate::types::ReadPathRequest::root): one of its members.
///
/// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum ReadPathRequestRoot {
/// In its container.
Service(::std::string::String),
/// In the volume, from its root.
Volume(::std::string::String),
}
/// What [`Client::read_path`](crate::Client::read_path) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ReadPathResponse {
/// The path itself, symlinks followed; a symlink whose target does not exist is its own entry.
pub entry: ::core::option::Option<FileEntry>,
/// With `service`: where the path lies. Unspecified otherwise: the request says it.
pub location: FileLocation,
/// With `service`: the volume the path lies on, when location is VOLUME. Else empty.
pub volume: ::std::string::String,
/// A directory's: directories first, then by name (bytewise).
pub entries: ::std::vec::Vec<FileEntry>,
/// A directory's in all.
pub entry_count: u32,
/// Set = more entries follow these: pass it as `entry_page_token`.
pub next_entry_page_token: ::std::string::String,
/// A text file's contents from `offset_bytes`, ending on a whole character. Untrusted.
pub text: ::std::string::String,
/// True = the file is binary (a NUL byte in its first 8 KiB): no text. Download it with [`Client::create_transfer`](crate::Client::create_transfer).
pub binary: bool,
/// Where the next read of the file starts. 0 = the read reached its end.
pub next_offset_bytes: u64,
/// The project's files: the deploy whose files these are. Pass it as [`Client::deploy_project`](crate::Client::deploy_project)\'s `base_deploy_id` to be refused if they changed since you read them.
pub deploy_id: ::std::string::String,
}
/// What [`Client::create_transfer`](crate::Client::create_transfer) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CreateTransferRequest {
pub transfer: ::core::option::Option<CreateTransferRequestTransfer>,
}
/// The oneof [`CreateTransferRequest::transfer`](crate::types::CreateTransferRequest::transfer): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum CreateTransferRequestTransfer {
UploadArchive(ArchiveUpload),
UploadFile(FileUpload),
Download(PathDownload),
DownloadDatabase(DatabaseDump),
}
/// The project's directory as a zip, tar or tar.gz (told by content), for [`Client::create_project`](crate::Client::create_project)\'s or [`Client::deploy_project`](crate::Client::deploy_project)\'s `upload_id`: {} is enough. A single top folder is unwrapped; .git, \_\_MACOSX, .`DS_Store`, .\_\* are dropped. Leave out what the build makes again (`node_modules`, .venv, target).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ArchiveUpload {
/// The archive's name for people, e.g. \"recipes.zip\". Empty = \"archive.tgz\".
pub file_name: ::std::string::String,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct FileUpload {
pub project_id: ::std::string::String,
pub root: ::core::option::Option<FileUploadRoot>,
/// From the root, e.g. \"/data/uploads/a.jpg\".
pub path: ::std::string::String,
}
/// The oneof [`FileUpload::root`](crate::types::FileUpload::root): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum FileUploadRoot {
/// In its container.
Service(::std::string::String),
/// In the volume, from its root.
Volume(::std::string::String),
}
/// A directory comes as a .tar of what [`Client::read_path`](crate::Client::read_path) shows; symlinks kept.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct PathDownload {
pub project_id: ::std::string::String,
/// Where the path is. Neither = the project's deployed files.
pub root: ::core::option::Option<PathDownloadRoot>,
/// From the root. Empty = \"/\": the whole root.
pub path: ::std::string::String,
}
/// The oneof [`PathDownload::root`](crate::types::PathDownload::root): one of its members.
///
/// Where the path is. Neither = the project's deployed files.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum PathDownloadRoot {
/// In its container.
Service(::std::string::String),
/// In the volume, from its root.
Volume(::std::string::String),
}
/// A database project's dump: Postgres's in its custom format, Valkey's .rdb.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct DatabaseDump {
pub project_id: ::std::string::String,
/// Postgres: the database to dump. Empty = \"app\", the apps\'.
pub database: ::std::string::String,
}
/// What [`Client::create_transfer`](crate::Client::create_transfer) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct CreateTransferResponse {
/// On the machine's hostname ([`Machine::hostname`](crate::types::Machine::hostname)); it works once.
pub url: ::std::string::String,
/// \"PUT\" or \"GET\".
pub http_method: ::std::string::String,
/// Start the request before this.
pub expire_time: ::core::option::Option<crate::Timestamp>,
/// Does it in a shell. `upload_archive`: packs the current directory and sends it, e.g. \"tar czf - \-\-exclude=.git \-\-exclude=`node_modules` . | curl -sS \-\-fail-with-body -T - \'\<url\>\'\": run it in the project's directory (a ready archive: curl \-\-fail-with-body -T \<file\> \'\<url\>\'). `upload_file`: \"curl -sS \-\-fail-with-body -T \'\<file\>\' \'\<url\>\'\", with your file's path in place of its name. download: \"curl -sS \-\-fail-with-body -o \'photo.jpg\' \'\<url\>\'\".
pub command: ::std::string::String,
/// `upload_archive`: for [`CreateProjectRequest::upload_id`](crate::types::CreateProjectRequest::upload_id) or [`DeployProjectRequestVersion::UploadId`](crate::types::DeployProjectRequestVersion::UploadId) once the machine answered the PUT with 200.
pub upload_id: ::std::string::String,
/// `upload_file`: a file is at path now; the upload replaces it.
pub replaces: bool,
/// download: the name it saves as: a file's own; a directory's ends in \".tar\", and \"/\" is named after the project and its service or volume. `download_database`: \"\<`project_id`\>-\<database\>.dump\" or \"\<`project_id`\>.rdb\". Empty for an upload.
pub file_name: ::std::string::String,
/// `upload_archive`: the names `command` leaves out of the archive, wherever they lie in the directory. A program that packs the directory itself leaves out the same.
pub exclude_names: ::std::vec::Vec<::std::string::String>,
}
/// Detail of an [`ErrorCode::Unavailable`](crate::ErrorCode::Unavailable) error: an operation, or a short action, holds the project. The message says the same in words.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectBusy {
/// Empty = a short action, done while its caller waits: call again in a few seconds. Else wait for it with [`Client::get_operation`](crate::Client::get_operation), even while it is still starting; when it is your own `operation_id`, the first call with it is still starting it: call again.
pub operation_id: ::std::string::String,
/// Unspecified when `operation_id` is empty.
pub kind: OperationKind,
/// Since when it holds the project.
pub start_time: ::core::option::Option<crate::Timestamp>,
}
/// Detail of an [`ErrorCode::Aborted`](crate::ErrorCode::Aborted) error: `base_deploy_id` is not the current deploy: the project was deployed since you read it. Read it again ([`Project::deploy_id`](crate::types::Project::deploy_id)) and redo your change on its files.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectChanged {}
/// Detail of an [`ErrorCode::Unavailable`](crate::ErrorCode::Unavailable) error: the machine does not answer now, as while it restarts. Call again later.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineUnreachable {
/// Since when Pethost has not reached it, once that is over 3 minutes: then the person was told ([`Machine::alert_channels`](crate::types::Machine::alert_channels)). Absent = not known yet.
pub since_time: ::core::option::Option<crate::Timestamp>,
}
/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error: the machine's software predates what was asked. It comes with the machine's next update, which Pethost runs; nothing for the caller to do.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineUpdatePending {}
/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error from [`Client::link_database`](crate::Client::link_database) or `CreateDatabase`: a project of `link` cannot be linked to the database. Nothing changed.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DatabaseLinkRefusal {
/// The first one refused.
pub project_id: ::std::string::String,
pub reason: DatabaseLinkRefusalReason,
/// `SERVICE_NAME_TAKEN`: its service.
pub service: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum DatabaseLinkRefusalReason {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// It is a database itself.
AppIsDatabase,
/// A service of it is named or aliased like the database, whose host it would hide: rename the service or its alias.
ServiceNameTaken,
/// The database has 20: unlink one first.
TooManyLinks,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error: the account has no machine to run projects on yet.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct NoMachine {
pub reason: NoMachineReason,
/// Where the person goes on in the browser: the page they pay at. An MCP tool leaves it out.
pub url: ::std::string::String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum NoMachineReason {
/// The zero value: absent, and not sent.
#[default]
Unspecified,
/// The person has not chosen and paid for a plan: they do it at url.
NoPlan,
/// The plan is paid and a machine is being prepared for the account: Pethost emails the person when it is ready. Call again later.
BeingPrepared,
/// A value this version of the crate does not know, as the number the API sent.
Unrecognized(i32),
}
/// What [`Client::watch_operation`](crate::Client::watch_operation) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct WatchOperationRequest {
pub project_id: ::std::string::String,
/// Empty = the latest.
pub operation_id: ::std::string::String,
}
/// What [`Client::watch_operation`](crate::Client::watch_operation) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct WatchOperationResponse {
pub message: ::core::option::Option<WatchOperationResponseMessage>,
}
/// The oneof [`WatchOperationResponse::message`](crate::types::WatchOperationResponse::message): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum WatchOperationResponseMessage {
Log(OperationLogLine),
/// Always the last message.
FinishedOperation(Operation),
/// A member this version of the crate does not know: the API set none it knows, and sent
/// fields it does not know. Sent, it counts as no member.
Unrecognized,
}
/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TailContainerLogsRequest {
pub project_id: ::std::string::String,
pub filter: ::core::option::Option<ContainerLogFilter>,
/// Empty = only lines written from now on.
pub after_cursor: ::std::string::String,
}
/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TailContainerLogsResponse {
pub line: ::core::option::Option<LogLine>,
/// To reconnect after this line.
pub cursor: ::std::string::String,
}
/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TailHttpTrafficRequest {
pub project_id: ::std::string::String,
pub filter: ::core::option::Option<HttpTrafficFilter>,
/// 0 = only requests from now on.
pub after_sequence: u64,
}
/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TailHttpTrafficResponse {
pub request: ::core::option::Option<HttpRequest>,
}