| 233 | // Model all of the executors of a framework. |
| 234 | writer->field("executors", [this](JSON::ArrayWriter* writer) { |
| 235 | foreachpair ( |
| 236 | const SlaveID& slaveId, |
| 237 | const auto& executorsMap, |
| 238 | framework_->executors) { |
| 239 | foreachvalue (const ExecutorInfo& executor, executorsMap) { |
| 240 | writer->element([this, |
| 241 | &executor, |
| 242 | &slaveId](JSON::ObjectWriter* writer) { |
| 243 | // Skip unauthorized executors. |
| 244 | if (!approvers_->approved<VIEW_EXECUTOR>( |
| 245 | executor, framework_->info)) { |
| 246 | return; |
| 247 | } |
| 248 | |
| 249 | json(writer, executor); |
| 250 | writer->field("slave_id", slaveId.value()); |
| 251 | }); |
| 252 | } |
| 253 | } |
| 254 | }); |
| 255 | |
| 256 | // Model all of the labels associated with a framework. |