File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
src/WebJobs.Script.WebHost
test/WebJobs.Script.Tests Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,10 @@ public FunctionStatus GetFunctionStatus(string name)
85
85
[ Route ( "admin/host/status" ) ]
86
86
public HostStatus GetHostStatus ( )
87
87
{
88
- HostStatus status = new HostStatus ( ) ;
88
+ HostStatus status = new HostStatus
89
+ {
90
+ Id = _scriptHostManager . Instance ? . ScriptConfig . HostConfig . HostId
91
+ } ;
89
92
90
93
var lastError = _scriptHostManager . LastError ;
91
94
if ( lastError != null )
Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ public HostStatus()
14
14
}
15
15
16
16
/// <summary>
17
- /// Gets the host version.
17
+ /// Gets or sets the host id.
18
+ /// </summary>
19
+ [ JsonProperty ( PropertyName = "id" , DefaultValueHandling = DefaultValueHandling . Ignore ) ]
20
+ public string Id { get ; set ; }
21
+
22
+ /// <summary>
23
+ /// Gets or sets the host version.
18
24
/// </summary>
19
25
[ JsonProperty ( PropertyName = "version" , DefaultValueHandling = DefaultValueHandling . Ignore ) ]
20
26
public string Version { get ; set ; }
Original file line number Diff line number Diff line change @@ -814,6 +814,8 @@ public async Task HostStatus_Succeeds()
814
814
815
815
AssemblyFileVersionAttribute fileVersionAttr = typeof ( HostStatus ) . Assembly . GetCustomAttribute < AssemblyFileVersionAttribute > ( ) ;
816
816
string expectedVersion = fileVersionAttr . Version ;
817
+ string expectedId = "5a709861cab44e68bfed5d2c2fe7fc0c" ;
818
+ Assert . Equal ( expectedId , jsonContent [ "id" ] . ToString ( ) ) ;
817
819
Assert . Equal ( expectedVersion , jsonContent [ "version" ] . ToString ( ) ) ;
818
820
819
821
// Now ensure XML content works
@@ -828,6 +830,8 @@ public async Task HostStatus_Succeeds()
828
830
XDocument doc = XDocument . Parse ( content ) ;
829
831
var node = doc . Descendants ( XName . Get ( "Version" , ns ) ) . Single ( ) ;
830
832
Assert . Equal ( expectedVersion , node . Value ) ;
833
+ node = doc . Descendants ( XName . Get ( "Id" , ns ) ) . Single ( ) ;
834
+ Assert . Equal ( expectedId , node . Value ) ;
831
835
832
836
node = doc . Descendants ( XName . Get ( "Errors" , ns ) ) . Single ( ) ;
833
837
Assert . True ( node . IsEmpty ) ;
You can’t perform that action at this time.
0 commit comments