pethost/types.rs
1// @generated by protoc-gen-panel-rust from v1/panel.proto. DO NOT EDIT.
2
3//! The API's messages, enums and oneofs.
4//!
5//! A struct without `#[non_exhaustive]` is one a request holds: write it as a literal that ends in
6//! `..Default::default()`.
7//!
8//! # JSON
9//!
10//! Every struct and enum here is `serde`'s `Serialize` and `Deserialize`, and its JSON is the
11//! API's own, as the API answers and takes it over HTTP and as
12//! [its reference](https://pethost.dev/docs/api/) shows it:
13//!
14//! - a field under its name in the proto, as the struct has it: `project_id`;
15//! - a field that is absent, or an unmarked one at its zero, left out;
16//! - an enum as its value's name, `"OPERATION_STATUS_RUNNING"`, and a value this version does
17//! not know, `Unrecognized(number)`, as the number;
18//! - a 64-bit integer as a string, a time as RFC 3339, bytes as base64;
19//! - a oneof as the field of the member that is set, beside its message's other fields. A
20//! oneof's enum has no JSON of its own, and its `Unrecognized` is written as no member.
21//!
22//! Reading takes the same form, and a 64-bit integer as a number too. It refuses a field this
23//! version does not know, any other spelling of one (`projectId`) and an enum's name it does
24//! not know, as the API refuses a field it does not have: a misspelled field cannot make a call
25//! that does something else. The JSON of a later API, with a field added since, is refused so
26//! too.
27//!
28//! ```
29//! use pethost::types::{FileChange, FileChangeChange};
30//!
31//! fn main() -> Result<(), serde_json::Error> {
32//! let change = FileChange {
33//! path: "/hello.txt".into(),
34//! change: Some(FileChangeChange::Text("Hello".into())),
35//! ..Default::default()
36//! };
37//!
38//! // The API's JSON, and the message back from it.
39//! let json = serde_json::to_string(&change)?;
40//! assert_eq!(json, r#"{"path":"/hello.txt","text":"Hello"}"#);
41//! assert_eq!(serde_json::from_str::<FileChange>(&json)?, change);
42//!
43//! // A field the API does not have is refused: here, one misspelled.
44//! assert!(serde_json::from_str::<FileChange>(r#"{"pth": "/hello.txt"}"#).is_err());
45//! Ok(())
46//! }
47//! ```
48
49/// What [`Client::get_machine`](crate::Client::get_machine) takes.
50#[derive(Debug, Clone, PartialEq, Default)]
51pub struct GetMachineRequest {}
52
53/// What [`Client::get_machine`](crate::Client::get_machine) returns.
54#[derive(Debug, Clone, PartialEq, Default)]
55#[non_exhaustive]
56pub struct GetMachineResponse {
57 pub machine: ::core::option::Option<Machine>,
58 /// By `project_id`.
59 pub projects: ::std::vec::Vec<ProjectSummary>,
60 /// 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.
61 pub deleted_projects: ::std::vec::Vec<DeletedProject>,
62 pub github: ::core::option::Option<GithubConnection>,
63}
64
65#[derive(Debug, Clone, PartialEq, Default)]
66#[non_exhaustive]
67pub struct Machine {
68 /// Its plan's name, e.g. \"Starter\".
69 pub name: ::std::string::String,
70 /// Where it runs, e.g. \"Europe\". Empty = not known.
71 pub location: ::std::string::String,
72 /// When the figures below were read.
73 pub sample_time: ::core::option::Option<crate::Timestamp>,
74 /// By projects and builds.
75 pub cpu_used_cores: f64,
76 pub cpu_total_cores: f64,
77 /// Without page cache, as `docker stats` counts.
78 pub memory_used_bytes: u64,
79 /// The machine's, less a reserve for the system.
80 pub memory_total_bytes: u64,
81 /// 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.
82 pub disk_used_bytes: u64,
83 pub disk_total_bytes: u64,
84 pub disk_usage: ::core::option::Option<DiskUsage>,
85 /// 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.
86 pub hostname: ::std::string::String,
87 /// \"SHA256:\.\.\.\", to check on the first connection.
88 pub ssh_host_key_fingerprint: ::std::string::String,
89 /// 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.
90 pub ssh_keys: ::std::vec::Vec<SshKey>,
91 /// 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.
92 pub backups_enabled: bool,
93 /// 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.
94 pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
95 /// 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.
96 pub snapshot_list_failure_message: ::std::string::String,
97 /// Snapshots are pruned once they are this many hours older than their project's newest. 0 = kept forever: nothing deletes them.
98 pub backup_retention_hours: u32,
99 /// 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.
100 pub acme_enabled: bool,
101 /// 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.
102 pub apps_domain: ::std::string::String,
103 pub daemon_version: ::std::string::String,
104 pub docker_version: ::std::string::String,
105 pub boot_time: ::core::option::Option<crate::Timestamp>,
106 /// When an update started to need a machine restart. Absent = none is needed.
107 pub restart_required_time: ::core::option::Option<crate::Timestamp>,
108 /// 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.
109 pub scheduled_restart_time: ::core::option::Option<crate::Timestamp>,
110 /// What people have open in the containers now, oldest first: at most 100, the most the machine holds at once.
111 pub sessions: ::std::vec::Vec<MachineSession>,
112 /// 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.
113 pub alert_channels: ::std::vec::Vec<AlertDestination>,
114}
115
116/// A channel Pethost tells the person of incidents on ([`Machine::alert_channels`](crate::types::Machine::alert_channels)).
117#[derive(Debug, Clone, PartialEq, Default)]
118#[non_exhaustive]
119pub struct AlertDestination {
120 pub kind: AlertChannelKind,
121 /// The chat's title, or \"#ops · Acme\". Empty for email.
122 pub label: ::std::string::String,
123}
124
125#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
126#[non_exhaustive]
127pub enum AlertChannelKind {
128 /// The zero value: absent, and not sent.
129 #[default]
130 Unspecified,
131 /// The account's email.
132 Email,
133 /// A Telegram chat or group.
134 Telegram,
135 /// A Slack channel.
136 Slack,
137 /// A value this version of the crate does not know, as the number the API sent.
138 Unrecognized(i32),
139}
140
141/// Something a person has open in a container: a web terminal (`OpenTerminal`), 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.
142#[derive(Debug, Clone, PartialEq, Default)]
143#[non_exhaustive]
144pub struct MachineSession {
145 /// For [`RunMachineActionRequestAction::EndSessionId`](crate::types::RunMachineActionRequestAction::EndSessionId).
146 pub session_id: ::std::string::String,
147 pub kind: MachineSessionKind,
148 pub project_id: ::std::string::String,
149 pub service: ::std::string::String,
150 /// TUNNEL: the container's port.
151 pub port: u32,
152 pub start_time: ::core::option::Option<crate::Timestamp>,
153 /// The person's IP address.
154 pub client_address: ::std::string::String,
155 /// Through SSH: the key they logged in with, as it was then. Empty for `WEB_TERMINAL`.
156 pub ssh_key_label: ::std::string::String,
157 pub ssh_key_fingerprint: ::std::string::String,
158}
159
160#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
161#[non_exhaustive]
162pub enum MachineSessionKind {
163 /// The zero value: absent, and not sent.
164 #[default]
165 Unspecified,
166 /// The web panel's terminal.
167 WebTerminal,
168 /// A program in a terminal, such as `ssh`\'s shell.
169 SshTerminal,
170 /// A program without a terminal, such as `ssh ... <command>` or rsync.
171 SshCommand,
172 /// scp, sftp or sshfs.
173 Sftp,
174 /// One connection of an `ssh -L` tunnel to `port`.
175 Tunnel,
176 /// A value this version of the crate does not know, as the number the API sent.
177 Unrecognized(i32),
178}
179
180/// 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.
181#[derive(Debug, Clone, PartialEq, Default)]
182#[non_exhaustive]
183pub struct DiskUsage {
184 pub images_bytes: u64,
185 /// Absent = not known: Docker cannot size the build cache.
186 pub build_cache_bytes: ::core::option::Option<u64>,
187 pub volumes_bytes: u64,
188 /// What containers wrote outside volumes.
189 pub container_layers_bytes: u64,
190 /// Project directories and operation logs.
191 pub project_files_bytes: u64,
192 /// 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)).
193 pub container_logs_bytes: u64,
194 /// The HTTP request log.
195 pub http_traffic_bytes: u64,
196}
197
198#[derive(Debug, Clone, PartialEq, Default)]
199pub struct SshKey {
200 /// The public key, as in `authorized_keys`: \"ssh-ed25519 AAAA\.\.\.\"; never a private key.
201 pub public_key: ::std::string::String,
202 /// Shown in the panel and session logs, e.g. \"MacBook Pro\".
203 pub label: ::std::string::String,
204 /// \"SHA256:\.\.\.\". Ignored on input.
205 pub fingerprint: ::std::string::String,
206}
207
208/// 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.
209#[derive(Debug, Clone, PartialEq, Default)]
210#[non_exhaustive]
211pub struct GithubConnection {
212 /// As in https://github.com/apps/\<`app_name`\>.
213 pub app_name: ::std::string::String,
214 /// The panel's page that sends a signed-in person to GitHub to install the app on their repositories, or to change which.
215 pub install_url: ::std::string::String,
216 /// The repositories of the account's installations, most recently pushed first, at most 200.
217 pub repositories: ::std::vec::Vec<GithubRepository>,
218 /// In all.
219 pub repository_count: u32,
220 /// False = pushes reach the panel only by its check every 5 minutes, not at once.
221 pub webhooks_enabled: bool,
222}
223
224#[derive(Debug, Clone, PartialEq, Default)]
225#[non_exhaustive]
226pub struct GithubRepository {
227 /// \"owner/name\".
228 pub repository: ::std::string::String,
229 pub default_branch: ::std::string::String,
230 pub private: bool,
231 pub push_time: ::core::option::Option<crate::Timestamp>,
232}
233
234#[derive(Debug, Clone, PartialEq, Default)]
235#[non_exhaustive]
236pub struct DeletedProject {
237 pub project_id: ::std::string::String,
238 /// 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`).
239 pub newest_snapshot: ::core::option::Option<Snapshot>,
240 /// In all.
241 pub snapshot_count: u32,
242}
243
244/// What [`Client::run_machine_action`](crate::Client::run_machine_action) takes.
245#[derive(Debug, Clone, PartialEq, Default)]
246pub struct RunMachineActionRequest {
247 pub action: ::core::option::Option<RunMachineActionRequestAction>,
248}
249
250/// The oneof [`RunMachineActionRequest::action`](crate::types::RunMachineActionRequest::action): one of its members.
251#[derive(Debug, Clone, PartialEq)]
252#[non_exhaustive]
253#[allow(clippy::large_enum_variant)]
254pub enum RunMachineActionRequestAction {
255 /// label: one line, ≤100 chars; empty = the key's comment. An existing key gets the new label.
256 AddSshKey(SshKey),
257 /// A [`Machine::ssh_keys`](crate::types::Machine::ssh_keys) fingerprint; its sessions end. [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = no such key.
258 RemoveSshKeyFingerprint(::std::string::String),
259 /// 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.
260 RestartMachine(RestartMachineAction),
261 /// True = cancels the scheduled restart.
262 CancelRestart(bool),
263 /// 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.
264 EndSessionId(::std::string::String),
265}
266
267#[derive(Debug, Clone, PartialEq, Default)]
268pub struct RestartMachineAction {
269 /// Absent = now, or `at_maintenance_window`. [`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument) = in the past.
270 pub restart_time: ::core::option::Option<crate::Timestamp>,
271 /// True = the next nightly window ([`Machine::scheduled_restart_time`](crate::types::Machine::scheduled_restart_time)). Not with `restart_time`.
272 pub at_maintenance_window: bool,
273 /// False = wait for operations and nightly backups to end; true = cut them short.
274 pub interrupt_operations: bool,
275}
276
277/// What [`Client::run_machine_action`](crate::Client::run_machine_action) returns.
278#[derive(Debug, Clone, PartialEq, Default)]
279#[non_exhaustive]
280pub struct RunMachineActionResponse {
281 /// As changed.
282 pub machine: ::core::option::Option<Machine>,
283}
284
285#[derive(Debug, Clone, PartialEq, Default)]
286pub struct ProjectMetadata {
287 /// Empty = none: people see the id.
288 pub name: ::core::option::Option<::std::string::String>,
289 pub emoji: ::core::option::Option<::std::string::String>,
290 /// One line.
291 pub description: ::core::option::Option<::std::string::String>,
292 /// Free text.
293 pub notes: ::core::option::Option<::std::string::String>,
294}
295
296#[derive(Debug, Clone, PartialEq, Default)]
297#[non_exhaustive]
298pub struct ProjectSummary {
299 pub project_id: ::std::string::String,
300 pub metadata: ::core::option::Option<ProjectMetadata>,
301 /// Most urgent first. Empty = nothing wrong.
302 pub problems: ::std::vec::Vec<ProjectProblem>,
303 /// By name.
304 pub services: ::std::vec::Vec<ServiceSummary>,
305 /// The first route's host as a URL, e.g. \"https://recipes.example.com\". Empty = no route.
306 pub url: ::std::string::String,
307 /// Every host its routes use, in the routes\' order.
308 pub hosts: ::std::vec::Vec<::std::string::String>,
309 /// 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.
310 pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
311 pub cpu_used_cores: f64,
312 pub memory_used_bytes: u64,
313 /// As in Project.
314 pub deploy_time: ::core::option::Option<crate::Timestamp>,
315 /// Operations in progress, newest first: a backup can run beside another one.
316 pub running_operations: ::std::vec::Vec<Operation>,
317 /// A github project stays on its commit: [`GithubSource::pinned`](crate::types::GithubSource::pinned).
318 pub pinned: bool,
319 /// 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.
320 pub disk_used_bytes: u64,
321}
322
323#[derive(Debug, Clone, PartialEq, Default)]
324#[non_exhaustive]
325pub struct ServiceSummary {
326 pub service: ::std::string::String,
327 pub state: ServiceState,
328}
329
330/// Something that needs attention. A service has at most one, its cause first.
331#[derive(Debug, Clone, PartialEq, Default)]
332#[non_exhaustive]
333pub struct ProjectProblem {
334 pub kind: ProjectProblemKind,
335 /// Empty = not about one service. `DEPLOY_FAILED`: the service that failed it, when one did.
336 pub service: ::std::string::String,
337 /// `DEPLOY_FAILED`, `DEPLOY_CANCELLED`, `BACKUP_FAILED`, `RESTORE_FAILED`: the operation; [`Client::get_operation`](crate::Client::get_operation) gives its log.
338 pub operation_id: ::std::string::String,
339 /// `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.
340 pub since_time: ::core::option::Option<crate::Timestamp>,
341 /// 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.
342 pub problem_message: ::std::string::String,
343 /// The open incident that records it ([`Project::incidents`](crate::types::Project::incidents)). Empty = none yet.
344 pub incident_id: ::std::string::String,
345}
346
347#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
348#[non_exhaustive]
349pub enum ProjectProblemKind {
350 /// The zero value: absent, and not sent.
351 #[default]
352 Unspecified,
353 /// 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).
354 DeployFailed,
355 /// Running; its healthcheck fails.
356 ServiceUnhealthy,
357 /// Docker is restarting it, or it runs and Docker restarted it recently: likely a crash loop.
358 ServiceRestarting,
359 /// 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.
360 ServiceOutOfMemory,
361 /// The latest backup failed; its operation says why.
362 BackupFailed,
363 /// The latest deploy was cancelled; its operation says, with `made_current`, whether its files were applied.
364 DeployCancelled,
365 /// 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.
366 ServiceExited,
367 /// 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.
368 RestoreFailed,
369 /// 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.
370 AutoDeployRefused,
371 /// 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.
372 ServicePortClosed,
373 /// A site check ([`Project::alerts`](crate::types::Project::alerts)) failed 3 times in a row; service: the one its route sends to.
374 SiteDown,
375 /// A traffic rule on 5xx holds.
376 HttpErrors,
377 /// A traffic rule on p95 holds.
378 HttpSlow,
379 /// A value this version of the crate does not know, as the number the API sent.
380 Unrecognized(i32),
381}
382
383/// What [`Client::get_project`](crate::Client::get_project) takes.
384#[derive(Debug, Clone, PartialEq, Default)]
385pub struct GetProjectRequest {
386 pub project_id: ::std::string::String,
387 /// True = include env-file values ([`EnvironmentVariable::secret`](crate::types::EnvironmentVariable::secret)). To edit .env: [`Client::read_path`](crate::Client::read_path) /.env.
388 pub include_secret_values: bool,
389 /// Only older snapshots: the oldest `create_time` seen, to page back. Absent = the newest.
390 pub snapshots_before: ::core::option::Option<crate::Timestamp>,
391 /// Only snapshots holding this volume ([`Volume::snapshot_count`](crate::types::Volume::snapshot_count)). Empty = all.
392 pub snapshots_volume: ::std::string::String,
393 /// Only incidents that opened before it: the oldest `open_time` seen, to page back. Absent = the newest.
394 pub incidents_before: ::core::option::Option<crate::Timestamp>,
395 /// ≤90: [`Project::uptime_days`](crate::types::Project::uptime_days). 0 = none.
396 pub uptime_day_count: u32,
397 /// With `incidents_before`: the `incident_id` of the oldest seen, so that those that opened at the same time are not skipped.
398 pub incidents_before_id: ::std::string::String,
399}
400
401/// What [`Client::get_project`](crate::Client::get_project) returns.
402#[derive(Debug, Clone, PartialEq, Default)]
403#[non_exhaustive]
404pub struct GetProjectResponse {
405 pub project: ::core::option::Option<Project>,
406}
407
408#[derive(Debug, Clone, PartialEq, Default)]
409#[non_exhaustive]
410pub struct Project {
411 pub project_id: ::std::string::String,
412 pub metadata: ::core::option::Option<ProjectMetadata>,
413 pub problems: ::std::vec::Vec<ProjectProblem>,
414 /// As in [`ProjectSummary`](crate::types::ProjectSummary).
415 pub url: ::std::string::String,
416 pub cpu_used_cores: f64,
417 pub memory_used_bytes: u64,
418 /// 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.
419 pub deploy_id: ::std::string::String,
420 /// How that operation went, or is going. Unspecified = no deploy yet.
421 pub deploy_status: OperationStatus,
422 /// 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.
423 pub deploy_time: ::core::option::Option<crate::Timestamp>,
424 /// 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.
425 pub x_pethost_applies_at_once: bool,
426 /// By name.
427 pub services: ::std::vec::Vec<Service>,
428 /// Every one the machine holds for the project, by name.
429 pub volumes: ::std::vec::Vec<Volume>,
430 /// 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.
431 pub routes: ::std::vec::Vec<Route>,
432 /// Every host of the routes, in the order of its first route.
433 pub hosts: ::std::vec::Vec<Host>,
434 /// True = every route asks visitors for the project's password (`x_pethost.password`). The password itself is never returned.
435 pub password_protected: bool,
436 /// 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.
437 pub operations: ::std::vec::Vec<Operation>,
438 /// 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`).
439 pub snapshots: ::std::vec::Vec<Snapshot>,
440 /// The project's, in all; see `snapshot_list_time`.
441 pub snapshot_count: u32,
442 /// 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.
443 pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
444 /// Measured every few minutes.
445 pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
446 pub source: ::core::option::Option<ProjectSource>,
447 /// 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.
448 pub running_services_action: ::core::option::Option<RunningServicesAction>,
449 /// What Pethost watches and how each part stands. Absent = the machine's software predates alerts: they come with its next update.
450 pub alerts: ::core::option::Option<ProjectAlerts>,
451 /// 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.
452 pub incidents: ::std::vec::Vec<Incident>,
453 /// True = older ones remain: page with `incidents_before` and `incidents_before_id`.
454 pub more_incidents: bool,
455 /// Oldest first, [`GetProjectRequest::uptime_day_count`](crate::types::GetProjectRequest::uptime_day_count) of them, today's last.
456 pub uptime_days: ::std::vec::Vec<UptimeDay>,
457}
458
459/// A start, stop or restart of services that has not ended yet.
460#[derive(Debug, Clone, PartialEq, Default)]
461#[non_exhaustive]
462pub struct RunningServicesAction {
463 pub kind: ServicesActionKind,
464 /// Those it acts on.
465 pub services: ::std::vec::Vec<::std::string::String>,
466 pub start_time: ::core::option::Option<crate::Timestamp>,
467}
468
469#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
470#[non_exhaustive]
471pub enum ServicesActionKind {
472 /// The zero value: absent, and not sent.
473 #[default]
474 Unspecified,
475 Start,
476 Stop,
477 Restart,
478 /// A value this version of the crate does not know, as the number the API sent.
479 Unrecognized(i32),
480}
481
482/// Where the files come from (THE PROJECT IS ITS DIRECTORY).
483#[derive(Debug, Clone, PartialEq, Default)]
484pub struct ProjectSource {
485 pub kind: ::core::option::Option<ProjectSourceKind>,
486}
487
488/// The oneof [`ProjectSource::kind`](crate::types::ProjectSource::kind): one of its members.
489#[derive(Debug, Clone, PartialEq)]
490#[non_exhaustive]
491#[allow(clippy::large_enum_variant)]
492pub enum ProjectSourceKind {
493 /// True = the files live on the machine.
494 Files(bool),
495 Github(GithubSource),
496 /// A member this version of the crate does not know: the API set none it knows, and sent
497 /// fields it does not know. Sent, it counts as no member.
498 Unrecognized,
499}
500
501/// Input: an absent field keeps its value (`set_source`) or takes its default (new source).
502#[derive(Debug, Clone, PartialEq, Default)]
503pub struct GithubSource {
504 /// \"owner/name\", one of [`GetMachineResponse::github`](crate::types::GetMachineResponse::github)`.repositories`.
505 pub repository: ::core::option::Option<::std::string::String>,
506 /// Empty = the default branch, also when absent on a new source.
507 pub branch: ::core::option::Option<::std::string::String>,
508 /// The project's directory in it, e.g. \"apps/web\"; empty = the root.
509 pub directory: ::core::option::Option<::std::string::String>,
510 /// 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.
511 pub auto_deploy: ::core::option::Option<bool>,
512 /// Output: the branch's newest commit touching the directory, as of the last push or 5-minute check.
513 pub newest_commit: ::core::option::Option<GithubCommit>,
514 /// Output: the commit the files are at. Absent = no deploy, or the files came from another source.
515 pub deployed_commit: ::core::option::Option<GithubCommit>,
516 /// Output: `deployed_commit` set and `auto_deploy` off, e.g. after a rollback.
517 pub pinned: bool,
518 /// 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.
519 pub auto_deploy_pending: bool,
520}
521
522#[derive(Debug, Clone, PartialEq, Default)]
523pub struct GithubCommit {
524 /// Full.
525 pub sha: ::std::string::String,
526 /// First line of its message. Untrusted.
527 pub title: ::std::string::String,
528 /// On github.com.
529 pub url: ::std::string::String,
530}
531
532#[derive(Debug, Clone, PartialEq, Default)]
533#[non_exhaustive]
534pub struct Service {
535 pub service: ::std::string::String,
536 pub state: ServiceState,
537 /// 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.
538 pub container_running: bool,
539 /// The image as compose.yaml names it; for `build:` without `image:`, the name Compose gives.
540 pub image: ::std::string::String,
541 /// Built on the machine from a `build:` section.
542 pub builds_image: bool,
543 /// The registry digest it was pulled as, \"sha256:\.\.\.\". Empty for a built image.
544 pub image_digest: ::std::string::String,
545 /// Absent until the machine next measures sizes, every few minutes, as after a build or pull.
546 pub image_size_bytes: u64,
547 /// 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.
548 pub command: ::std::vec::Vec<::std::string::String>,
549 pub run_as_user: ::std::string::String,
550 /// Of the current or last run.
551 pub start_time: ::core::option::Option<crate::Timestamp>,
552 /// 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.
553 pub finish_time: ::core::option::Option<crate::Timestamp>,
554 pub exit_code: ::core::option::Option<i32>,
555 pub out_of_memory: bool,
556 /// Restarts by Docker since the container was created.
557 pub restart_count: u32,
558 pub cpu_used_cores: f64,
559 pub memory_used_bytes: u64,
560 /// 0 = no limit: it shares the machine.
561 pub memory_limit_bytes: u64,
562 /// 0 = no limit.
563 pub cpu_limit_cores: f64,
564 /// Written outside volumes: lost on a recreate.
565 pub writable_layer_bytes: u64,
566 /// 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>`.
567 pub ports: ::std::vec::Vec<u32>,
568 /// 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.
569 pub listening_ports: ::std::vec::Vec<u32>,
570 /// The ports `ports:` opens on the machine now: not one a route serves, nor one bound to 127.0.0.1.
571 pub published_ports: ::std::vec::Vec<PublishedPort>,
572 pub volume_mounts: ::std::vec::Vec<VolumeMount>,
573 pub restart_policy: RestartPolicy,
574 /// Absent = no healthcheck.
575 pub health_check: ::core::option::Option<HealthCheck>,
576 /// What the container is configured with, not what its image sets.
577 pub environment: ::std::vec::Vec<EnvironmentVariable>,
578 /// 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).
579 pub env_files: ::std::vec::Vec<::std::string::String>,
580 /// 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).
581 pub ssh_command: ::std::string::String,
582}
583
584#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
585#[non_exhaustive]
586pub enum ServiceState {
587 /// The zero value: absent, and not sent.
588 #[default]
589 Unspecified,
590 /// Declared; no container yet.
591 NotCreated,
592 /// Starting, or created while an operation that starts containers runs (deploy, `recreate_service`, restore); its healthcheck has not passed yet.
593 Starting,
594 /// Running, without a healthcheck.
595 Running,
596 /// Running; its healthcheck passes.
597 Healthy,
598 /// Running; its healthcheck fails.
599 Unhealthy,
600 /// Exited and Docker is restarting it.
601 Restarting,
602 /// Not running: stopped by `stop_services` or a restore, never started, paused or dead.
603 Stopped,
604 /// Not running: it exited on its own (see `exit_code`; 0 = a job that finished).
605 Exited,
606 /// A value this version of the crate does not know, as the number the API sent.
607 Unrecognized(i32),
608}
609
610/// A port that `ports:` opens on the machine directly, to anyone, bypassing the proxy.
611#[derive(Debug, Clone, PartialEq, Default)]
612#[non_exhaustive]
613pub struct PublishedPort {
614 /// 0 = Docker picks one when the container starts.
615 pub machine_port: u32,
616 pub container_port: u32,
617 /// \"tcp\", \"udp\" or \"sctp\".
618 pub protocol: ::std::string::String,
619}
620
621#[derive(Debug, Clone, PartialEq, Default)]
622#[non_exhaustive]
623pub struct VolumeMount {
624 pub volume: ::std::string::String,
625 /// E.g. \"/var/lib/postgresql/data\".
626 pub container_path: ::std::string::String,
627}
628
629/// Docker's restart policies: what happens when the process exits, and when the machine starts.
630#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
631#[non_exhaustive]
632pub enum RestartPolicy {
633 /// The zero value: absent, and not sent.
634 #[default]
635 Unspecified,
636 /// Never restarted.
637 No,
638 /// 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.
639 OnFailure,
640 /// Always restarted, unless stopped with [`RunProjectActionRequestAction::StopServices`](crate::types::RunProjectActionRequestAction::StopServices).
641 UnlessStopped,
642 Always,
643 /// A value this version of the crate does not know, as the number the API sent.
644 Unrecognized(i32),
645}
646
647/// The healthcheck Docker runs: compose.yaml's, else the image's HEALTHCHECK.
648#[derive(Debug, Clone, PartialEq, Default)]
649#[non_exhaustive]
650pub struct HealthCheck {
651 /// 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.
652 pub command: ::std::vec::Vec<::std::string::String>,
653 /// How often Docker runs it.
654 pub interval_seconds: u32,
655 /// Absent while the service is not running.
656 pub status: HealthStatus,
657 pub consecutive_failure_count: u32,
658 /// Up to the last 5 checks, oldest first.
659 pub recent_results_passed: ::std::vec::Vec<bool>,
660 /// Of the latest failed check, at most 4 KiB. Untrusted.
661 pub last_failure_output: ::std::string::String,
662}
663
664#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
665#[non_exhaustive]
666pub enum HealthStatus {
667 /// The zero value: absent, and not sent.
668 #[default]
669 Unspecified,
670 Starting,
671 Healthy,
672 Unhealthy,
673 /// A value this version of the crate does not know, as the number the API sent.
674 Unrecognized(i32),
675}
676
677#[derive(Debug, Clone, PartialEq, Default)]
678#[non_exhaustive]
679pub struct EnvironmentVariable {
680 pub name: ::std::string::String,
681 /// Absent when empty, when `secret` and [`Client::get_project`](crate::Client::get_project) had no `include_secret_values`, or when `value_left_out`.
682 pub value: ::std::string::String,
683 /// 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.
684 pub secret: bool,
685 /// 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.
686 pub source_file: ::std::string::String,
687 /// When compose.yaml builds it from `${...}`: the .env variables to edit to change it.
688 pub from_env_file_variables: ::std::vec::Vec<::std::string::String>,
689 /// 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).
690 pub value_left_out: bool,
691}
692
693#[derive(Debug, Clone, PartialEq, Default)]
694#[non_exhaustive]
695pub struct Volume {
696 pub volume: ::std::string::String,
697 /// Measured every few minutes.
698 pub size_bytes: u64,
699 pub mounted_by: ::std::vec::Vec<VolumeMountedBy>,
700 /// 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)).
701 pub last_backup_time: ::core::option::Option<crate::Timestamp>,
702 /// 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).
703 pub snapshot_count: u32,
704 /// 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.
705 pub declared: bool,
706}
707
708#[derive(Debug, Clone, PartialEq, Default)]
709#[non_exhaustive]
710pub struct VolumeMountedBy {
711 pub service: ::std::string::String,
712 pub container_path: ::std::string::String,
713}
714
715/// A host of [`Project::routes`](crate::types::Project::routes), with its certificate.
716#[derive(Debug, Clone, PartialEq, Default)]
717#[non_exhaustive]
718pub struct Host {
719 /// As x-pethost.routes\[\].host.
720 pub host: ::std::string::String,
721 /// \"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.
722 pub url: ::std::string::String,
723 pub certificate_source: CertificateSource,
724 /// When the certificate served expires. Absent = none is served yet.
725 pub certificate_expire_time: ::core::option::Option<crate::Timestamp>,
726 /// 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.
727 pub unavailable_message: ::std::string::String,
728}
729
730/// An x-pethost route: requests for `host` under `path` go to `port` of `service`. The field names are the YAML keys.
731#[derive(Debug, Clone, PartialEq, Default)]
732pub struct Route {
733 /// `<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.
734 pub host: ::std::string::String,
735 /// Whole segments, the longest wins. Empty = \"/\": every path.
736 pub path: ::std::string::String,
737 pub service: ::std::string::String,
738 /// The port the service listens on in its container, at 0.0.0.0.
739 pub port: u32,
740 /// True = the path's prefix is removed from the request.
741 pub strip_path: bool,
742}
743
744#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
745#[non_exhaustive]
746pub enum CertificateSource {
747 /// The zero value: absent, and not sent.
748 #[default]
749 Unspecified,
750 /// 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.
751 None,
752 /// A certificate installed on the machine covers it.
753 Installed,
754 /// From Let's Encrypt, renewed automatically.
755 Automatic,
756 /// A value this version of the crate does not know, as the number the API sent.
757 Unrecognized(i32),
758}
759
760#[derive(Debug, Clone, PartialEq, Default)]
761#[non_exhaustive]
762pub struct Operation {
763 pub operation_id: ::std::string::String,
764 pub kind: OperationKind,
765 pub status: OperationStatus,
766 pub start_time: ::core::option::Option<crate::Timestamp>,
767 /// Absent while in progress.
768 pub finish_time: ::core::option::Option<crate::Timestamp>,
769 /// When FAILED: why, for people. The log says more.
770 pub failure_message: ::std::string::String,
771 /// DEPLOY or `RECREATE_SERVICE` that FAILED: why, to branch on.
772 pub deploy_failure_reason: DeployFailureReason,
773 /// 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.
774 pub made_current: bool,
775 /// `RECREATE_SERVICE`: the service. A failed DEPLOY or `RECREATE_SERVICE`: the service that failed.
776 pub service: ::std::string::String,
777 /// DEPLOY or `RECREATE_SERVICE` that failed `CONTAINER_EXITED`.
778 pub failed_exit_code: i32,
779 /// BACKUP, or DELETE's final backup, that succeeded: the snapshot taken. RESTORE: the snapshot restored.
780 pub snapshot_id: ::std::string::String,
781 /// RESTORE: the volumes it replaced.
782 pub restored_volumes: ::std::vec::Vec<::std::string::String>,
783 /// RESTORE: the backup taken first; restore it to undo. Empty = none was taken.
784 pub undo_snapshot_id: ::std::string::String,
785 /// DEPLOY of a github project: the commit its files are, also when it changed only /.env or x-pethost.
786 pub github_commit: ::core::option::Option<GithubCommit>,
787 /// DEPLOY of an uploaded archive: its file name.
788 pub archive_name: ::std::string::String,
789 /// 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.
790 pub adjustments: ::std::vec::Vec<::std::string::String>,
791 /// 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.
792 pub changed_paths: ::std::vec::Vec<::std::string::String>,
793 /// DEPLOY: the paths its request changed, in all.
794 pub changed_path_count: u32,
795 /// 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.
796 pub files_kept: bool,
797 /// 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.
798 pub files_operation_id: ::std::string::String,
799}
800
801#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
802#[non_exhaustive]
803pub enum OperationKind {
804 /// The zero value: absent, and not sent.
805 #[default]
806 Unspecified,
807 Deploy,
808 RecreateService,
809 Backup,
810 Restore,
811 Delete,
812 /// A value this version of the crate does not know, as the number the API sent.
813 Unrecognized(i32),
814}
815
816#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
817#[non_exhaustive]
818pub enum OperationStatus {
819 /// The zero value: absent, and not sent.
820 #[default]
821 Unspecified,
822 InProgress,
823 Succeeded,
824 Failed,
825 Cancelled,
826 /// A value this version of the crate does not know, as the number the API sent.
827 Unrecognized(i32),
828}
829
830#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
831#[non_exhaustive]
832pub enum DeployFailureReason {
833 /// The zero value: absent, and not sent.
834 #[default]
835 Unspecified,
836 /// A wrong name or tag, or a private image.
837 ImagePullFailed,
838 ImageBuildFailed,
839 /// E.g. the command does not exist.
840 ContainerStartFailed,
841 DiskFull,
842 /// Includes a machine restart during the operation.
843 Internal,
844 /// A `ports:` machine port is taken.
845 PortUnavailable,
846 /// Exited, or kept restarting, after starting.
847 ContainerExited,
848 ContainerUnhealthy,
849 TimedOut,
850 /// The image declares a VOLUME no mount covers: it would never be backed up. Mount a named volume there.
851 UncoveredImageVolume,
852 /// The running projects leave too little memory for a build; the message says how much.
853 BuildMemoryUnavailable,
854 /// A value this version of the crate does not know, as the number the API sent.
855 Unrecognized(i32),
856}
857
858#[derive(Debug, Clone, PartialEq, Default)]
859#[non_exhaustive]
860pub struct Snapshot {
861 pub snapshot_id: ::std::string::String,
862 pub create_time: ::core::option::Option<crate::Timestamp>,
863 /// Of its files, the directory and every volume. 0 = not known.
864 pub size_bytes: u64,
865 /// The volumes it holds, besides the project's directory.
866 pub volumes: ::std::vec::Vec<::std::string::String>,
867}
868
869#[derive(Debug, Clone, PartialEq, Default)]
870#[non_exhaustive]
871pub struct HttpTrafficSummary {
872 pub request_count: u64,
873 /// 5xx responses.
874 pub server_error_count: u64,
875 /// Of responses: WebSockets, logged when they close, count as requests but not here.
876 pub latency_p50_ms: u32,
877 pub latency_p95_ms: u32,
878}
879
880/// What [`Client::create_project`](crate::Client::create_project) takes.
881#[derive(Debug, Clone, PartialEq, Default)]
882pub struct CreateProjectRequest {
883 /// New, \[a-z0-9\]\[a-z0-9\_-\]\*, ≤63 chars; immutable.
884 pub project_id: ::std::string::String,
885 /// Set = a GitHub project: {github: {repository}}. Absent = the files of this request.
886 pub source: ::core::option::Option<ProjectSource>,
887 /// 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`.
888 pub upload_id: ::std::string::String,
889 /// 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.
890 pub files: ::std::vec::Vec<FileChange>,
891 /// Changes to the files\' x-pethost: the name people see, the routes, a password.
892 pub x_pethost: ::core::option::Option<ProjectExtension>,
893 /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `timeout_seconds`.
894 pub timeout_seconds: u32,
895 /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `operation_id`.
896 pub operation_id: ::std::string::String,
897 /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `wait_seconds`.
898 pub wait_seconds: ::core::option::Option<u32>,
899}
900
901/// What [`Client::create_project`](crate::Client::create_project) returns.
902#[derive(Debug, Clone, PartialEq, Default)]
903#[non_exhaustive]
904pub struct CreateProjectResponse {
905 /// 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.
906 pub operation: ::core::option::Option<Operation>,
907 pub violations: ::std::vec::Vec<SpecViolation>,
908 /// 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.
909 pub adjustments: ::std::vec::Vec<::std::string::String>,
910 /// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
911 pub project: ::core::option::Option<Project>,
912 /// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
913 pub log: ::std::vec::Vec<OperationLogLine>,
914}
915
916/// What [`Client::deploy_project`](crate::Client::deploy_project) takes.
917#[derive(Debug, Clone, PartialEq, Default)]
918pub struct DeployProjectRequest {
919 pub project_id: ::std::string::String,
920 /// [`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.
921 pub base_deploy_id: ::std::string::String,
922 /// 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.
923 pub files: ::std::vec::Vec<FileChange>,
924 /// Edits x-pethost by part, after `files`: metadata by key; routes all at once.
925 pub x_pethost: ::core::option::Option<ProjectExtension>,
926 /// Not with `upload_id`, or github.
927 pub mount_volume: ::core::option::Option<MountVolume>,
928 /// For the whole deploy, builds included; 0 = default.
929 pub timeout_seconds: u32,
930 /// 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.
931 pub operation_id: ::std::string::String,
932 /// A new version of the files; none = the current one.
933 pub version: ::core::option::Option<DeployProjectRequestVersion>,
934 /// 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.
935 pub wait_seconds: ::core::option::Option<u32>,
936}
937
938/// The oneof [`DeployProjectRequest::version`](crate::types::DeployProjectRequest::version): one of its members.
939///
940/// A new version of the files; none = the current one.
941#[derive(Debug, Clone, PartialEq)]
942#[non_exhaustive]
943#[allow(clippy::large_enum_variant)]
944pub enum DeployProjectRequestVersion {
945 /// files project: an archive from [`Client::create_transfer`](crate::Client::create_transfer); replaces all files but /.env and x-pethost.
946 UploadId(::std::string::String),
947 /// github project: a commit of its branch (SHA, ≥7 chars), from [`Client::list_commits`](crate::Client::list_commits).
948 Commit(::std::string::String),
949 /// github project: true = [`GithubSource::newest_commit`](crate::types::GithubSource::newest_commit), read now.
950 NewestCommit(bool),
951 /// 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.
952 RollbackDeployId(::std::string::String),
953}
954
955/// Adds `<volume>:<container_path>` to the service, declaring the volume if needed.
956#[derive(Debug, Clone, PartialEq, Default)]
957pub struct MountVolume {
958 /// A service of compose.yaml.
959 pub service: ::std::string::String,
960 /// New, or one of [`Project::volumes`](crate::types::Project::volumes).
961 pub volume: ::std::string::String,
962 /// Absolute, e.g. \"/data\".
963 pub container_path: ::std::string::String,
964}
965
966/// x-pethost as data. Absent parts stay.
967#[derive(Debug, Clone, PartialEq, Default)]
968pub struct ProjectExtension {
969 /// Sets the fields given; an empty one is removed.
970 pub metadata: ::core::option::Option<ProjectMetadata>,
971 /// 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.
972 pub routes: ::std::vec::Vec<Route>,
973 /// True = the project has no route from now on. Not with routes.
974 pub remove_routes: bool,
975 /// Visitors of every route must enter it. Empty = it stays.
976 pub password: ::std::string::String,
977 /// True = no password. Not with password.
978 pub remove_password: bool,
979}
980
981/// `path` and exactly one change.
982#[derive(Debug, Clone, PartialEq, Default)]
983pub struct FileChange {
984 /// Absolute in the project's directory.
985 pub path: ::std::string::String,
986 pub change: ::core::option::Option<FileChangeChange>,
987 /// With text or data: mode 0755, not 0644.
988 pub executable: bool,
989}
990
991/// The oneof [`FileChange::change`](crate::types::FileChange::change): one of its members.
992#[derive(Debug, Clone, PartialEq)]
993#[non_exhaustive]
994#[allow(clippy::large_enum_variant)]
995pub enum FileChangeChange {
996 /// Writes the file as UTF-8 text, creating parents.
997 Text(::std::string::String),
998 /// Writes the file as bytes, likewise.
999 Data(::std::vec::Vec<u8>),
1000 /// True = creates it and its parents.
1001 MakeDirectory(bool),
1002 /// True = deletes the file, symlink or empty directory.
1003 Delete(bool),
1004 /// True = deletes a directory recursively, if present.
1005 DeleteTree(bool),
1006 /// Moves it to this path.
1007 RenameTo(::std::string::String),
1008}
1009
1010/// What [`Client::deploy_project`](crate::Client::deploy_project) returns.
1011#[derive(Debug, Clone, PartialEq, Default)]
1012#[non_exhaustive]
1013pub struct DeployProjectResponse {
1014 /// The deploy: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)). Absent when violations stopped it.
1015 pub operation: ::core::option::Option<Operation>,
1016 /// Why the files cannot be deployed: nothing changed and no operation started.
1017 pub violations: ::std::vec::Vec<SpecViolation>,
1018 /// As in [`CreateProjectResponse`](crate::types::CreateProjectResponse): with violations only.
1019 pub adjustments: ::std::vec::Vec<::std::string::String>,
1020 /// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
1021 pub project: ::core::option::Option<Project>,
1022 /// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
1023 pub log: ::std::vec::Vec<OperationLogLine>,
1024}
1025
1026#[derive(Debug, Clone, PartialEq, Default)]
1027#[non_exhaustive]
1028pub struct SpecViolation {
1029 /// Empty = not about one service.
1030 pub service: ::std::string::String,
1031 /// 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\".
1032 pub location: ::std::string::String,
1033 /// What is wrong and what to write instead.
1034 pub violation_message: ::std::string::String,
1035}
1036
1037/// What [`Client::list_commits`](crate::Client::list_commits) takes.
1038#[derive(Debug, Clone, PartialEq, Default)]
1039pub struct ListCommitsRequest {
1040 pub project_id: ::std::string::String,
1041 /// The previous page's last sha. Empty = from the newest.
1042 pub before_commit: ::std::string::String,
1043}
1044
1045/// What [`Client::list_commits`](crate::Client::list_commits) returns.
1046#[derive(Debug, Clone, PartialEq, Default)]
1047#[non_exhaustive]
1048pub struct ListCommitsResponse {
1049 /// Newest first, at most 30.
1050 pub commits: ::std::vec::Vec<BranchCommit>,
1051 /// Older ones exist: pass the last one's sha as `before_commit`.
1052 pub more: bool,
1053}
1054
1055#[derive(Debug, Clone, PartialEq, Default)]
1056#[non_exhaustive]
1057pub struct BranchCommit {
1058 pub commit: ::core::option::Option<GithubCommit>,
1059 /// The author's GitHub login, else their name. Untrusted.
1060 pub author: ::std::string::String,
1061 /// When it was committed.
1062 pub commit_time: ::core::option::Option<crate::Timestamp>,
1063 /// The project's files are this commit ([`GithubSource::deployed_commit`](crate::types::GithubSource::deployed_commit)).
1064 pub deployed: bool,
1065 /// The newest deploy of it among the operations the machine keeps; its status says how it went. Absent = none.
1066 pub last_deploy: ::core::option::Option<Operation>,
1067 /// 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)).
1068 pub newest: bool,
1069}
1070
1071/// What [`Client::run_project_action`](crate::Client::run_project_action) takes.
1072#[derive(Debug, Clone, PartialEq, Default)]
1073pub struct RunProjectActionRequest {
1074 pub project_id: ::std::string::String,
1075 pub action: ::core::option::Option<RunProjectActionRequestAction>,
1076 /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
1077 pub operation_id: ::std::string::String,
1078 /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
1079 pub wait_seconds: ::core::option::Option<u32>,
1080}
1081
1082/// The oneof [`RunProjectActionRequest::action`](crate::types::RunProjectActionRequest::action): one of its members.
1083#[derive(Debug, Clone, PartialEq)]
1084#[non_exhaustive]
1085#[allow(clippy::large_enum_variant)]
1086pub enum RunProjectActionRequestAction {
1087 /// 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.
1088 StartServices(ServicesAction),
1089 /// Stops services, each with its grace period. A machine restart may start them, per restart policy.
1090 StopServices(ServicesAction),
1091 /// Restarts processes in the same containers. Codes as `start_services`.
1092 RestartServices(ServicesAction),
1093 /// A new container: a fresh filesystem outside volumes. An operation.
1094 RecreateService(RecreateServiceAction),
1095 /// 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)).
1096 BackUp(BackUpAction),
1097 /// From a snapshot of this project. An operation.
1098 RestoreSnapshot(RestoreSnapshotAction),
1099 /// 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.
1100 CancelOperation(CancelOperationAction),
1101 /// 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.
1102 DeleteProject(DeleteProjectAction),
1103 /// 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).
1104 SetSource(ProjectSource),
1105 /// 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.
1106 DeleteVolume(::std::string::String),
1107}
1108
1109#[derive(Debug, Clone, PartialEq, Default)]
1110pub struct ServicesAction {
1111 /// Empty = all (start: those with a container; restart: running ones).
1112 pub services: ::std::vec::Vec<::std::string::String>,
1113}
1114
1115#[derive(Debug, Clone, PartialEq, Default)]
1116pub struct RecreateServiceAction {
1117 pub service: ::std::string::String,
1118 /// True = pull the tag's newest image, or rebuild on the newest base images.
1119 pub pull_latest_image: bool,
1120}
1121
1122#[derive(Debug, Clone, PartialEq, Default)]
1123pub struct BackUpAction {}
1124
1125#[derive(Debug, Clone, PartialEq, Default)]
1126pub struct RestoreSnapshotAction {
1127 pub snapshot_id: ::std::string::String,
1128 /// 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.
1129 pub volumes: ::std::vec::Vec<::std::string::String>,
1130}
1131
1132#[derive(Debug, Clone, PartialEq, Default)]
1133pub struct CancelOperationAction {
1134 /// Required.
1135 pub operation_id: ::std::string::String,
1136}
1137
1138#[derive(Debug, Clone, PartialEq, Default)]
1139pub struct DeleteProjectAction {
1140 /// True = no final backup, while backups are on: changes since the newest snapshot are lost.
1141 pub skip_final_backup: bool,
1142}
1143
1144/// What [`Client::run_project_action`](crate::Client::run_project_action) returns.
1145#[derive(Debug, Clone, PartialEq, Default)]
1146#[non_exhaustive]
1147pub struct RunProjectActionResponse {
1148 /// 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`).
1149 pub operation: ::core::option::Option<Operation>,
1150 /// 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.
1151 pub project: ::core::option::Option<Project>,
1152 /// The operation's last log lines, unless it SUCCEEDED.
1153 pub log: ::std::vec::Vec<OperationLogLine>,
1154}
1155
1156/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) takes.
1157#[derive(Debug, Clone, PartialEq, Default)]
1158pub struct SetProjectAlertsRequest {
1159 pub project_id: ::std::string::String,
1160 /// ≤10. Given = the whole list.
1161 pub checks: ::std::vec::Vec<SiteCheck>,
1162 /// True = none, not even the default check.
1163 pub remove_checks: bool,
1164 /// ≤10. Given = the whole list.
1165 pub traffic_rules: ::std::vec::Vec<TrafficRule>,
1166 /// True = none.
1167 pub remove_traffic_rules: bool,
1168 /// True = incidents are recorded, nothing is sent. Absent = stays.
1169 pub off: ::core::option::Option<bool>,
1170 /// ≤10080; 0 = unmute. Incidents opened meanwhile are not sent. Absent = stays.
1171 pub mute_minutes: ::core::option::Option<u32>,
1172}
1173
1174/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) returns.
1175#[derive(Debug, Clone, PartialEq, Default)]
1176#[non_exhaustive]
1177pub struct SetProjectAlertsResponse {
1178 /// As changed.
1179 pub alerts: ::core::option::Option<ProjectAlerts>,
1180}
1181
1182/// 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.
1183#[derive(Debug, Clone, PartialEq, Default)]
1184pub struct SiteCheck {
1185 /// A [`Host::host`](crate::types::Host::host) of the project.
1186 pub host: ::std::string::String,
1187 /// \"/…\", ≤200 chars, a query allowed. Empty = \"/\".
1188 pub path: ::std::string::String,
1189 /// 100-599. 0 = any status below 500 is up: 401, 404 and redirects too.
1190 pub expect_status: u32,
1191 /// ≤100 chars, in the body's first 64 KiB. Empty = not looked for.
1192 pub must_contain: ::std::string::String,
1193}
1194
1195/// Fires when `metric`, over the last `window_minutes` of the requests `filter` selects, reaches `threshold` 2 minutes in a row; clears after 3 below.
1196#[derive(Debug, Clone, PartialEq, Default)]
1197pub struct TrafficRule {
1198 pub metric: TrafficMetric,
1199 /// `status_class` not taken.
1200 pub filter: ::core::option::Option<HttpTrafficFilter>,
1201 /// A count, a percent (0-100) or ms.
1202 pub threshold: f64,
1203 /// 1-60. 0 = 5.
1204 pub window_minutes: u32,
1205 /// Percent and p95: fewer requests in the window leave the rule as it was. ≤10000. 0 = 20.
1206 pub min_requests: u32,
1207}
1208
1209#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1210#[non_exhaustive]
1211pub enum TrafficMetric {
1212 /// The zero value: absent, and not sent.
1213 #[default]
1214 Unspecified,
1215 /// 5xx responses in the window.
1216 ServerErrors,
1217 /// 5xx, of the window's requests (WebSockets too).
1218 ServerErrorPercent,
1219 LatencyP95Ms,
1220 /// A value this version of the crate does not know, as the number the API sent.
1221 Unrecognized(i32),
1222}
1223
1224/// 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.
1225#[derive(Debug, Clone, PartialEq, Default)]
1226#[non_exhaustive]
1227pub struct ProjectAlerts {
1228 /// Until set: the project's URL at \"/\" (`machine_default`); none without a route.
1229 pub checks: ::std::vec::Vec<SiteCheckState>,
1230 /// Until set: 10 or more 5xx in 5 minutes, of every request (`machine_default`).
1231 pub traffic_rules: ::std::vec::Vec<TrafficRuleState>,
1232 /// True = incidents are recorded, nothing is sent.
1233 pub off: bool,
1234 /// Absent = not muted.
1235 pub mute_end_time: ::core::option::Option<crate::Timestamp>,
1236 /// Of the time the checks ran in the last 30 days, the share they were up, e.g. 99.97. Absent = no check ran.
1237 pub uptime_percent: ::core::option::Option<f64>,
1238}
1239
1240#[derive(Debug, Clone, PartialEq, Default)]
1241#[non_exhaustive]
1242pub struct SiteCheckState {
1243 pub check: ::core::option::Option<SiteCheck>,
1244 /// The default check, as no list was set.
1245 pub machine_default: bool,
1246 pub status: AlertStatus,
1247 /// Absent = not run yet.
1248 pub last_result: ::core::option::Option<SiteCheckResult>,
1249 /// The open incident. Empty = none.
1250 pub incident_id: ::std::string::String,
1251}
1252
1253#[derive(Debug, Clone, PartialEq, Default)]
1254#[non_exhaustive]
1255pub struct SiteCheckResult {
1256 pub check_time: ::core::option::Option<crate::Timestamp>,
1257 /// 0 = no HTTP answer: `failure_message` says why.
1258 pub status: u32,
1259 pub duration_ms: u32,
1260 /// E.g. \"connection refused\", \"status 502\", \"the text is missing\". Empty = up.
1261 pub failure_message: ::std::string::String,
1262}
1263
1264#[derive(Debug, Clone, PartialEq, Default)]
1265#[non_exhaustive]
1266pub struct TrafficRuleState {
1267 pub rule: ::core::option::Option<TrafficRule>,
1268 /// The default rule, as no list was set.
1269 pub machine_default: bool,
1270 pub status: AlertStatus,
1271 /// The metric at the last evaluation.
1272 pub value: f64,
1273 /// In the window then.
1274 pub request_count: u64,
1275 /// The open incident. Empty = none.
1276 pub incident_id: ::std::string::String,
1277}
1278
1279#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1280#[non_exhaustive]
1281pub enum AlertStatus {
1282 /// The zero value: absent, and not sent.
1283 #[default]
1284 Unspecified,
1285 Ok,
1286 /// It holds or cleared, not confirmed yet.
1287 Pending,
1288 /// An incident is open.
1289 Firing,
1290 /// Not checked now: a deploy or restore runs or just ended, the project is stopped, or no route has the check's host.
1291 Paused,
1292 /// Not evaluated yet, or too few requests.
1293 NoData,
1294 /// A value this version of the crate does not know, as the number the API sent.
1295 Unrecognized(i32),
1296}
1297
1298/// A period during which something of a project needed attention, from its confirmation to its end.
1299#[derive(Debug, Clone, PartialEq, Default)]
1300#[non_exhaustive]
1301pub struct Incident {
1302 pub incident_id: ::std::string::String,
1303 /// `DEPLOY_CANCELLED` opens none.
1304 pub kind: ProjectProblemKind,
1305 /// As in its [`ProjectProblem`](crate::types::ProjectProblem).
1306 pub service: ::std::string::String,
1307 /// `SITE_DOWN`.
1308 pub check: ::core::option::Option<SiteCheck>,
1309 /// `HTTP_ERRORS`, `HTTP_SLOW`.
1310 pub traffic_rule: ::core::option::Option<TrafficRule>,
1311 /// `DEPLOY_FAILED`, `BACKUP_FAILED`, `RESTORE_FAILED`.
1312 pub operation_id: ::std::string::String,
1313 pub open_time: ::core::option::Option<crate::Timestamp>,
1314 /// When it and every incident joined to it cleared. Absent = open.
1315 pub resolve_time: ::core::option::Option<crate::Timestamp>,
1316 /// `HTTP_ERRORS`, `HTTP_SLOW`: the metric at open.
1317 pub value: f64,
1318 /// `HTTP_ERRORS`, `HTTP_SLOW`: the window's requests at open.
1319 pub request_count: u64,
1320 /// 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.
1321 pub after_operation_id: ::std::string::String,
1322 /// Absent = it was running.
1323 pub after_operation_end_time: ::core::option::Option<crate::Timestamp>,
1324 /// The incident this one is part of: it is told with that one, not on its own. Empty = none.
1325 pub joined_incident_id: ::std::string::String,
1326 /// Set = nobody is told of it.
1327 pub quiet_reason: IncidentQuietReason,
1328 /// True = it went down and up 3 times within an hour; it stands for them all and clears after 15 clean minutes.
1329 pub flapping: bool,
1330 /// One sentence for people, without a time of day.
1331 pub incident_message: ::std::string::String,
1332 /// `GetIncident` only.
1333 pub evidence: ::core::option::Option<IncidentEvidence>,
1334}
1335
1336#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1337#[non_exhaustive]
1338pub enum IncidentQuietReason {
1339 /// Told.
1340 #[default]
1341 Unspecified,
1342 Muted,
1343 Off,
1344 /// Already so when the machine first watched it, as after the update that brought alerts.
1345 FirstEvaluation,
1346 /// A deploy someone ran failed: they watch it.
1347 ManualDeploy,
1348 /// A value this version of the crate does not know, as the number the API sent.
1349 Unrecognized(i32),
1350}
1351
1352/// What the machine saw when an incident opened, kept with it. Untrusted.
1353#[derive(Debug, Clone, PartialEq, Default)]
1354#[non_exhaustive]
1355pub struct IncidentEvidence {
1356 /// `SITE_DOWN`: the third failure.
1357 pub check_result: ::core::option::Option<SiteCheckResult>,
1358 /// The service's container: `SERVICE_`\* kinds, and `SITE_DOWN`\'s service.
1359 pub exit_code: i32,
1360 pub oom_killed: bool,
1361 /// In the 10 minutes before.
1362 pub restart_count: u32,
1363 /// The last healthcheck's, ≤1 KiB.
1364 pub health_output: ::std::string::String,
1365 /// The service's last ≤20 before it opened, oldest first.
1366 pub log_lines: ::std::vec::Vec<LogLine>,
1367 /// `HTTP_ERRORS`: the path with the most 5xx in the window; `HTTP_SLOW`: the slowest.
1368 pub top_path: ::core::option::Option<HttpPathTraffic>,
1369}
1370
1371/// One UTC day of a project's site checks.
1372#[derive(Debug, Clone, PartialEq, Default)]
1373#[non_exhaustive]
1374pub struct UptimeDay {
1375 /// Midnight UTC.
1376 pub start_time: ::core::option::Option<crate::Timestamp>,
1377 /// Absent = no check ran.
1378 pub uptime_percent: ::core::option::Option<f64>,
1379 pub down_seconds: u32,
1380}
1381
1382/// What [`Client::get_operation`](crate::Client::get_operation) takes.
1383#[derive(Debug, Clone, PartialEq, Default)]
1384pub struct GetOperationRequest {
1385 pub project_id: ::std::string::String,
1386 /// Empty = the latest.
1387 pub operation_id: ::std::string::String,
1388 /// How long to wait for it to end, ≤45. Absent = 45; 0 = answer at once.
1389 pub wait_seconds: ::core::option::Option<u32>,
1390 /// The previous `next_after_log_line`; 0 = from the start. Absent = the last lines.
1391 pub after_log_line: ::core::option::Option<u32>,
1392 /// ≤500; 0 = 50, when asked for lines. Also ends at \~64 KiB.
1393 pub log_line_limit: ::core::option::Option<u32>,
1394}
1395
1396/// What [`Client::get_operation`](crate::Client::get_operation) returns.
1397#[derive(Debug, Clone, PartialEq, Default)]
1398#[non_exhaustive]
1399pub struct GetOperationResponse {
1400 pub operation: ::core::option::Option<Operation>,
1401 /// 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.
1402 pub project: ::core::option::Option<Project>,
1403 /// 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.
1404 pub log: ::std::vec::Vec<OperationLogLine>,
1405 /// Lines in the whole log so far.
1406 pub log_line_count: u32,
1407 /// Pass it as `after_log_line` to get the lines after these; absent = 0. The machine keeps every line of the log.
1408 pub next_after_log_line: u32,
1409}
1410
1411#[derive(Debug, Clone, PartialEq, Default)]
1412#[non_exhaustive]
1413pub struct OperationLogLine {
1414 pub time: ::core::option::Option<crate::Timestamp>,
1415 /// 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.
1416 pub text: ::std::string::String,
1417}
1418
1419#[derive(Debug, Clone, PartialEq, Default)]
1420pub struct HttpTrafficFilter {
1421 /// As [`Host::host`](crate::types::Host::host); a removed host still matches.
1422 pub host: ::std::string::String,
1423 /// E.g. \"GET\".
1424 pub method: ::std::string::String,
1425 /// Without the query; any case.
1426 pub path_contains: ::std::string::String,
1427 /// As [`HttpPathTraffic::path_pattern`](crate::types::HttpPathTraffic::path_pattern), e.g. \"/recipes/\*\".
1428 pub path_pattern: ::std::string::String,
1429 /// 1-5: 5 = 5xx.
1430 pub status_class: u32,
1431}
1432
1433/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) takes.
1434#[derive(Debug, Clone, PartialEq, Default)]
1435pub struct QueryHttpTrafficRequest {
1436 pub project_id: ::std::string::String,
1437 pub filter: ::core::option::Option<HttpTrafficFilter>,
1438 /// Absent = a day before `end_time`.
1439 pub start_time: ::core::option::Option<crate::Timestamp>,
1440 /// Absent = now.
1441 pub end_time: ::core::option::Option<crate::Timestamp>,
1442 /// The range ending at `end_time`, e.g. 3600 = the last hour. Not with `start_time`.
1443 pub last_seconds: u32,
1444 /// Time series bucket width; ≤500 buckets. 0 = no series.
1445 pub bucket_width_seconds: u32,
1446 /// Requests to return, newest first; ≤200. 0 = aggregates only.
1447 pub request_limit: u32,
1448 /// The previous `next_page_token`, other fields unchanged: older requests only.
1449 pub page_token: ::std::string::String,
1450}
1451
1452/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) returns.
1453#[derive(Debug, Clone, PartialEq, Default)]
1454#[non_exhaustive]
1455pub struct QueryHttpTrafficResponse {
1456 /// The range queried, as the machine resolved it: defaults applied, on its clock.
1457 pub start_time: ::core::option::Option<crate::Timestamp>,
1458 pub end_time: ::core::option::Option<crate::Timestamp>,
1459 /// Of the oldest request the machine keeps for the project. Absent = none is kept.
1460 pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
1461 pub summary: ::core::option::Option<HttpTrafficSummary>,
1462 /// Oldest first, each `bucket_width_seconds` wide; one with no request is left out.
1463 pub buckets: ::std::vec::Vec<HttpTrafficBucket>,
1464 /// The 10 busiest, busiest first.
1465 pub top_paths: ::std::vec::Vec<HttpPathTraffic>,
1466 /// 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.
1467 pub newest_sequence: u64,
1468 pub requests: ::std::vec::Vec<HttpRequest>,
1469 /// Empty = no more requests.
1470 pub next_page_token: ::std::string::String,
1471 /// 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.
1472 pub tail_sequence: u64,
1473}
1474
1475#[derive(Debug, Clone, PartialEq, Default)]
1476#[non_exhaustive]
1477pub struct HttpTrafficBucket {
1478 pub start_time: ::core::option::Option<crate::Timestamp>,
1479 pub summary: ::core::option::Option<HttpTrafficSummary>,
1480}
1481
1482#[derive(Debug, Clone, PartialEq, Default)]
1483#[non_exhaustive]
1484pub struct HttpPathTraffic {
1485 pub method: ::std::string::String,
1486 /// The path with id-like segments as `*`, e.g. \"/recipes/\*\": requests to one endpoint.
1487 pub path_pattern: ::std::string::String,
1488 pub summary: ::core::option::Option<HttpTrafficSummary>,
1489}
1490
1491#[derive(Debug, Clone, PartialEq, Default)]
1492#[non_exhaustive]
1493pub struct HttpRequest {
1494 /// Unique and increasing on the machine: [`Client::tail_http_traffic`](crate::Client::tail_http_traffic)\'s cursor.
1495 pub sequence: u64,
1496 /// When the response finished. A WebSocket is logged when it closes, with status 0.
1497 pub finish_time: ::core::option::Option<crate::Timestamp>,
1498 pub host: ::std::string::String,
1499 pub method: ::std::string::String,
1500 /// With the query. Untrusted.
1501 pub path: ::std::string::String,
1502 pub path_pattern: ::std::string::String,
1503 /// The route that matched.
1504 pub route_path: ::std::string::String,
1505 /// That answered. Empty = of a route the project no longer has.
1506 pub service: ::std::string::String,
1507 pub port: u32,
1508 /// 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.
1509 pub status_code: u32,
1510 pub response_size_bytes: u64,
1511 /// In total.
1512 pub duration_ms: u32,
1513 /// Of which inside the service.
1514 pub service_duration_ms: u32,
1515 pub client_ip_address: ::std::string::String,
1516 /// Untrusted.
1517 pub user_agent: ::std::string::String,
1518}
1519
1520#[derive(Debug, Clone, PartialEq, Default)]
1521pub struct ContainerLogFilter {
1522 /// Empty = all, removed services too.
1523 pub service: ::std::string::String,
1524 /// Absent = both.
1525 pub stream: OutputStream,
1526 /// Literal, any ASCII case, ignoring escape sequences. Length limited ([`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument)).
1527 pub text_contains: ::std::string::String,
1528}
1529
1530#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1531#[non_exhaustive]
1532pub enum OutputStream {
1533 /// The zero value: absent, and not sent.
1534 #[default]
1535 Unspecified,
1536 Stdout,
1537 Stderr,
1538 /// A value this version of the crate does not know, as the number the API sent.
1539 Unrecognized(i32),
1540}
1541
1542/// What [`Client::query_container_logs`](crate::Client::query_container_logs) takes.
1543#[derive(Debug, Clone, PartialEq, Default)]
1544pub struct QueryContainerLogsRequest {
1545 pub project_id: ::std::string::String,
1546 pub filter: ::core::option::Option<ContainerLogFilter>,
1547 /// Absent = the oldest kept.
1548 pub start_time: ::core::option::Option<crate::Timestamp>,
1549 /// Absent = now.
1550 pub end_time: ::core::option::Option<crate::Timestamp>,
1551 /// As in [`Client::query_http_traffic`](crate::Client::query_http_traffic).
1552 pub last_seconds: u32,
1553 /// ≤500; 0 = 100. Also ends at \~64 KiB.
1554 pub limit: u32,
1555 /// False = the newest before `end_time`; true = the oldest after `start_time`.
1556 pub from_start: bool,
1557 /// The previous `next_page_token`, other fields unchanged.
1558 pub page_token: ::std::string::String,
1559}
1560
1561/// What [`Client::query_container_logs`](crate::Client::query_container_logs) returns.
1562#[derive(Debug, Clone, PartialEq, Default)]
1563#[non_exhaustive]
1564pub struct QueryContainerLogsResponse {
1565 /// The range queried, as the machine resolved it: defaults applied, on its clock.
1566 pub start_time: ::core::option::Option<crate::Timestamp>,
1567 pub end_time: ::core::option::Option<crate::Timestamp>,
1568 /// Of the oldest line of container output the machine keeps: nothing older can be queried. Absent = none is kept.
1569 pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
1570 pub lines: ::std::vec::Vec<LogLine>,
1571 /// Empty = no more.
1572 pub next_page_token: ::std::string::String,
1573 /// 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.
1574 pub tail_cursor: ::std::string::String,
1575}
1576
1577#[derive(Debug, Clone, PartialEq, Default)]
1578#[non_exhaustive]
1579pub struct LogLine {
1580 pub time: ::core::option::Option<crate::Timestamp>,
1581 pub service: ::std::string::String,
1582 pub stream: OutputStream,
1583 /// 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.
1584 pub text: ::std::string::String,
1585}
1586
1587/// What [`Client::run_service_command`](crate::Client::run_service_command) takes.
1588#[derive(Debug, Clone, PartialEq, Default)]
1589pub struct RunServiceCommandRequest {
1590 pub project_id: ::std::string::String,
1591 pub service: ::std::string::String,
1592 /// E.g. \[\"psql\", \"-c\", \"select 1\"\]; a shell line: \[\"sh\", \"-c\", \"ls | head\"\].
1593 pub command: ::std::vec::Vec<::std::string::String>,
1594 /// Written to stdin, then closed.
1595 pub stdin: ::std::string::String,
1596 /// Empty = the container's. \"root\" can install packages.
1597 pub run_as_user: ::std::string::String,
1598 /// Empty = the container's.
1599 pub working_directory: ::std::string::String,
1600 /// 0 = default. Kills the main process only. Over \~50 may outlast your client: background long jobs.
1601 pub timeout_seconds: u32,
1602}
1603
1604/// What [`Client::run_service_command`](crate::Client::run_service_command) returns.
1605#[derive(Debug, Clone, PartialEq, Default)]
1606#[non_exhaustive]
1607pub struct RunServiceCommandResponse {
1608 pub exit_code: i32,
1609 /// True = the machine killed it at the timeout; `exit_code` is then -1.
1610 pub timed_out: bool,
1611 /// 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.
1612 pub stdout: ::std::string::String,
1613 pub stderr: ::std::string::String,
1614 /// True = the start of stdout or stderr was cut.
1615 pub output_truncated: bool,
1616}
1617
1618#[derive(Debug, Clone, PartialEq, Default)]
1619#[non_exhaustive]
1620pub struct FileEntry {
1621 /// Without its directory.
1622 pub name: ::std::string::String,
1623 pub r#type: FileType,
1624 /// Of a regular file; 0 otherwise.
1625 pub size_bytes: u64,
1626 pub modify_time: ::core::option::Option<crate::Timestamp>,
1627 /// Permission bits in octal, e.g. \"0644\".
1628 pub mode: ::std::string::String,
1629 /// As inside the container.
1630 pub owner_uid: u32,
1631 pub owner_gid: u32,
1632 /// When SYMLINK.
1633 pub symlink_target: ::std::string::String,
1634}
1635
1636#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1637#[non_exhaustive]
1638pub enum FileType {
1639 /// The zero value: absent, and not sent.
1640 #[default]
1641 Unspecified,
1642 File,
1643 Directory,
1644 Symlink,
1645 /// A device, socket or FIFO.
1646 Other,
1647 /// A value this version of the crate does not know, as the number the API sent.
1648 Unrecognized(i32),
1649}
1650
1651/// Where a path of a service's container lies, which says whether it lasts.
1652#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1653#[non_exhaustive]
1654pub enum FileLocation {
1655 /// The zero value: absent, and not sent.
1656 #[default]
1657 Unspecified,
1658 /// 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.
1659 Container,
1660 /// A named volume ([`ReadPathResponse::volume`](crate::types::ReadPathResponse::volume)): kept across deploys and backed up.
1661 Volume,
1662 /// The project's files, mounted read-only from its source as deployed: change them with [`Client::deploy_project`](crate::Client::deploy_project).
1663 ProjectFiles,
1664 /// A value this version of the crate does not know, as the number the API sent.
1665 Unrecognized(i32),
1666}
1667
1668/// What [`Client::read_path`](crate::Client::read_path) takes.
1669#[derive(Debug, Clone, PartialEq, Default)]
1670pub struct ReadPathRequest {
1671 pub project_id: ::std::string::String,
1672 /// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
1673 pub root: ::core::option::Option<ReadPathRequestRoot>,
1674 /// From the root, e.g. \"/compose.yaml\", \"/data/uploads\". Empty = \"/\": the root's entries.
1675 pub path: ::std::string::String,
1676 /// 0 = 200. Also ends at \~64 KiB.
1677 pub entry_limit: u32,
1678 /// File offset.
1679 pub offset_bytes: u64,
1680 /// ≤1 MiB; 0 = 64 KiB.
1681 pub length_bytes: u32,
1682 /// The previous `next_entry_page_token`, other fields unchanged.
1683 pub entry_page_token: ::std::string::String,
1684}
1685
1686/// The oneof [`ReadPathRequest::root`](crate::types::ReadPathRequest::root): one of its members.
1687///
1688/// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
1689#[derive(Debug, Clone, PartialEq)]
1690#[non_exhaustive]
1691#[allow(clippy::large_enum_variant)]
1692pub enum ReadPathRequestRoot {
1693 /// In its container.
1694 Service(::std::string::String),
1695 /// In the volume, from its root.
1696 Volume(::std::string::String),
1697}
1698
1699/// What [`Client::read_path`](crate::Client::read_path) returns.
1700#[derive(Debug, Clone, PartialEq, Default)]
1701#[non_exhaustive]
1702pub struct ReadPathResponse {
1703 /// The path itself, symlinks followed; a symlink whose target does not exist is its own entry.
1704 pub entry: ::core::option::Option<FileEntry>,
1705 /// With `service`: where the path lies. Unspecified otherwise: the request says it.
1706 pub location: FileLocation,
1707 /// With `service`: the volume the path lies on, when location is VOLUME. Else empty.
1708 pub volume: ::std::string::String,
1709 /// A directory's: directories first, then by name (bytewise).
1710 pub entries: ::std::vec::Vec<FileEntry>,
1711 /// A directory's in all.
1712 pub entry_count: u32,
1713 /// Set = more entries follow these: pass it as `entry_page_token`.
1714 pub next_entry_page_token: ::std::string::String,
1715 /// A text file's contents from `offset_bytes`, ending on a whole character. Untrusted.
1716 pub text: ::std::string::String,
1717 /// 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).
1718 pub binary: bool,
1719 /// Where the next read of the file starts. 0 = the read reached its end.
1720 pub next_offset_bytes: u64,
1721 /// 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.
1722 pub deploy_id: ::std::string::String,
1723}
1724
1725/// What [`Client::create_transfer`](crate::Client::create_transfer) takes.
1726#[derive(Debug, Clone, PartialEq, Default)]
1727pub struct CreateTransferRequest {
1728 pub transfer: ::core::option::Option<CreateTransferRequestTransfer>,
1729}
1730
1731/// The oneof [`CreateTransferRequest::transfer`](crate::types::CreateTransferRequest::transfer): one of its members.
1732#[derive(Debug, Clone, PartialEq)]
1733#[non_exhaustive]
1734#[allow(clippy::large_enum_variant)]
1735pub enum CreateTransferRequestTransfer {
1736 UploadArchive(ArchiveUpload),
1737 UploadFile(FileUpload),
1738 Download(PathDownload),
1739}
1740
1741/// 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).
1742#[derive(Debug, Clone, PartialEq, Default)]
1743pub struct ArchiveUpload {
1744 /// The archive's name for people, e.g. \"recipes.zip\". Empty = \"archive.tgz\".
1745 pub file_name: ::std::string::String,
1746}
1747
1748#[derive(Debug, Clone, PartialEq, Default)]
1749pub struct FileUpload {
1750 pub project_id: ::std::string::String,
1751 pub root: ::core::option::Option<FileUploadRoot>,
1752 /// From the root, e.g. \"/data/uploads/a.jpg\".
1753 pub path: ::std::string::String,
1754}
1755
1756/// The oneof [`FileUpload::root`](crate::types::FileUpload::root): one of its members.
1757#[derive(Debug, Clone, PartialEq)]
1758#[non_exhaustive]
1759#[allow(clippy::large_enum_variant)]
1760pub enum FileUploadRoot {
1761 /// In its container.
1762 Service(::std::string::String),
1763 /// In the volume, from its root.
1764 Volume(::std::string::String),
1765}
1766
1767/// A directory comes as a .tar of what [`Client::read_path`](crate::Client::read_path) shows; symlinks kept.
1768#[derive(Debug, Clone, PartialEq, Default)]
1769pub struct PathDownload {
1770 pub project_id: ::std::string::String,
1771 /// Where the path is. Neither = the project's deployed files.
1772 pub root: ::core::option::Option<PathDownloadRoot>,
1773 /// From the root. Empty = \"/\": the whole root.
1774 pub path: ::std::string::String,
1775}
1776
1777/// The oneof [`PathDownload::root`](crate::types::PathDownload::root): one of its members.
1778///
1779/// Where the path is. Neither = the project's deployed files.
1780#[derive(Debug, Clone, PartialEq)]
1781#[non_exhaustive]
1782#[allow(clippy::large_enum_variant)]
1783pub enum PathDownloadRoot {
1784 /// In its container.
1785 Service(::std::string::String),
1786 /// In the volume, from its root.
1787 Volume(::std::string::String),
1788}
1789
1790/// What [`Client::create_transfer`](crate::Client::create_transfer) returns.
1791#[derive(Debug, Clone, PartialEq, Default)]
1792#[non_exhaustive]
1793pub struct CreateTransferResponse {
1794 /// On the machine's hostname ([`Machine::hostname`](crate::types::Machine::hostname)); it works once.
1795 pub url: ::std::string::String,
1796 /// \"PUT\" or \"GET\".
1797 pub http_method: ::std::string::String,
1798 /// Start the request before this.
1799 pub expire_time: ::core::option::Option<crate::Timestamp>,
1800 /// 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\>\'\".
1801 pub command: ::std::string::String,
1802 /// `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.
1803 pub upload_id: ::std::string::String,
1804 /// `upload_file`: a file is at path now; the upload replaces it.
1805 pub replaces: bool,
1806 /// 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. Empty for an upload.
1807 pub file_name: ::std::string::String,
1808 /// `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.
1809 pub exclude_names: ::std::vec::Vec<::std::string::String>,
1810}
1811
1812/// 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.
1813#[derive(Debug, Clone, PartialEq, Default)]
1814#[non_exhaustive]
1815pub struct ProjectBusy {
1816 /// 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.
1817 pub operation_id: ::std::string::String,
1818 /// Unspecified when `operation_id` is empty.
1819 pub kind: OperationKind,
1820 /// Since when it holds the project.
1821 pub start_time: ::core::option::Option<crate::Timestamp>,
1822}
1823
1824/// 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.
1825#[derive(Debug, Clone, PartialEq, Default)]
1826#[non_exhaustive]
1827pub struct ProjectChanged {}
1828
1829/// Detail of an [`ErrorCode::Unavailable`](crate::ErrorCode::Unavailable) error: the machine does not answer now, as while it restarts. Call again later.
1830#[derive(Debug, Clone, PartialEq, Default)]
1831#[non_exhaustive]
1832pub struct MachineUnreachable {
1833 /// 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.
1834 pub since_time: ::core::option::Option<crate::Timestamp>,
1835}
1836
1837/// 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.
1838#[derive(Debug, Clone, PartialEq, Default)]
1839#[non_exhaustive]
1840pub struct MachineUpdatePending {}
1841
1842/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error: the account has no machine to run projects on yet.
1843#[derive(Debug, Clone, PartialEq, Default)]
1844#[non_exhaustive]
1845pub struct NoMachine {
1846 pub reason: NoMachineReason,
1847 /// Where the person goes on in the browser.
1848 pub url: ::std::string::String,
1849}
1850
1851#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
1852#[non_exhaustive]
1853pub enum NoMachineReason {
1854 /// The zero value: absent, and not sent.
1855 #[default]
1856 Unspecified,
1857 /// The person has not chosen and paid for a plan: they do it at url.
1858 NoPlan,
1859 /// The plan is paid and a machine is being prepared for the account: Pethost emails the person when it is ready. Call again later.
1860 BeingPrepared,
1861 /// A value this version of the crate does not know, as the number the API sent.
1862 Unrecognized(i32),
1863}
1864
1865/// What [`Client::watch_operation`](crate::Client::watch_operation) takes.
1866#[derive(Debug, Clone, PartialEq, Default)]
1867pub struct WatchOperationRequest {
1868 pub project_id: ::std::string::String,
1869 /// Empty = the latest.
1870 pub operation_id: ::std::string::String,
1871}
1872
1873/// What [`Client::watch_operation`](crate::Client::watch_operation) yields.
1874#[derive(Debug, Clone, PartialEq, Default)]
1875#[non_exhaustive]
1876pub struct WatchOperationResponse {
1877 pub message: ::core::option::Option<WatchOperationResponseMessage>,
1878}
1879
1880/// The oneof [`WatchOperationResponse::message`](crate::types::WatchOperationResponse::message): one of its members.
1881#[derive(Debug, Clone, PartialEq)]
1882#[non_exhaustive]
1883#[allow(clippy::large_enum_variant)]
1884pub enum WatchOperationResponseMessage {
1885 Log(OperationLogLine),
1886 /// Always the last message.
1887 FinishedOperation(Operation),
1888 /// A member this version of the crate does not know: the API set none it knows, and sent
1889 /// fields it does not know. Sent, it counts as no member.
1890 Unrecognized,
1891}
1892
1893/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) takes.
1894#[derive(Debug, Clone, PartialEq, Default)]
1895pub struct TailContainerLogsRequest {
1896 pub project_id: ::std::string::String,
1897 pub filter: ::core::option::Option<ContainerLogFilter>,
1898 /// Empty = only lines written from now on.
1899 pub after_cursor: ::std::string::String,
1900}
1901
1902/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) yields.
1903#[derive(Debug, Clone, PartialEq, Default)]
1904#[non_exhaustive]
1905pub struct TailContainerLogsResponse {
1906 pub line: ::core::option::Option<LogLine>,
1907 /// To reconnect after this line.
1908 pub cursor: ::std::string::String,
1909}
1910
1911/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) takes.
1912#[derive(Debug, Clone, PartialEq, Default)]
1913pub struct TailHttpTrafficRequest {
1914 pub project_id: ::std::string::String,
1915 pub filter: ::core::option::Option<HttpTrafficFilter>,
1916 /// 0 = only requests from now on.
1917 pub after_sequence: u64,
1918}
1919
1920/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) yields.
1921#[derive(Debug, Clone, PartialEq, Default)]
1922#[non_exhaustive]
1923pub struct TailHttpTrafficResponse {
1924 pub request: ::core::option::Option<HttpRequest>,
1925}