Exemplo n.º 1
0
        public string DeleteInfrastructure(CloudEnvironments infrastructureName)
        {
            ICloudProvider cloudProvider = _cloudProviderFactory.GetAbstractCloudProvider(Provider);
            var            cloudManager  = cloudProvider.GetCloudEnvironment(infrastructureName);
            var            deleted       = cloudManager.DeleteInfrastructure();

            return(deleted ? $"{infrastructureName} deleted successfully" : $"{infrastructureName} deletion failed");
        }
Exemplo n.º 2
0
 public ICloudEnvironment GetCloudEnvironment(CloudEnvironments environment)
 {
     switch (environment)
     {
     case CloudEnvironments.Test:
         return(_IAWSTest);
     }
     throw new Exception($"UNKNOWN Environment : {environment}");
 }
Exemplo n.º 3
0
        public string CreateDatabaseServer(DatabaseServer databaseServer, CloudEnvironments environment)
        {
            var isValid = ValidateDatabaseServer(databaseServer);

            if (!string.IsNullOrEmpty(isValid))
            {
                return(isValid);
            }
            ICloudProvider cloudProvider = _cloudProviderFactory.GetAbstractCloudProvider(Provider);
            var            cloudManager  = cloudProvider.GetCloudEnvironment(environment);
            var            created       = cloudManager.CreateDatabaseServer(databaseServer.Type);

            return(created ? $"{environment}-{databaseServer.Type} Database server created successfully" : "Database server creation failed");
        }
Exemplo n.º 4
0
        public string CreateVirtualMachine(VirtualMachine virtualMachine, CloudEnvironments environment)
        {
            var isValid = ValidateVirtualMachine(virtualMachine);

            if (!string.IsNullOrEmpty(isValid))
            {
                return(isValid);
            }

            ICloudProvider cloudProvider = _cloudProviderFactory.GetAbstractCloudProvider(Provider);
            var            cloudManager  = cloudProvider.GetCloudEnvironment(environment);
            var            created       = cloudManager.CreateVirtualMachine(virtualMachine.Type);

            return(created ? $"{environment}-{virtualMachine.Type} Virtual machine created successfully" : "Virtual machine creation failed");
        }
Exemplo n.º 5
0
        public ICloudEnvironment GetCloudEnvironment(CloudEnvironments environment)
        {
            switch (environment)
            {
            case CloudEnvironments.Test:
                return(_IIGSTest);

            case CloudEnvironments.UAT:
                return(_IIGSUAT);

            case CloudEnvironments.Production:
                return(_IIGSProduction);
            }
            throw new Exception($"Unknown Environment : {environment}");
        }
Exemplo n.º 6
0
 internal static string GetVMResourceFileName(CloudEnvironments environment)
 {
     return($"{environment}_Server_{DateTime.Now.ToString("ddMMyyyyhhmmssfff")}");
 }