3 final class DrydockManagementUpdateResourceWorkflow
4 extends DrydockManagementWorkflow
{
6 protected function didConstruct() {
8 ->setName('update-resource')
9 ->setSynopsis(pht('Update a resource.'))
16 'help' => pht('Resource ID to update.'),
21 public function execute(PhutilArgumentParser
$args) {
22 $viewer = $this->getViewer();
24 $ids = $args->getArg('id');
26 throw new PhutilArgumentUsageException(
28 'Specify one or more resource IDs to update with "%s".',
32 $resources = id(new DrydockResourceQuery())
37 PhabricatorWorker
::setRunAllTasksInProcess(true);
39 foreach ($ids as $id) {
40 $resource = idx($resources, $id);
45 pht('Resource "%s" does not exist.', $id));
51 pht('Updating resource "%s".', $id));
53 $resource->scheduleUpdate();