public static object Resolve(SecretStore secrets, Service service, Resource resource) { Func<ResourceResolutionContext, object> resolver; if (!Resolvers.TryGetValue(resource.Type, out resolver)) { return String.Empty; } return resolver(new ResourceResolutionContext(secrets, service, resource)) ?? String.Empty; }
public static string GetAdminUserName(Resource server, Datacenter dc) { string user; if (!server.Attributes.TryGetValue("adminUser", out user) || String.IsNullOrEmpty(user)) { user = String.Format( "{0}-admin", dc.FullName); } return user; }
public static string GetServerName(Resource resource) { return GetServerName(new SqlConnectionStringBuilder(resource.Value).DataSource); }
public ResourceResolutionContext(SecretStore secrets, Service service, Resource resource) { Secrets = secrets; Service = service; Resource = resource; }
private object ResolveValue(SecretStore secrets, Service service, Resource r) { // Simpler to just to sync here. return ResourceResolver.Resolve(secrets, service, r); }