public InstallModuleTaskRequestEvent(Id taskId, Id referenceId, ModuleReplicas moduleReplicas, ImageName imageName,
                                      ModuleName moduleName)
 {
     TaskId         = taskId;
     ReferenceId    = referenceId;
     ModuleReplicas = moduleReplicas;
     ImageName      = imageName;
     ModuleName     = moduleName;
 }
 public ModuleManagerConfig(Id taskId, ModuleReplicas moduleReplicas, ModuleName moduleName, ImageName imageName, LoadBalancerConfig loadBalancerConfig, Func <Id, ILogHandler, Task> successCallback, Func <Id, ILogHandler, Task> failureCallback, Func <Id, ILogHandler, Task> updateCallback)
 {
     TaskId             = taskId;
     LoadBalancerConfig = loadBalancerConfig;
     _moduleReplicas    = moduleReplicas;
     _moduleName        = moduleName;
     _imageName         = imageName;
     SuccessCallback    = successCallback;
     FailureCallback    = failureCallback;
     UpdateCallback     = updateCallback;
 }
        public RequestInstallModule(string imageName, int moduleReplicas, string moduleName, LoadBalancerConfig loadBalancerConfig)
        {
            if (loadBalancerConfig == null)
            {
                throw new Exception("loadBalancerConfig may not be null");
            }

            ImageName          = new ImageName(imageName);
            ModuleReplicas     = new ModuleReplicas(moduleReplicas);
            ModuleName         = new ModuleName(moduleName);
            LoadBalancerConfig = loadBalancerConfig;
        }
Exemple #4
0
        public async Task <Response> ScaleDeployment(string deploymentName, ModuleReplicas moduleReplicas, string nameSpace = "default")
        {
            // Create json patch for replicas
            var jsonPatch = new JsonPatchDocument <V1Scale>();

            // Insert replicas into patch
            jsonPatch.Replace(e => e.Spec.Replicas, moduleReplicas.Value);

            var patch = new V1Patch(jsonPatch);

            try
            {
                var result = await _client.PatchNamespacedDeploymentScaleWithHttpMessagesAsync(patch, deploymentName, nameSpace);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(Response.Unsuccessful(e.Message));
            }

            return(Response.Success());
        }
Exemple #5
0
 public ScaleModuleCommand(Guid moduleId, int replicas)
 {
     Id       = new Id(moduleId);
     Replicas = new ModuleReplicas(replicas);
 }