Inheritance: NamedModelComponentBase
Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public static string GetServerName(Resource resource)
 {
     return GetServerName(new SqlConnectionStringBuilder(resource.Value).DataSource);
 }
Exemplo n.º 4
0
 public ResourceResolutionContext(SecretStore secrets, Service service, Resource resource)
 {
     Secrets = secrets;
     Service = service;
     Resource = resource;
 }
Exemplo n.º 5
0
 private object ResolveValue(SecretStore secrets, Service service, Resource r)
 {
     // Simpler to just to sync here.
     return ResourceResolver.Resolve(secrets, service, r);
 }