/// <summary> /// Create new deployment /// </summary> /// <param name="configuration"></param> internal EdgeDeploymentBase(ConfigurationContentModel configuration) { if (configuration == null) { // Create default configuration _configuration = new ConfigurationContentModel(); _edgeAgent = new EdgeAgentConfigurationModel { SchemaVersion = kDefaultSchemaVersion, Modules = new Dictionary <string, EdgeAgentModuleModel>(), Runtime = new EdgeAgentRuntimeModel { Settings = new EdgeAgentRuntimeSettingsModel() } }; _edgeHub = new EdgeHubConfigurationModel { SchemaVersion = kDefaultSchemaVersion, Routes = new Dictionary <string, string> { [kDefaultRouteName] = kDefaultRoute }, StorageConfig = new EdgeHubStoreAndForwardModel { TimeToLiveSecs = 7200 } }; _configuration.AddModulesContent(_edgeAgent); _configuration.AddModulesContent(_edgeHub); } else { // Use provided configuration _configuration = configuration; _edgeAgent = _configuration.GetEdgeAgentConfiguration(); _edgeHub = _configuration.GetEdgeHubConfiguration(); } }
/// <summary> /// Add iotedge hub configuration model as modules content /// </summary> /// <param name="config"></param> /// <param name="model"></param> public static void AddModulesContent(this ConfigurationContentModel config, EdgeHubConfigurationModel model) { config.AddModulesContent("$edgeHub", model); }