Line data Source code
1 : //! Structs representing the JSON formats used in the compute_ctl's HTTP API.
2 : use serde::{Deserialize, Serialize};
3 :
4 : use crate::privilege::Privilege;
5 : use crate::responses::ComputeCtlConfig;
6 : use crate::spec::{ComputeSpec, ExtVersion, PgIdent};
7 :
8 : /// Request of the /configure API
9 : ///
10 : /// We now pass only `spec` in the configuration request, but later we can
11 : /// extend it and something like `restart: bool` or something else. So put
12 : /// `spec` into a struct initially to be more flexible in the future.
13 0 : #[derive(Debug, Deserialize, Serialize)]
14 : pub struct ConfigurationRequest {
15 : pub spec: ComputeSpec,
16 : pub compute_ctl_config: ComputeCtlConfig,
17 : }
18 :
19 0 : #[derive(Deserialize, Debug)]
20 : pub struct ExtensionInstallRequest {
21 : pub extension: PgIdent,
22 : pub database: PgIdent,
23 : pub version: ExtVersion,
24 : }
25 :
26 0 : #[derive(Deserialize, Debug)]
27 : pub struct SetRoleGrantsRequest {
28 : pub database: PgIdent,
29 : pub schema: PgIdent,
30 : pub privileges: Vec<Privilege>,
31 : pub role: PgIdent,
32 : }
|