Пример #1
0
 public Task <Response <string> > Schedule(MaintenanceSchedule schedule)
 {
     return(client.PostAsync <Response <string> >("maintenance/schedule", new
     {
         statuspage_id = client.GetStatusPageId(schedule.StatusPageId),
         components = schedule.ComponentIds.Select(client.CleanAndValidateId),
         containers = schedule.ContainerIds.Select(client.CleanAndValidateId),
         all_infrastructure_affected = schedule.AllInfrastructureAffected ? "1" : "0",
         maintenance_name = schedule.Name,
         maintenance_details = schedule.Details,
         date_planned_start = schedule.PlannedStart.ToString("dd-MM-yyyy"),
         time_planned_start = schedule.PlannedStart.ToString("HH:mm"),
         date_planned_end = schedule.PlannedEnd.ToString("dd-MM-yyyy"),
         time_planned_end = schedule.PlannedEnd.ToString("HH:mm"),
         maintenance_notify_now = schedule.NotifyNow ? "1" : "0",
         maintenance_notify_24_hr = schedule.Notify24h ? "1" : "0",
         maintenance_notify_1_hr = schedule.Notify1h ? "1" : "0"
     }));
 }
Пример #2
0
 public Task<Response<string>> Schedule(MaintenanceSchedule schedule)
 {
     return client.PostAsync<Response<string>>("maintenance/schedule", new
     {
         statuspage_id = client.GetStatusPageId(schedule.StatusPageId),
         components = schedule.ComponentIds.Select(client.CleanAndValidateId),
         containers = schedule.ContainerIds.Select(client.CleanAndValidateId),
         all_infrastructure_affected = schedule.AllInfrastructureAffected ? "1" : "0",
         maintenance_name = schedule.Name,
         maintenance_details = schedule.Details,
         date_planned_start = schedule.PlannedStart.ToString("dd-MM-yyyy"),
         time_planned_start = schedule.PlannedStart.ToString("HH:mm"),
         date_planned_end = schedule.PlannedEnd.ToString("dd-MM-yyyy"),
         time_planned_end = schedule.PlannedEnd.ToString("HH:mm"),
         maintenance_notify_now = schedule.NotifyNow ? "1" : "0",
         maintenance_notify_24_hr = schedule.Notify24h ? "1" : "0",
         maintenance_notify_1_hr = schedule.Notify1h ? "1" : "0"
     });
 }