1use hyper::Method;
2use crate::container_inspect::InspectedContainer;
3use crate::container_structs::Container;
4use crate::container_create::CreateContainerResponseFromAPI;
5use crate::container_procceses::ContainerProcessesResponse;
6use crate::container_stats::Stats;
7use serde::Deserialize;
8
9pub type EmptyOk = ();
11
12pub const LIST_CONTAINERS: &str = "/containers/json";
13pub const LIST_CONTAINERS_METHOD: Method = Method::GET;
14pub type ListContainersReturn = Vec<Container>;
15
16pub const CREATE_CONTAINER: &str = "/containers/create";
17pub const CREATE_CONTAINER_METHOD: Method = Method::POST;
18pub type CreateContainerReturn = CreateContainerResponseFromAPI;
19
20pub const INSPECT_CONTAINER_START: &str = "/containers/";
21pub const INSPECT_CONTAINER_END: &str = "/json";
22pub const INSPECT_CONTAINER_METHOD: Method = Method::GET;
23pub type InspectContainerReturn = InspectedContainer;
24
25pub const LIST_PROCESSES_START: &str = "/containers/";
26pub const LIST_PROCESSES_END: &str = "/top";
27pub const LIST_PROCESSES_METHOD: Method = Method::GET;
28pub type ListProcessesReturn = ContainerProcessesResponse;
29
30pub const GET_CONTAINER_LOGS_START: &str = "/containers/";
31pub const GET_CONTAINER_LOGS_END: &str = "/logs";
32pub const GET_CONTAINER_LOGS_METHOD: Method = Method::GET;
33pub type GetContainerLogsReturn = String;
34
35pub const GET_STATS_CONTAINER_START: &str = "/containers/";
39pub const GET_STATS_CONTAINER_END: &str = "/stats";
40pub const GET_STATS_CONTAINER_METHOD: Method = Method::GET;
41pub type GetContainerStatsReturn = Stats;
42pub const RESIZE_CONTAINER: &str = "/containers/{id}/resize";
44
45pub const START_CONTAINER_START: &str = "/containers/";
46pub const START_CONTAINER_END: &str = "/start";
47pub const START_CONTAINER_METHOD: Method = Method::POST;
48
49pub const STOP_CONTAINER_START: &str = "/containers/";
50pub const STOP_CONTAINER_END: &str = "/stop";
51pub const STOP_CONTAINER_METHOD: Method = Method::POST;
52
53pub const RESTART_CONTAINER_START: &str = "/containers/";
54pub const RESTART_CONTAINER_END: &str = "/restart";
55pub const RESTART_CONTAINER_METHOD: Method = Method::POST;
56
57pub const KILL_CONTAINER_START: &str = "/containers/";
58pub const KILL_CONTAINER_END: &str = "/kill";
59pub const KILL_CONTAINER_METHOD: Method = Method::POST;
60
61pub const UPDATE_CONTAINER_START: &str = "/containers/";
62pub const UPDATE_CONTAINER_END: &str = "/update";
63pub const UPDATE_CONTAINER_METHOD: Method = Method::POST;
64
65pub const RENAME_CONTAINER_START: &str = "/containers/";
66pub const RENAME_CONTAINER_END: &str = "/rename";
67pub const RENAME_CONTAINER_METHOD: Method = Method::POST;
68
69pub const PAUSE_CONTAINER_START: &str = "/containers/";
70pub const PAUSE_CONTAINER_END: &str = "/pause";
71pub const PAUSE_CONTAINER_METHOD: Method = Method::POST;
72
73pub const UNPAUSE_CONTAINER_START: &str = "/containers/";
74pub const UNPAUSE_CONTAINER_END: &str = "/unpause";
75pub const UNPAUSE_CONTAINER_METHOD: Method = Method::POST;
76
77pub const WAIT_CONTAINER_START: &str = "/containers/";
78pub const WAIT_CONTAINER_END: &str = "/wait";
79pub const WAIT_CONTAINER_METHOD: Method = Method::POST;
80
81pub const REMOVE_CONTAINER: &str = "/containers/";
82pub const REMOVE_CONTAINER_METHOD: Method = Method::DELETE;
83
84pub const RESIZE_CONTAINER_TTY_START: &str = "/containers/";
85pub const RESIZE_CONTAINER_TTY_END: &str = "/resize";
86pub const RESIZE_CONTAINER_TTY_METHOD: Method = Method::POST;
87
88pub const DELETE_STOPPED_CONTAINERS: &str = "/containers/prune";
89pub const DELETE_STOPPED_CONTAINERS_METHOD: Method = Method::POST;
90
91#[derive(Deserialize, Debug, Clone, Default)]
92pub struct ErrorMessage {
93 #[serde(rename(deserialize = "message"), default)]
94 pub message: String
95}
96
97