Esempio n. 1
0
        public static ICloudServiceProvider ConstructCloudProvider(CloudServiceProviders cloudProvider)
        {
            ICloudServiceProvider provider = null;

            switch (cloudProvider)
            {
            case CloudServiceProviders.IGS:
                provider = new IGSCloudService();
                break;

            case CloudServiceProviders.Azure:
                provider = new AzureCloudService();
                break;

            case CloudServiceProviders.AWS:
                provider = new AWSCloudService();
                break;

            case CloudServiceProviders.Google:
                provider = new GoogleCloudService();
                break;

            default:
                provider = new IGSCloudService();
                break;
            }
            return(provider);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //-------------------------------------------------------------------------------------------
            //-- Here you Can test the Cloud Library, you can use the comments for test every part alone.
            //-------------------------------------------------------------------------------------------

            // -- Here you can construct, which any Cloud Provider will deal with.
            ICloudServiceProvider igsCloudProvider = CloudServiceProviderFactory.ConstructCloudProvider(CloudServiceProviders.IGS);

            // -- Create New Infrastructure in the cloud provider you constructed before.
            igsCloudProvider.CreateInfrastructure("UAT");

            // -- Add Resources for the Infrastructure.
            Dictionary <string, string> specs = new Dictionary <string, string>();

            specs.Add("RAM", "16 GB");
            specs.Add("Storage", "1000 GB");
            specs.Add("Proccessor", "4 Cores");
            specs.Add("OS", "Windows");
            igsCloudProvider.AddResource("UAT", "SERVER", CloudServiceProviderResources.VirtualMachine, specs);

            // -- Delete the Infrastructure
            igsCloudProvider.DeleteInfrastructure("UAT");
        }
Esempio n. 3
0
 protected BaseController(ICloudServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }