forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 469065: Merge master1 to master
Remove the master1 branch. Related work items: #1598129
- Loading branch information
Showing
98 changed files
with
4,430 additions
and
2,264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/AgentConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
namespace Microsoft.Azure.Devices.Edge.Agent.Core | ||
{ | ||
using Microsoft.Azure.Devices.Edge.Util; | ||
|
||
public class AgentConfig | ||
{ | ||
public AgentConfig(long version, IRuntimeInfo runtimeInfo, ModuleSet moduleSet, Option<IEdgeAgentModule> edgeAgent) | ||
{ | ||
this.Version = version; | ||
this.Runtime = runtimeInfo; | ||
this.ModuleSet = moduleSet ?? ModuleSet.Empty; | ||
this.EdgeAgent = edgeAgent; | ||
} | ||
|
||
public static AgentConfig Empty { get; } = new AgentConfig(0, UnknownRuntimeInfo.Instance, ModuleSet.Empty, Option.None<IEdgeAgentModule>()); | ||
|
||
public long Version { get; } | ||
|
||
public IRuntimeInfo Runtime { get; } | ||
|
||
public ModuleSet ModuleSet { get; } | ||
|
||
public Option<IEdgeAgentModule> EdgeAgent { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/ConfigurationInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
namespace Microsoft.Azure.Devices.Edge.Agent.Core | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class ConfigurationInfo : IEquatable<ConfigurationInfo> | ||
{ | ||
[JsonConstructor] | ||
public ConfigurationInfo(string id = "") | ||
{ | ||
this.Id = id ?? string.Empty; | ||
} | ||
|
||
[JsonProperty(PropertyName = "id")] | ||
public string Id { get; } | ||
|
||
public override bool Equals(object obj) => this.Equals(obj as ConfigurationInfo); | ||
|
||
public bool Equals(ConfigurationInfo other) => other != null && this.Id == other.Id; | ||
|
||
public override int GetHashCode() | ||
{ | ||
return 2108858624 + EqualityComparer<string>.Default.GetHashCode(Id); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/DeploymentStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
namespace Microsoft.Azure.Devices.Edge.Agent.Core | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class DeploymentStatus : IEquatable<DeploymentStatus> | ||
{ | ||
public static readonly DeploymentStatus Unknown = new DeploymentStatus(DeploymentStatusCode.Unknown); | ||
public static readonly DeploymentStatus Success = new DeploymentStatus(DeploymentStatusCode.Successful); | ||
|
||
public DeploymentStatus(DeploymentStatusCode code): | ||
this(code, string.Empty) | ||
{ | ||
} | ||
|
||
[JsonConstructor] | ||
public DeploymentStatus(DeploymentStatusCode code, string description) | ||
{ | ||
this.Code = code; | ||
this.Description = description ?? string.Empty; | ||
} | ||
|
||
[JsonProperty(PropertyName = "code")] | ||
public DeploymentStatusCode Code { get; } | ||
|
||
[JsonProperty(PropertyName = "description")] | ||
public string Description { get; } | ||
|
||
public override bool Equals(object obj) => this.Equals(obj as DeploymentStatus); | ||
|
||
public bool Equals(DeploymentStatus other) | ||
{ | ||
return other != null && | ||
this.Code == other.Code && | ||
this.Description == other.Description; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
var hashCode = 1291371069; | ||
hashCode = hashCode * -1521134295 + this.Code.GetHashCode(); | ||
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(this.Description); | ||
return hashCode; | ||
} | ||
|
||
public static bool operator ==(DeploymentStatus status1, DeploymentStatus status2) | ||
{ | ||
return EqualityComparer<DeploymentStatus>.Default.Equals(status1, status2); | ||
} | ||
|
||
public static bool operator !=(DeploymentStatus status1, DeploymentStatus status2) | ||
{ | ||
return !(status1 == status2); | ||
} | ||
|
||
public DeploymentStatus Clone() => new DeploymentStatus(this.Code, this.Description); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/DeploymentStatusCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
namespace Microsoft.Azure.Devices.Edge.Agent.Core | ||
{ | ||
public enum DeploymentStatusCode | ||
{ | ||
Unknown = 406, | ||
Successful = 200, | ||
Failed = 400 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.