Browse Source

Small API cleanup

- Removed unused types
- Add Environment to ReplicaStatus
pull/259/head
David Fowler 6 years ago
parent
commit
fca277c102
  1. 2
      src/Microsoft.Tye.Hosting/DockerRunner.cs
  2. 1
      src/Microsoft.Tye.Hosting/Model/ProcessStatus.cs
  3. 2
      src/Microsoft.Tye.Hosting/Model/ReplicaStatus.cs
  4. 3
      src/Microsoft.Tye.Hosting/Model/V1/V1ReplicaStatus.cs
  5. 12
      src/Microsoft.Tye.Hosting/Model/V1/V1ReplicaType.cs
  6. 2
      src/Microsoft.Tye.Hosting/TyeDashboardApi.cs

2
src/Microsoft.Tye.Hosting/DockerRunner.cs

@ -159,6 +159,8 @@ namespace Microsoft.Tye.Hosting
environment["APP_INSTANCE"] = replica;
status.Environment = environment;
foreach (var pair in environment)
{
environmentArguments += $"-e {pair.Key}={pair.Value} ";

1
src/Microsoft.Tye.Hosting/Model/ProcessStatus.cs

@ -15,6 +15,5 @@ namespace Microsoft.Tye.Hosting.Model
public int? ExitCode { get; set; }
public int? Pid { get; set; }
public IDictionary<string, string>? Environment { get; set; }
}
}

2
src/Microsoft.Tye.Hosting/Model/ReplicaStatus.cs

@ -23,5 +23,7 @@ namespace Microsoft.Tye.Hosting.Model
public Dictionary<object, object> Items { get; } = new Dictionary<object, object>();
public Dictionary<string, string> Metrics { get; set; } = new Dictionary<string, string>();
public IDictionary<string, string>? Environment { get; set; }
}
}

3
src/Microsoft.Tye.Hosting/Model/V1/V1ReplicaStatus.cs

@ -4,14 +4,11 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.Tye.Hosting.Model.V1
{
public class V1ReplicaStatus
{
public V1ReplicaType Type { get; set; }
public string? DockerCommand { get; set; }
public string? ContainerId { get; set; }
public string? Name { get; set; }

12
src/Microsoft.Tye.Hosting/Model/V1/V1ReplicaType.cs

@ -1,12 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.Tye.Hosting.Model.V1
{
public enum V1ReplicaType
{
Process,
Docker
}
}

2
src/Microsoft.Tye.Hosting/TyeDashboardApi.cs

@ -174,6 +174,7 @@ namespace Microsoft.Tye.Hosting
{
Name = replica.Value.Name,
Ports = replica.Value.Ports,
Environment = replica.Value.Environment
};
replicateDictionary[replica.Key] = replicaStatus;
@ -182,7 +183,6 @@ namespace Microsoft.Tye.Hosting
{
replicaStatus.Pid = processStatus.Pid;
replicaStatus.ExitCode = processStatus.ExitCode;
replicaStatus.Environment = processStatus.Environment;
}
else if (replica.Value is DockerStatus dockerStatus)
{

Loading…
Cancel
Save