Example #1
0
        public bool StartDB(string cloudType, string instanceId)
        {
            CloudType type;

            try
            {
                using (this.log.InfoCall())
                {
                    if (Enum.TryParse(cloudType, out type) && type == CloudType.AWS)
                    {
                        AWSCloudService service = new AWSCloudService();
                        if (service.StartDB(instanceId))
                        {
                            return(true);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                this.log.Error(e);
                return(false);
            }

            return(false);
        }
Example #2
0
        public bool AddAccount(string cloudType, string accountName, string param1, string param2, string param3, string param4 = "")
        {
            CloudType type;

            try
            {
                using (this.log.InfoCall())
                {
                    if (Enum.TryParse(cloudType, out type) && type == CloudType.AWS)
                    {
                        AWSCloudService aws = new AWSCloudService();
                        return(aws.AddAccount(accountName, param1, param2, param3));
                    }

                    if (Enum.TryParse(cloudType, out type) && type == CloudType.Azure)
                    {
                        AzureCloudService azure = new AzureCloudService();
                        return(azure.AddAccount(accountName, param1, param2, param3, param4));
                    }
                }

                return(false);
            }
            catch (Exception e)
            {
                this.log.Error(e);
                return(false);
            }
        }
Example #3
0
        public bool UpdateDBProperties(string cloudType)
        {
            CloudType type;

            try
            {
                using (this.log.InfoCall())
                {
                    if (Enum.TryParse(cloudType, out type) && type == CloudType.AWS)
                    {
                        AWSCloudService aws    = new AWSCloudService();
                        var             result = aws.GetDBProperties();
                        if (result != null)
                        {
                            return(aws.InsertDBIntoDB(result));
                        }
                    }

                    if (Enum.TryParse(cloudType, out type) && type == CloudType.Azure)
                    {
                        AzureCloudService azure = new AzureCloudService();
                        var result = azure.GetDBProperties();
                        if (result != null)
                        {
                            return(azure.InsertDBIntoDB(result));
                        }
                    }
                }

                return(false);
            }
            catch (Exception e)
            {
                this.log.Error(e);
                return(false);
            }
        }