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 : spec::{ComputeSpec, ExtVersion, PgIdent},
5 : };
6 : use serde::Deserialize;
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(Deserialize, Debug)]
14 : pub struct ConfigurationRequest {
15 : pub spec: ComputeSpec,
16 : }
17 :
18 0 : #[derive(Deserialize, Debug)]
19 : pub struct ExtensionInstallRequest {
20 : pub extension: PgIdent,
21 : pub database: PgIdent,
22 : pub version: ExtVersion,
23 : }
24 :
25 0 : #[derive(Deserialize, Debug)]
26 : pub struct SetRoleGrantsRequest {
27 : pub database: PgIdent,
28 : pub schema: PgIdent,
29 : pub privileges: Vec<Privilege>,
30 : pub role: PgIdent,
31 : }
|