mirror of
https://github.com/google/nomulus
synced 2026-02-06 21:11:34 +00:00
Add SetNumInstancesCommand in Nomulus tool to adjust the number of instances
for a given service and version at runtime. Note that this CL only supports the adjustment for a given service and version. I will add another functionality to let this command be able to detect all non-live versions automatically and apply the adjustment. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=221092001
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package google.registry.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
import com.google.appengine.api.modules.ModulesService;
|
||||
@@ -52,6 +53,14 @@ public class AppEngineServiceUtilsImpl implements AppEngineServiceUtils {
|
||||
return modulesService.getVersionHostname(service, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNumInstances(String service, String version, long numInstances) {
|
||||
checkArgumentNotNull(service, "Must specify the service");
|
||||
checkArgumentNotNull(version, "Must specify the version");
|
||||
checkArgument(numInstances > 0, "Number of instances must be greater than 0");
|
||||
modulesService.setNumInstances(service, version, numInstances);
|
||||
}
|
||||
|
||||
/** Dagger module for AppEngineServiceUtils. */
|
||||
@Module
|
||||
public abstract static class AppEngineServiceUtilsModule {
|
||||
|
||||
Reference in New Issue
Block a user