Skip to content

Commit

Permalink
delete local role when shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Tree committed Nov 18, 2019
1 parent 1aea45e commit 1bb3a70
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Scene/ShutdownLocalServerFromVServerGroup.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace Swango\Aliyun\Slb\Scene;
use Swango\Aliyun\Slb\Action\VServerGroup\BackendServer\RemoveVServerGroupBackendServers;
use Swango\Aliyun\Slb\Action\VServerGroup\Rule\DeleteRules;
use Swango\Aliyun\Slb\JsonBuilder\DeleteRulesJsonBuilder;
use Swango\Aliyun\Slb\JsonBuilder\RemoveBackendServersJsonBuilder;
use Swango\Aliyun\Slb\LocalRule;
use Swango\Aliyun\Slb\LocalServer;
use Swango\Aliyun\Slb\LocalVServerGroup;
class ShutdownLocalServerFromVServerGroup {
Expand All @@ -13,6 +16,12 @@ public static function shutdown() {
$action = new RemoveVServerGroupBackendServers($builder);
$action->getResult();
}
if (LocalRule::isAvailable(false)) {
$builder = new DeleteRulesJsonBuilder();
$builder->addRule(LocalRule::getRuleId());
$action = new DeleteRules($builder);
$action->getResult();
}
}
}
}

0 comments on commit 1bb3a70

Please sign in to comment.