Exemple #1
0
        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                var cmd = new CloudComputeConnector(Email.Get(context), AccessKey.Get(context), SecretKey.Get(context));

                cmd.InsertInstance(Region.Get(context), VmName.Get(context), AmiID.Get(context), ImgProject.Get(context));
                Response.Set(context, "Complete");
            }
            catch (Exception e)
            {
                Error.Set(context, e.Message);
            }
        }
Exemple #2
0
 protected override void Execute(CodeActivityContext context)
 {
     try
     {
         var azureVM = new AzureVMTerminalRunner(SubscriptionId.Get(context), ClientSecret.Get(context)
                                                 , ClientId.Get(context), TenantId.Get(context));
         var resonses = azureVM.RunUnixCommand(GroupName.Get(context), VmName.Get(context), Commands.Get(context).Split(';'), VmUserName.Get(context)
                                               , VmUserPassword.Get(context));
         Response.Set(context, JsonConvert.SerializeObject(resonses));
     }
     catch (Exception e)
     {
         Error.Set(context, e.Message);
     }
 }
 protected override void Execute(CodeActivityContext context)
 {
     try
     {
         var azureVM = new AzureVM(SubscriptionId.Get(context), ClientSecret.Get(context)
                                   , ClientId.Get(context), TenantId.Get(context));
         azureVM.CreateCentOS7VM(GroupName.Get(context), VmName.Get(context), Region.Get(context), VmUserName.Get(context)
                                 , VmUserPassword.Get(context));
         Response.Set(context, "Complete");
     }
     catch (Exception e)
     {
         Error.Set(context, e.Message);
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (AppEngineRelease.Length != 0)
            {
                hash ^= AppEngineRelease.GetHashCode();
            }
            if (Availability != global::Google.Cloud.AppEngine.V1.Instance.Types.Availability.Unspecified)
            {
                hash ^= Availability.GetHashCode();
            }
            if (VmName.Length != 0)
            {
                hash ^= VmName.GetHashCode();
            }
            if (VmZoneName.Length != 0)
            {
                hash ^= VmZoneName.GetHashCode();
            }
            if (VmId.Length != 0)
            {
                hash ^= VmId.GetHashCode();
            }
            if (startTime_ != null)
            {
                hash ^= StartTime.GetHashCode();
            }
            if (Requests != 0)
            {
                hash ^= Requests.GetHashCode();
            }
            if (Errors != 0)
            {
                hash ^= Errors.GetHashCode();
            }
            if (Qps != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Qps);
            }
            if (AverageLatency != 0)
            {
                hash ^= AverageLatency.GetHashCode();
            }
            if (MemoryUsage != 0L)
            {
                hash ^= MemoryUsage.GetHashCode();
            }
            if (VmStatus.Length != 0)
            {
                hash ^= VmStatus.GetHashCode();
            }
            if (VmDebugEnabled != false)
            {
                hash ^= VmDebugEnabled.GetHashCode();
            }
            if (VmIp.Length != 0)
            {
                hash ^= VmIp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }