src/api2/config: improve api schema by adding return type
This commit is contained in:
parent
ddc526623f
commit
f3ec5dae7f
|
@ -14,7 +14,7 @@ use crate::config::datastore;
|
||||||
properties: {},
|
properties: {},
|
||||||
},
|
},
|
||||||
returns: {
|
returns: {
|
||||||
description: "List the configured datastores.",
|
description: "List the configured datastores (with config digest).",
|
||||||
type: Array,
|
type: Array,
|
||||||
items: {
|
items: {
|
||||||
type: datastore::DataStoreConfig,
|
type: datastore::DataStoreConfig,
|
||||||
|
@ -83,6 +83,10 @@ pub fn create_datastore(name: String, param: Value) -> Result<(), Error> {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
returns: {
|
||||||
|
description: "The datastore configuration (with config digest).",
|
||||||
|
type: datastore::DataStoreConfig,
|
||||||
|
},
|
||||||
)]
|
)]
|
||||||
/// Read a datastore configuration.
|
/// Read a datastore configuration.
|
||||||
pub fn read_datastore(name: String) -> Result<Value, Error> {
|
pub fn read_datastore(name: String) -> Result<Value, Error> {
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::config::remotes;
|
||||||
properties: {},
|
properties: {},
|
||||||
},
|
},
|
||||||
returns: {
|
returns: {
|
||||||
description: "The list of configured remotes.",
|
description: "The list of configured remotes (with config digest).",
|
||||||
type: Array,
|
type: Array,
|
||||||
items: {
|
items: {
|
||||||
type: remotes::Remote,
|
type: remotes::Remote,
|
||||||
|
@ -81,6 +81,10 @@ pub fn create_remote(name: String, param: Value) -> Result<(), Error> {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
returns: {
|
||||||
|
description: "The remote configuration (with config digest).",
|
||||||
|
type: remotes::Remote,
|
||||||
|
},
|
||||||
)]
|
)]
|
||||||
/// Read remote configuration data.
|
/// Read remote configuration data.
|
||||||
pub fn read_remote(name: String) -> Result<Value, Error> {
|
pub fn read_remote(name: String) -> Result<Value, Error> {
|
||||||
|
|
Loading…
Reference in New Issue