add protected flag for some api methods
This commit is contained in:
parent
a3da38ddfd
commit
a859fa95a9
|
@ -242,37 +242,45 @@ pub fn router() -> Router {
|
||||||
.subdir(
|
.subdir(
|
||||||
"start",
|
"start",
|
||||||
Router::new()
|
Router::new()
|
||||||
.post(ApiMethod::new(
|
.post(
|
||||||
|
ApiMethod::new(
|
||||||
start_service,
|
start_service,
|
||||||
ObjectSchema::new("Start service.")
|
ObjectSchema::new("Start service.")
|
||||||
.required("service", service_id_schema.clone()))
|
.required("service", service_id_schema.clone())
|
||||||
|
).protected(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subdir(
|
.subdir(
|
||||||
"stop",
|
"stop",
|
||||||
Router::new()
|
Router::new()
|
||||||
.post(ApiMethod::new(
|
.post(
|
||||||
|
ApiMethod::new(
|
||||||
stop_service,
|
stop_service,
|
||||||
ObjectSchema::new("Stop service.")
|
ObjectSchema::new("Stop service.")
|
||||||
.required("service", service_id_schema.clone()))
|
.required("service", service_id_schema.clone())
|
||||||
|
).protected(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subdir(
|
.subdir(
|
||||||
"restart",
|
"restart",
|
||||||
Router::new()
|
Router::new()
|
||||||
.post(ApiMethod::new(
|
.post(
|
||||||
|
ApiMethod::new(
|
||||||
restart_service,
|
restart_service,
|
||||||
ObjectSchema::new("Restart service.")
|
ObjectSchema::new("Restart service.")
|
||||||
.required("service", service_id_schema.clone()))
|
.required("service", service_id_schema.clone())
|
||||||
|
).protected(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subdir(
|
.subdir(
|
||||||
"reload",
|
"reload",
|
||||||
Router::new()
|
Router::new()
|
||||||
.post(ApiMethod::new(
|
.post(
|
||||||
|
ApiMethod::new(
|
||||||
reload_service,
|
reload_service,
|
||||||
ObjectSchema::new("Reload service.")
|
ObjectSchema::new("Reload service.")
|
||||||
.required("service", service_id_schema.clone()))
|
.required("service", service_id_schema.clone())
|
||||||
|
).protected(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
|
@ -131,7 +131,7 @@ pub fn router() -> Router {
|
||||||
ObjectSchema::new("Returns a list of syslog entries.")
|
ObjectSchema::new("Returns a list of syslog entries.")
|
||||||
.required("n", IntegerSchema::new("Line number."))
|
.required("n", IntegerSchema::new("Line number."))
|
||||||
.required("t", StringSchema::new("Line text."))
|
.required("t", StringSchema::new("Line text."))
|
||||||
)
|
).protected(true)
|
||||||
);
|
);
|
||||||
|
|
||||||
route
|
route
|
||||||
|
|
|
@ -83,7 +83,7 @@ pub fn router() -> Router {
|
||||||
set_timezone,
|
set_timezone,
|
||||||
ObjectSchema::new("Set time zone.")
|
ObjectSchema::new("Set time zone.")
|
||||||
.required("timezone", StringSchema::new("Time zone. The file '/usr/share/zoneinfo/zone.tab' contains the list of valid names."))
|
.required("timezone", StringSchema::new("Time zone. The file '/usr/share/zoneinfo/zone.tab' contains the list of valid names."))
|
||||||
)
|
).protected(true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue