Example #1
0
        public FabricSettingsMetadata GetFabricSettingsMetadata()
        {
            //// Extract Configuration
            if (this.fabricSettingsMetadata2 == null)
            {
                string fabricSettingFilePath = StandaloneUtility.FindFabricResourceFile(DMConstants.ConfigurationsFileName);
                this.fabricSettingsMetadata2 = FabricSettingsMetadata.Create(fabricSettingFilePath);
            }

            return(this.fabricSettingsMetadata2);
        }
Example #2
0
        internal static void UpdateStandAloneClusterWRPSettings(string clusterSettingsFilePath, string version, StandAloneCluster existingCluster)
        {
            string fabricSettingFilePath = StandaloneUtility.FindFabricResourceFile("Configurations.csv");
            FabricSettingsMetadata fabricSettingsMetadata = FabricSettingsMetadata.Create(fabricSettingFilePath);
            AdminConfigVersion     adminConfigVersion     = new AdminConfigVersion("Baseline", version);

            StandAloneClusterManifestSettings standAloneClusterManifestSettings = JsonConvert.DeserializeObject <StandAloneClusterManifestSettings>(
                File.ReadAllText(clusterSettingsFilePath));

            existingCluster.TargetWrpConfig = new StandaloneAdminConfig(fabricSettingsMetadata, standAloneClusterManifestSettings, adminConfigVersion, false);
        }
Example #3
0
        public void RepairManagerDefinitionTest()
        {
            string configCsvPath            = Path.Combine(Utility.TestDirectory, "Configurations.csv");
            FabricSettingsMetadata metadata = FabricSettingsMetadata.Create(configCsvPath);
            ConfigDescription      desc     = null;

            metadata.TryGetConfigDescription(StringConstants.SectionName.RepairManager, StringConstants.ParameterName.TargetReplicaSetSize, out desc);
            Assert.AreEqual(desc.DefaultValue, "0");
            Assert.AreEqual(desc.UpgradePolicy, UpgradePolicy.SingleChange);
            metadata.TryGetConfigDescription(StringConstants.SectionName.RepairManager, StringConstants.ParameterName.MinReplicaSetSize, out desc);
            Assert.AreEqual(desc.DefaultValue, "0");
            Assert.AreEqual(desc.UpgradePolicy, UpgradePolicy.SingleChange);
        }
Example #4
0
        public MockupAdminConfig(bool isUserSet = false)
        {
            string fabricSettingFilePath = Utility.FindFabricResourceFile(Constant.ConfigurationsFileName);

            this.fabricSettingsMetadata = FabricSettingsMetadata.Create(fabricSettingFilePath);
            string clusterSettingsFilePath = this.GetClusterSettingsFilePath();

            // Extract Cluster Settings
            // ReSharper disable once AssignNullToNotNullAttribute - fabric Code Path cannot be null here.
            this.Version = new AdminConfigVersion("Baseline", "Baseline");
            this.mockupClusterManifestSettings = JsonConvert.DeserializeObject <MockupClusterManifestSettings>(
                File.ReadAllText(clusterSettingsFilePath));
            this.IsUserSet = isUserSet;
        }
Example #5
0
        public StandaloneAdminConfig(string configurationsFilePath = null, bool isUserSet = false)
        {
            //// Extract Configuration

            string fabricSettingFilePath = string.IsNullOrEmpty(configurationsFilePath)
                                                 ? StandaloneUtility.FindFabricResourceFile(DMConstants.ConfigurationsFileName)
                                                 : configurationsFilePath;

            this.fabricSettingsMetadata = FabricSettingsMetadata.Create(fabricSettingFilePath);
            string clusterSettingsFilePath = this.GetClusterSettingsFilePath();

            // Extract Cluster Settings
            // ReSharper disable once AssignNullToNotNullAttribute - fabric Code Path cannot be null here.
            this.Version = new AdminConfigVersion("Baseline", "Baseline");
            this.standAloneClusterManifestSettings = JsonConvert.DeserializeObject <StandAloneClusterManifestSettings>(
                File.ReadAllText(clusterSettingsFilePath));
            this.IsUserSet = isUserSet;
        }
Example #6
0
        public FabricSettingsMetadata GetFabricSettingsMetadata()
        {
            string fabricSettingFilePath = Utility.FindFabricResourceFile(Constant.ConfigurationsFileName);

            return(FabricSettingsMetadata.Create(fabricSettingFilePath));
        }