Skip to content

Commit c74ac51

Browse files
committed
Merge pull request #145 from AuxMon/build
BUG: 3586662 Powershell - Usage cmdlets for retrieving usage across reso...
2 parents 0b3d946 + 17b9289 commit c74ac51

File tree

12 files changed

+779
-107
lines changed

12 files changed

+779
-107
lines changed

src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Microsoft.Azure.Insights">
61-
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.7.2-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.7.7-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
6262
</Reference>
6363
<Reference Include="Microsoft.Azure.ResourceManager">
6464
<SpecificVersion>False</SpecificVersion>
@@ -132,10 +132,10 @@
132132
<Compile Include="ScenarioTests\AlertsTests.cs" />
133133
<Compile Include="ScenarioTests\AutoscaleTests.cs" />
134134
<Compile Include="ScenarioTests\EventsTests.cs" />
135-
<Compile Include="ScenarioTests\MetricsTests.cs">
136-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
137-
</Compile>
135+
<Compile Include="ScenarioTests\MetricsTests.cs" />
138136
<Compile Include="ScenarioTests\TestsController.cs" />
137+
<Compile Include="ScenarioTests\UsageMetricsTests.cs" />
138+
<Compile Include="UsageMetrics\GetUsageMetricsCommandTests.cs" />
139139
<Compile Include="Utilities.cs" />
140140
</ItemGroup>
141141
<ItemGroup>
@@ -170,6 +170,9 @@
170170
<None Include="ScenarioTests\MetricsTests.ps1">
171171
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
172172
</None>
173+
<None Include="ScenarioTests\UsageMetricsTests.ps1">
174+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
175+
</None>
173176
<None Include="SessionRecords\Microsoft.Azure.Commands.Insights.Test.ScenarioTests.AlertsTests\TestAddAlertRule.json">
174177
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
175178
</None>
@@ -215,6 +218,9 @@
215218
<None Include="SessionRecords\Microsoft.Azure.Commands.Insights.Test.ScenarioTests.MetricsTests\TestGetMetricDefinitions.json">
216219
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
217220
</None>
221+
<None Include="SessionRecords\Microsoft.Azure.Commands.Insights.Test.ScenarioTests.UsageMetricsTests\TestGetUsageMetrics.json">
222+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
223+
</None>
218224
</ItemGroup>
219225
<ItemGroup>
220226
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.Insights.Test.ScenarioTests
19+
{
20+
public class UsageMetricsTests
21+
{
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void TestGetUsageMetrics()
25+
{
26+
TestsController.NewInstance.RunPsTest("Test-GetUsageMetrics");
27+
}
28+
}
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Tests getting usage metrics values for a particular resource.
18+
#>
19+
function Test-GetUsageMetrics
20+
{
21+
# Setup
22+
$rscname = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/garyyang1'
23+
24+
try
25+
{
26+
# Test
27+
# -timeGrain 00:01:00 -starttime 2015-03-23T15:00:00 -endtime 2015-03-23T15:30:00
28+
$actual = Get-UsageMetrics -ResourceId $rscname -star 2015-04-07T15:31:28.4590754-07:00 -end 2015-04-07T16:31:28.4590754-07:00
29+
30+
# Assert TODO add more asserts
31+
Assert-AreEqual 0 $actual.Count
32+
}
33+
finally
34+
{
35+
# Cleanup
36+
# No cleanup needed for now
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/%2Fsubscriptions%2Fa93fb07c-6c93-40be-bf3b-4f0deba10f4b%2FresourceGroups%2FDefault-Web-EastUS%2Fproviders%2Fmicrosoft.web%2Fsites%2Fgaryyang1/usages?api-version=2014-04-01&$filter=startTime%20eq%202015-04-07T15%3A31%3A28.4590754-07%3A00%20and%20endTime%20eq%202015-04-07T16%3A31%3A28.4590754-07%3A00",
5+
"RequestMethod": "GET",
6+
"RequestBody": "",
7+
"RequestHeaders": {
8+
"Accept": [ "application/json" ],
9+
"User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.15" ],
10+
"x-ms-version": [ "2014-04-01" ],
11+
"Connection": [ "Keep-Alive" ]
12+
},
13+
"ResponseBody": "{\"id\":null,\"name\":\"garyyang1\",\"type\":\"Microsoft.Web/sites\",\"kind\":null,\"location\":\"East US\",\"tags\":null,\"plan\":null,\"properties\":[{\"displayName\":\"CPU Time\",\"name\":\"CpuTime\",\"resourceName\":\"CpuTime\",\"unit\":\"Milliseconds\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Data In\",\"name\":\"BytesReceived\",\"resourceName\":\"BytesReceived\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Data Out\",\"name\":\"BytesSent\",\"resourceName\":\"BytesSent\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Local bytes read\",\"name\":\"LocalBytesRead\",\"resourceName\":\"LocalBytesRead\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Local bytes written\",\"name\":\"LocalBytesWritten\",\"resourceName\":\"LocalBytesWritten\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Network bytes read\",\"name\":\"NetworkBytesRead\",\"resourceName\":\"NetworkBytesRead\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Network bytes written\",\"name\":\"NetworkBytesWritten\",\"resourceName\":\"NetworkBytesWritten\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"WP stop requests\",\"name\":\"WPStopRequests\",\"resourceName\":\"WPStopRequests\",\"unit\":\"Count\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Memory Usage\",\"name\":\"MaxMemoryWorkingSetShortPeriod\",\"resourceName\":\"MaxMemoryWorkingSet\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"CPU Time - Minute Limit\",\"name\":\"CpuTimeShortPeriod\",\"resourceName\":\"CpuTime\",\"unit\":\"Milliseconds\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-07T23:36:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"File System Storage\",\"name\":\"FileSystemStorage\",\"resourceName\":\"FileSystemStorage\",\"unit\":\"Bytes\",\"currentValue\":756736,\"limit\":53687091200,\"nextResetTime\":\"9999-12-31T23:59:59.9999999Z\",\"computeMode\":1,\"siteMode\":null}]}",
14+
"ResponseHeaders": {
15+
"Cache-Control": [ "no-cache" ],
16+
"Date": [ "Tue, 07 Apr 2015 23:31:33 GMT" ],
17+
"Expires": [ "-1" ],
18+
"Pragma": [ "no-cache" ],
19+
"Content-Length": [ "2421" ],
20+
"Content-Type": [ "application/json; charset=utf-8" ],
21+
"x-ms-ratelimit-remaining-subscription-reads": [ "31999" ],
22+
"x-ms-request-id": [ "63575ceb-f8d2-4a28-a571-edc783166245" ],
23+
"x-ms-correlation-request-id": [ "4e8d2e93-0895-4cf1-aa40-5af880c3fb52" ],
24+
"x-ms-routing-request-id": [ "WESTUS:20150323T205747Z:4e8d2e93-0895-4cf1-aa40-5af880c3fb52" ],
25+
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ]
26+
},
27+
"StatusCode": 200
28+
},
29+
{
30+
"RequestUri": "/%2Fsubscriptions%2Fa93fb07c-6c93-40be-bf3b-4f0deba10f4b%2FresourceGroups%2FDefault-Web-EastUS%2Fproviders%2Fmicrosoft.web%2Fsites%2Fgaryyang1/usages?api-version=2014-04-01&$filter=",
31+
"RequestMethod": "GET",
32+
"RequestBody": "",
33+
"RequestHeaders": {
34+
"Accept": [ "application/json" ],
35+
"User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.15" ],
36+
"x-ms-version": [ "2014-04-01" ]
37+
},
38+
"ResponseBody": "{\"id\":null,\"name\":\"garyyang1\",\"type\":\"Microsoft.Web/sites\",\"kind\":null,\"location\":\"East US\",\"tags\":null,\"plan\":null,\"properties\":[{\"displayName\":\"CPU Time\",\"name\":\"CpuTime\",\"resourceName\":\"CpuTime\",\"unit\":\"Milliseconds\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Data In\",\"name\":\"BytesReceived\",\"resourceName\":\"BytesReceived\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Data Out\",\"name\":\"BytesSent\",\"resourceName\":\"BytesSent\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Local bytes read\",\"name\":\"LocalBytesRead\",\"resourceName\":\"LocalBytesRead\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Local bytes written\",\"name\":\"LocalBytesWritten\",\"resourceName\":\"LocalBytesWritten\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Network bytes read\",\"name\":\"NetworkBytesRead\",\"resourceName\":\"NetworkBytesRead\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Network bytes written\",\"name\":\"NetworkBytesWritten\",\"resourceName\":\"NetworkBytesWritten\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"WP stop requests\",\"name\":\"WPStopRequests\",\"resourceName\":\"WPStopRequests\",\"unit\":\"Count\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"Memory Usage\",\"name\":\"MaxMemoryWorkingSetShortPeriod\",\"resourceName\":\"MaxMemoryWorkingSet\",\"unit\":\"Bytes\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-08T00:00:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"CPU Time - Minute Limit\",\"name\":\"CpuTimeShortPeriod\",\"resourceName\":\"CpuTime\",\"unit\":\"Milliseconds\",\"currentValue\":0,\"limit\":-1,\"nextResetTime\":\"2015-04-07T23:41:00\",\"computeMode\":1,\"siteMode\":null},{\"displayName\":\"File System Storage\",\"name\":\"FileSystemStorage\",\"resourceName\":\"FileSystemStorage\",\"unit\":\"Bytes\",\"currentValue\":756736,\"limit\":53687091200,\"nextResetTime\":\"9999-12-31T23:59:59.9999999Z\",\"computeMode\":1,\"siteMode\":null}]}",
39+
"ResponseHeaders": {
40+
"Cache-Control": [ "no-cache" ],
41+
"Date": [ "Tue, 07 Apr 2015 23:31:33 GMT" ],
42+
"Expires": [ "-1" ],
43+
"Pragma": [ "no-cache" ],
44+
"Vary": [ "Accept-Encoding" ],
45+
"Content-Length": [ "2421" ],
46+
"Content-Type": [ "application/json; charset=utf-8" ],
47+
"x-ms-ratelimit-remaining-subscription-reads": [ "31997" ],
48+
"x-ms-request-id": [ "8e430569-842a-4b86-a954-0fda5fe1576f" ],
49+
"x-ms-correlation-request-id": [ "095a4225-2fcb-4f72-87a8-0ea4e11bfb7a" ],
50+
"x-ms-routing-request-id": [ "WESTUS:20150323T223347Z:095a4225-2fcb-4f72-87a8-0ea4e11bfb7a" ],
51+
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ]
52+
},
53+
"StatusCode": 200
54+
}
55+
],
56+
"Names": {
57+
"Test-GetAzureCorrelationIdLog": [
58+
""
59+
]
60+
},
61+
"Variables": {
62+
"SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b"
63+
}
64+
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Management.Automation;
17+
using System.Threading;
18+
using System.Threading.Tasks;
19+
using Microsoft.Azure.Commands.Insights.UsageMetrics;
20+
using Microsoft.Azure.Insights;
21+
using Microsoft.Azure.Insights.Models;
22+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
23+
using Moq;
24+
using Xunit;
25+
26+
namespace Microsoft.Azure.Commands.Insights.Test.Metrics
27+
{
28+
public class GetUsageMetricsCommandTests
29+
{
30+
private readonly GetUsageMetricsCommand cmdlet;
31+
private readonly Mock<InsightsClient> insightsClientMock;
32+
private readonly Mock<IUsageMetricsOperations> insightsUsageMetricOperationsMock;
33+
private Mock<ICommandRuntime> commandRuntimeMock;
34+
private UsageMetricListResponse response;
35+
private string resourceId;
36+
private string filter;
37+
private string apiVersion;
38+
39+
public GetUsageMetricsCommandTests()
40+
{
41+
insightsUsageMetricOperationsMock = new Mock<IUsageMetricsOperations>();
42+
insightsClientMock = new Mock<InsightsClient>();
43+
commandRuntimeMock = new Mock<ICommandRuntime>();
44+
cmdlet = new GetUsageMetricsCommand()
45+
{
46+
CommandRuntime = commandRuntimeMock.Object,
47+
InsightsClient = insightsClientMock.Object
48+
};
49+
50+
response = Utilities.InitializeUsageMetricResponse();
51+
52+
insightsUsageMetricOperationsMock
53+
.Setup(f => f.ListAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
54+
.Returns(Task.FromResult<UsageMetricListResponse>(response))
55+
.Callback((string f, string s, string a, CancellationToken t) =>
56+
{
57+
resourceId = f;
58+
filter = s;
59+
apiVersion = a;
60+
});
61+
62+
insightsClientMock
63+
.SetupGet(f => f.UsageMetricOperations)
64+
.Returns(this.insightsUsageMetricOperationsMock.Object);
65+
}
66+
67+
private void CleanParamVariables()
68+
{
69+
resourceId = null;
70+
filter = null;
71+
apiVersion = null;
72+
}
73+
74+
[Fact]
75+
[Trait(Category.AcceptanceType, Category.CheckIn)]
76+
public void GetUsageMetricsCommandParametersProcessing()
77+
{
78+
// Testting defaults and required parameters
79+
cmdlet.ResourceId = Utilities.ResourceUri;
80+
81+
cmdlet.ExecuteCmdlet();
82+
Assert.True(filter != null && filter.Contains("startTime eq ") && filter.Contains(" and endTime eq "));
83+
Assert.Equal(Utilities.ResourceUri, resourceId);
84+
Assert.Equal(GetUsageMetricsCommand.DefaultApiVersion, apiVersion);
85+
86+
this.CleanParamVariables();
87+
var endDate = DateTime.Now.AddMinutes(-1);
88+
cmdlet.EndTime = endDate;
89+
90+
var startTime = endDate
91+
.Subtract(GetUsageMetricsCommand.DefaultTimeRange)
92+
.ToString("O");
93+
var endTime = endDate.ToString("O");
94+
var expected = "startTime eq " + startTime + " and endTime eq " + endTime;
95+
96+
// Remove the value assigned in the last execution
97+
cmdlet.StartTime = default(DateTime);
98+
99+
cmdlet.ExecuteCmdlet();
100+
Assert.Equal(expected, filter);
101+
Assert.Equal(Utilities.ResourceUri, resourceId);
102+
Assert.Equal(GetUsageMetricsCommand.DefaultApiVersion, apiVersion);
103+
104+
this.CleanParamVariables();
105+
cmdlet.StartTime = endDate
106+
.Subtract(GetUsageMetricsCommand.DefaultTimeRange)
107+
.Subtract(GetUsageMetricsCommand.DefaultTimeRange);
108+
startTime = cmdlet.StartTime.ToString("O");
109+
expected = "startTime eq " + startTime + " and endTime eq " + endTime;
110+
111+
cmdlet.ExecuteCmdlet();
112+
Assert.Equal(expected, filter);
113+
Assert.Equal(Utilities.ResourceUri, resourceId);
114+
Assert.Equal(GetUsageMetricsCommand.DefaultApiVersion, apiVersion);
115+
116+
// Testing with optional parameters
117+
this.CleanParamVariables();
118+
cmdlet.MetricNames = new[] {"n1", "n2"};
119+
expected = "(name.value eq 'n1' or name.value eq 'n2') and " + expected;
120+
121+
cmdlet.ExecuteCmdlet();
122+
Assert.Equal(expected, filter);
123+
Assert.Equal(Utilities.ResourceUri, resourceId);
124+
Assert.Equal(GetUsageMetricsCommand.DefaultApiVersion, apiVersion);
125+
126+
// Testing with another api version
127+
cmdlet.ApiVersion = "2015-01-01";
128+
cmdlet.ExecuteCmdlet();
129+
Assert.Equal(expected, filter);
130+
Assert.Equal(Utilities.ResourceUri, resourceId);
131+
Assert.Equal("2015-01-01", apiVersion);
132+
}
133+
}
134+
}

src/ResourceManager/Insights/Commands.Insights.Test/Utilities.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,19 @@ public static MetricDefinitionListResponse InitializeMetricDefinitionResponse()
157157
};
158158
}
159159

160+
public static UsageMetricListResponse InitializeUsageMetricResponse()
161+
{
162+
return new UsageMetricListResponse
163+
{
164+
UsageMetricCollection = new UsageMetricCollection
165+
{
166+
Value = new List<UsageMetric>()
167+
},
168+
RequestId = Guid.NewGuid().ToString(),
169+
StatusCode = HttpStatusCode.OK
170+
};
171+
}
172+
160173
public static void VerifyDetailedOutput(EventCmdletBase cmdlet, ref string selected)
161174
{
162175
// Calling with detailed output

0 commit comments

Comments
 (0)