Instead of relying on the ensure
method, you can manually increase and decrease servers.
use Spatie\DynamicServers\Facades\DynamicServers;
DynamicServers::increase()
DynamicServers::increase(3)
DynamicServers::increase(type: 'big')
DynamicServers::increase(5, type: 'big')
DynamicServers::decrease()
DynamicServers::decrease(2)
DynamicServers::decrease(type: 'big')
DynamicServers::decrease(3, type: 'big')
Be aware that calling ensure($numberOfServers)
will simply ensure that there are the number of servers giving available. It doesn't take into account any calls you made to increase
or decrease
previously.
##Determine how many servers are provisioned
To know how many dynamic servers are provisioned (servers that are starting, running or rebooting) you can call provisionedCount
:
use Spatie\DynamicServers\Facades\DynamicServers;
DynamicServers::provisionedCount();