Skip to content

Commit 011e912

Browse files
nanditaashok-msNoriZCvidai-msft
authored
Adding new cmdlet to retrieve NVA boot diagnostics (#27060)
* Adding new cmdlet to retrieve NVA boot diagnostics * fix typo and add test recording * add help files * update test * Add online version link to documentation * resolve generated sdk issue * Fix bicep template issue due to bicep version upgrade (#27096) * update test case * remove secrets --------- Co-authored-by: NoriZC <[email protected]> Co-authored-by: Nori Zhang <[email protected]> Co-authored-by: Vincent Dai <[email protected]>
1 parent 22f14b9 commit 011e912

File tree

17 files changed

+1256
-58
lines changed

17 files changed

+1256
-58
lines changed

src/Accounts/Accounts/Utilities/CommandMappings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4754,6 +4754,7 @@
47544754
"Get-AzNetworkServiceTag": {},
47554755
"Get-AzNetworkUsage": {},
47564756
"Get-AzNetworkVirtualAppliance": {},
4757+
"Get-AzNetworkVirtualApplianceBootDiagnostics": {},
47574758
"Get-AzNetworkVirtualApplianceConnection": {},
47584759
"Get-AzNetworkVirtualApplianceSku": {},
47594760
"Get-AzNetworkWatcher": {},

src/Network/Network.Management.Sdk/Generated/INetworkVirtualAppliancesOperations.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ public partial interface INetworkVirtualAppliancesOperations
199199
/// <param name='networkVirtualApplianceName'>
200200
/// The name of Network Virtual Appliance.
201201
/// </param>
202-
/// <param name='instanceId'>
203-
/// Specifies a virtual machine instance ID from the Network Virtual Appliance
204-
/// VM instances.
202+
/// <param name='request'>
203+
/// Parameters supplied to retrieve boot diagnostic logs for a NVA VM instance
205204
/// </param>
206205
/// <param name='customHeaders'>
207206
/// The headers that will be added to request.
@@ -215,7 +214,7 @@ public partial interface INetworkVirtualAppliancesOperations
215214
/// <exception cref="Microsoft.Rest.SerializationException">
216215
/// Thrown when unable to deserialize the response
217216
/// </exception>
218-
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> GetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters instanceId = default(NetworkVirtualApplianceBootDiagnosticParameters), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
217+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> GetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters request, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
219218

220219
/// <summary>
221220
/// Lists all Network Virtual Appliances in a resource group.
@@ -388,9 +387,8 @@ public partial interface INetworkVirtualAppliancesOperations
388387
/// <param name='networkVirtualApplianceName'>
389388
/// The name of Network Virtual Appliance.
390389
/// </param>
391-
/// <param name='instanceId'>
392-
/// Specifies a virtual machine instance ID from the Network Virtual Appliance
393-
/// VM instances.
390+
/// <param name='request'>
391+
/// Parameters supplied to retrieve boot diagnostic logs for a NVA VM instance
394392
/// </param>
395393
/// <param name='customHeaders'>
396394
/// The headers that will be added to request.
@@ -404,7 +402,7 @@ public partial interface INetworkVirtualAppliancesOperations
404402
/// <exception cref="Microsoft.Rest.SerializationException">
405403
/// Thrown when unable to deserialize the response
406404
/// </exception>
407-
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> BeginGetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters instanceId = default(NetworkVirtualApplianceBootDiagnosticParameters), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
405+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> BeginGetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters request, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
408406

409407
/// <summary>
410408
/// Lists all Network Virtual Appliances in a resource group.

src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperations.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,9 @@ internal LoadBalancerLoadBalancingRulesOperations (NetworkManagementClient clien
538538
}
539539
if (groupName != null)
540540
{
541-
if (!System.Text.RegularExpressions.Regex.IsMatch(groupName, "^[a-z][a-z0-9]*$"))
541+
if (!System.Text.RegularExpressions.Regex.IsMatch(groupName, "^[a-zA-Z0-9_.-]*$"))
542542
{
543-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "groupName", "^[a-z][a-z0-9]*$");
543+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "groupName", "^[a-zA-Z0-9_.-]*$");
544544
}
545545
}
546546
if (loadBalancerName == null)
@@ -549,9 +549,9 @@ internal LoadBalancerLoadBalancingRulesOperations (NetworkManagementClient clien
549549
}
550550
if (loadBalancerName != null)
551551
{
552-
if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancerName, "^[a-z][a-z0-9]*$"))
552+
if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancerName, "^[a-zA-Z0-9_.-]*$"))
553553
{
554-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "loadBalancerName", "^[a-z][a-z0-9]*$");
554+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "loadBalancerName", "^[a-zA-Z0-9_.-]*$");
555555
}
556556
}
557557
if (loadBalancingRuleName == null)
@@ -560,9 +560,9 @@ internal LoadBalancerLoadBalancingRulesOperations (NetworkManagementClient clien
560560
}
561561
if (loadBalancingRuleName != null)
562562
{
563-
if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancingRuleName, "^[a-z][a-z0-9]*$"))
563+
if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancingRuleName, "^[a-zA-Z0-9_.-]*$"))
564564
{
565-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "loadBalancingRuleName", "^[a-z][a-z0-9]*$");
565+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "loadBalancingRuleName", "^[a-zA-Z0-9_.-]*$");
566566
}
567567
}
568568
if (this.Client.SubscriptionId == null)

