MCPcopy Create free account
hub / github.com/apache/mesos / __updateMaintenanceSchedule

Method __updateMaintenanceSchedule

src/master/http.cpp:3111–3136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3109}
3110
3111Future<Response> Master::Http::__updateMaintenanceSchedule(
3112 const mesos::maintenance::Schedule& schedule,
3113 const Owned<ObjectApprovers>& approvers) const
3114{
3115 foreach (const mesos::maintenance::Window& window, schedule.windows()) {
3116 foreach (const MachineID& machine, window.machine_ids()) {
3117 if (!approvers->approved<UPDATE_MAINTENANCE_SCHEDULE>(machine)) {
3118 return Forbidden();
3119 }
3120 }
3121 }
3122
3123 return master->registrar->apply(Owned<RegistryOperation>(
3124 new maintenance::UpdateSchedule(schedule)))
3125 .onAny([](const Future<bool>& result) {
3126 // TODO(fiu): Consider changing/refactoring the registrar itself
3127 // so the individual call sites don't need to handle this separately.
3128 // All registrar failures that cause it to abort should instead
3129 // abort the process.
3130 CHECK_READY(result)
3131 << "Failed to update maintenance schedule in the registry";
3132 })
3133 .then(defer(master->self(), [this, schedule](bool result) {
3134 return ___updateMaintenanceSchedule(schedule, result);
3135 }));
3136}
3137
3138Future<Response> Master::Http::___updateMaintenanceSchedule(
3139 const mesos::maintenance::Schedule& schedule,

Callers

nothing calls this directly

Calls 4

deferFunction · 0.85
thenMethod · 0.45
applyMethod · 0.45
selfMethod · 0.45

Tested by

no test coverage detected