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

Method createDisk

src/master/authorization.cpp:321–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319
320
321Try<ActionObject> ActionObject::createDisk(
322 const Offer::Operation::CreateDisk& createDisk)
323{
324 auto action = ([&createDisk]() -> Option<authorization::Action> {
325 switch (createDisk.target_type()) {
326 case Resource::DiskInfo::Source::MOUNT:
327 return authorization::CREATE_MOUNT_DISK;
328 case Resource::DiskInfo::Source::BLOCK:
329 return authorization::CREATE_BLOCK_DISK;
330 case Resource::DiskInfo::Source::UNKNOWN:
331 case Resource::DiskInfo::Source::PATH:
332 case Resource::DiskInfo::Source::RAW:
333 return None();
334 }
335
336 return None();
337 })();
338
339 if (action.isNone()) {
340 return Error(
341 "Unsupported disk type: " + stringify(createDisk.target_type()));
342 }
343
344 return fromResourceWithLegacyValue(
345 *action, createDisk.source(), getReservationRole(createDisk.source()));
346}
347
348
349Try<ActionObject> ActionObject::destroyDisk(

Callers

nothing calls this directly

Calls 5

NoneClass · 0.85
getReservationRoleFunction · 0.85
ErrorFunction · 0.50
stringifyFunction · 0.50
isNoneMethod · 0.45

Tested by

no test coverage detected