src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerHealthPerRulePerBackendAddress.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public LoadBalancerHealthPerRulePerBackendAddress()
2727
/// <param name="ipAddress">The IP address belonging to the backend address.
2828
/// </param>
2929

30-
/// <param name="networkInterfaceIPConfigurationId">The id of the network interface ip configuration belonging to the backend
31-
/// address
30+
/// <param name="networkInterfaceIPConfigurationId">Resource ID of the Network Interface IP Configuration.
3231
/// </param>
3332

3433
/// <param name="state">The current health of the backend instances that is associated to the LB
@@ -37,7 +36,7 @@ public LoadBalancerHealthPerRulePerBackendAddress()
3736

3837
/// <param name="reason">The explanation of the State
3938
/// </param>
40-
public LoadBalancerHealthPerRulePerBackendAddress(string ipAddress = default(string), NetworkInterfaceIPConfiguration networkInterfaceIPConfigurationId = default(NetworkInterfaceIPConfiguration), string state = default(string), string reason = default(string))
39+
public LoadBalancerHealthPerRulePerBackendAddress(string ipAddress = default(string), string networkInterfaceIPConfigurationId = default(string), string state = default(string), string reason = default(string))
4140

4241
{
4342
this.IPAddress = ipAddress;
@@ -60,11 +59,10 @@ public LoadBalancerHealthPerRulePerBackendAddress()
6059
public string IPAddress {get; set; }
6160

6261
/// <summary>
63-
/// Gets or sets the id of the network interface ip configuration belonging to
64-
/// the backend address
62+
/// Gets or sets resource ID of the Network Interface IP Configuration.
6563
/// </summary>
6664
[Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceIPConfigurationId")]
67-
public NetworkInterfaceIPConfiguration NetworkInterfaceIPConfigurationId {get; set; }
65+
public string NetworkInterfaceIPConfigurationId {get; set; }
6866

6967
/// <summary>
7068
/// Gets or sets the current health of the backend instances that is associated
@@ -78,21 +76,5 @@ public LoadBalancerHealthPerRulePerBackendAddress()
7876
/// </summary>
7977
[Newtonsoft.Json.JsonProperty(PropertyName = "reason")]
8078
public string Reason {get; set; }
81-
/// <summary>
82-
/// Validate the object.
83-
/// </summary>
84-
/// <exception cref="Microsoft.Rest.ValidationException">
85-
/// Thrown if validation fails
86-
/// </exception>
87-
public virtual void Validate()
88-
{
89-
90-
if (this.NetworkInterfaceIPConfigurationId != null)
91-
{
92-
this.NetworkInterfaceIPConfigurationId.Validate();
93-
}
94-
95-
96-
}
9779
}
9880
}

