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