Example #1
0
 public void AddResource(string infrastructureName, string resourceName, CloudServiceProviderResources resourceType, Dictionary <string, string> resourceSpecs)
 {
     Utils.AddInfrastructureResource(ProviderDirectoryName, infrastructureName, resourceName, resourceType, resourceSpecs);
 }
Example #2
0
        public static void AddInfrastructureResource(string ProviderDirectoryName, string infrastructureName, string resourceName, CloudServiceProviderResources resourceType, Dictionary <string, string> resourceSpecs)
        {
            string newDir = GetBasePath() + ProviderDirectoryName + "\\" + infrastructureName + "\\" + resourceType.ToString();

            CreateDirectory(newDir);
            string resourceSpecsAsJSON = JsonConvert.SerializeObject(resourceSpecs, Formatting.Indented);

            try
            {
                File.WriteAllText(newDir + "\\" + infrastructureName + "_" + resourceName + ".json", resourceSpecsAsJSON);
            }
            catch (IOException ioEx)
            {
                Debug.WriteLine(ioEx.Message);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }