public async virtual Task <Response <VirtualMachineScaleSetVirtualMachineRunCommand> > GetAsync(string runCommandName, string expand = null, CancellationToken cancellationToken = default) { if (runCommandName == null) { throw new ArgumentNullException(nameof(runCommandName)); } using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVirtualMachineRunCommandCollection.Get"); scope.Start(); try { var response = await _virtualMachineScaleSetVMRunCommandsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runCommandName, expand, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new VirtualMachineScaleSetVirtualMachineRunCommand(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <Response <VirtualMachineRunCommandVirtualMachineScaleSetVM> > GetAsync(string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineRunCommandVirtualMachineScaleSetVM.Get"); scope.Start(); try { var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, expand, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new VirtualMachineRunCommandVirtualMachineScaleSetVM(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }