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(
|
||||
"start",
|
||||
Router::new()
|
||||
.post(ApiMethod::new(
|
||||
.post(
|
||||
ApiMethod::new(
|
||||
start_service,
|
||||
ObjectSchema::new("Start service.")
|
||||
.required("service", service_id_schema.clone()))
|
||||
.required("service", service_id_schema.clone())
|
||||
).protected(true)
|
||||
)
|
||||
)
|
||||
.subdir(
|
||||
"stop",
|
||||
Router::new()
|
||||
.post(ApiMethod::new(
|
||||
.post(
|
||||
ApiMethod::new(
|
||||
stop_service,
|
||||
ObjectSchema::new("Stop service.")
|
||||
.required("service", service_id_schema.clone()))
|
||||
.required("service", service_id_schema.clone())
|
||||
).protected(true)
|
||||
)
|
||||
)
|
||||
.subdir(
|
||||
"restart",
|
||||
Router::new()
|
||||
.post(ApiMethod::new(
|
||||
.post(
|
||||
ApiMethod::new(
|
||||
restart_service,
|
||||
ObjectSchema::new("Restart service.")
|
||||
.required("service", service_id_schema.clone()))
|
||||
.required("service", service_id_schema.clone())
|
||||
).protected(true)
|
||||
)
|
||||
)
|
||||
.subdir(
|
||||
"reload",
|
||||
Router::new()
|
||||
.post(ApiMethod::new(
|
||||
.post(
|
||||
ApiMethod::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.")
|
||||
.required("n", IntegerSchema::new("Line number."))
|
||||
.required("t", StringSchema::new("Line text."))
|
||||
)
|
||||
).protected(true)
|
||||
);
|
||||
|
||||
route
|
||||
|
|
|
@ -83,7 +83,7 @@ pub fn router() -> Router {
|
|||
set_timezone,
|
||||
ObjectSchema::new("Set time zone.")
|
||||
.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