3 final class DrydockManagementUpdateLeaseWorkflow
4 extends DrydockManagementWorkflow
{
6 protected function didConstruct() {
8 ->setName('update-lease')
9 ->setSynopsis(pht('Update a lease.'))
16 'help' => pht('Lease 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 lease IDs to update with "%s".',
32 $leases = id(new DrydockLeaseQuery())
37 PhabricatorWorker
::setRunAllTasksInProcess(true);
39 foreach ($ids as $id) {
40 $lease = idx($leases, $id);
45 pht('Lease "%s" does not exist.', $id));
51 pht('Updating lease "%s".', $id));
53 $lease->scheduleUpdate();