src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperations.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -591,20 +591,19 @@ internal NetworkVirtualAppliancesOperations (NetworkManagementClient client)
591591
/// <param name='networkVirtualApplianceName'>
592592
/// The name of Network Virtual Appliance.
593593
/// </param>
594-
/// <param name='instanceId'>
595-
/// Specifies a virtual machine instance ID from the Network Virtual Appliance
596-
/// VM instances.
594+
/// <param name='request'>
595+
/// Parameters supplied to retrieve boot diagnostic logs for a NVA VM instance
597596
/// </param>
598597
/// <param name='customHeaders'>
599598
/// Headers that will be added to request.
600599
/// </param>
601600
/// <param name='cancellationToken'>
602601
/// The cancellation token.
603602
/// </param>
604-
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> GetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters instanceId = default(NetworkVirtualApplianceBootDiagnosticParameters), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
603+
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> GetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters request, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
605604
{
606605
// Send Request
607-
Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders> _response = await BeginGetBootDiagnosticLogsWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false);
606+
Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders> _response = await BeginGetBootDiagnosticLogsWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, request, customHeaders, cancellationToken).ConfigureAwait(false);
608607
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
609608
}
610609

@@ -1946,9 +1945,8 @@ internal NetworkVirtualAppliancesOperations (NetworkManagementClient client)
19461945
/// <param name='networkVirtualApplianceName'>
19471946
/// The name of Network Virtual Appliance.
19481947
/// </param>
1949-
/// <param name='instanceId'>
1950-
/// Specifies a virtual machine instance ID from the Network Virtual Appliance
1951-
/// VM instances.
1948+
/// <param name='request'>
1949+
/// Parameters supplied to retrieve boot diagnostic logs for a NVA VM instance
19521950
/// </param>
19531951
/// <param name='customHeaders'>
19541952
/// Headers that will be added to request.
@@ -1971,12 +1969,16 @@ internal NetworkVirtualAppliancesOperations (NetworkManagementClient client)
19711969
/// <return>
19721970
/// A response object containing the response body and response headers.
19731971
/// </return>
1974-
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> BeginGetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters instanceId = default(NetworkVirtualApplianceBootDiagnosticParameters), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
1972+
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<NetworkVirtualApplianceInstanceId,NetworkVirtualAppliancesGetBootDiagnosticLogsHeaders>> BeginGetBootDiagnosticLogsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualApplianceBootDiagnosticParameters request, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
19751973
{
19761974

19771975

19781976

19791977

1978+
if (request == null)
1979+
{
1980+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request");
1981+
}
19801982

19811983
if (resourceGroupName == null)
19821984
{
@@ -2011,7 +2013,7 @@ internal NetworkVirtualAppliancesOperations (NetworkManagementClient client)
20112013
tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName);
20122014
tracingParameters.Add("apiVersion", apiVersion);
20132015

2014-
tracingParameters.Add("instanceId", instanceId);
2016+
tracingParameters.Add("request", request);
20152017

20162018
tracingParameters.Add("cancellationToken", cancellationToken);
20172019
Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetBootDiagnosticLogs", tracingParameters);
@@ -2065,9 +2067,9 @@ internal NetworkVirtualAppliancesOperations (NetworkManagementClient client)
20652067
}
20662068
// Serialize Request
20672069
string _requestContent = null;
2068-
if(instanceId != null)
2070+
if(request != null)
20692071
{
2070-
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(instanceId, this.Client.SerializationSettings);
2072+
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings);
20712073
_httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
20722074
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
20732075
}

0 commit comments

Comments
 (0)