api: list tape backup jobs with scheduling status

This commit is contained in:
Dietmar Maurer
2021-02-19 09:02:13 +01:00
parent 1860208560
commit 7690a8e7bd
2 changed files with 73 additions and 3 deletions

View File

@ -22,6 +22,7 @@ use crate::api2::types::{
MEDIA_POOL_NAME_SCHEMA,
SINGLE_LINE_COMMENT_SCHEMA,
SYNC_SCHEDULE_SCHEMA,
JobScheduleStatus,
};
lazy_static! {
@ -81,6 +82,26 @@ pub struct TapeBackupJobConfig {
pub schedule: Option<String>,
}
#[api(
properties: {
config: {
type: TapeBackupJobConfig,
},
status: {
type: JobScheduleStatus,
},
},
)]
#[serde(rename_all="kebab-case")]
#[derive(Serialize,Deserialize)]
/// Status of Tape Backup Job
pub struct TapeBackupJobStatus {
#[serde(flatten)]
pub config: TapeBackupJobConfig,
#[serde(flatten)]
pub status: JobScheduleStatus,
}
fn init() -> SectionConfig {
let obj_schema = match TapeBackupJobConfig::API_SCHEMA {
Schema::Object(ref obj_schema) => obj_schema,