public virtual async Task <ArmOperation <VirtualMachineScaleSetVmResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string instanceId, VirtualMachineScaleSetVmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(instanceId, nameof(instanceId)); Argument.AssertNotNull(data, nameof(data)); using var scope = _virtualMachineScaleSetVmVirtualMachineScaleSetVMsClientDiagnostics.CreateScope("VirtualMachineScaleSetVmCollection.CreateOrUpdate"); scope.Start(); try { var response = await _virtualMachineScaleSetVmVirtualMachineScaleSetVMsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, instanceId, data, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <VirtualMachineScaleSetVmResource>(new VirtualMachineScaleSetVmOperationSource(Client), _virtualMachineScaleSetVmVirtualMachineScaleSetVMsClientDiagnostics, Pipeline, _virtualMachineScaleSetVmVirtualMachineScaleSetVMsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, instanceId, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <VirtualMachineExtension> > CreateOrUpdateAsync(WaitUntil waitUntil, string vmExtensionName, VirtualMachineExtensionData extensionParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vmExtensionName, nameof(vmExtensionName)); Argument.AssertNotNull(extensionParameters, nameof(extensionParameters)); using var scope = _virtualMachineExtensionClientDiagnostics.CreateScope("VirtualMachineExtensionCollection.CreateOrUpdate"); scope.Start(); try { var response = await _virtualMachineExtensionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmExtensionName, extensionParameters, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <VirtualMachineExtension>(new VirtualMachineExtensionOperationSource(Client), _virtualMachineExtensionClientDiagnostics, Pipeline, _virtualMachineExtensionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmExtensionName, extensionParameters).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <AvailabilitySetResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string availabilitySetName, AvailabilitySetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(availabilitySetName, nameof(availabilitySetName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _availabilitySetClientDiagnostics.CreateScope("AvailabilitySetCollection.CreateOrUpdate"); scope.Start(); try { var response = await _availabilitySetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, availabilitySetName, data, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <AvailabilitySetResource>(Response.FromValue(new AvailabilitySetResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ArmOperation <GalleryApplication> > CreateOrUpdateAsync(bool waitForCompletion, string galleryApplicationName, GalleryApplicationData galleryApplication, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(galleryApplicationName, nameof(galleryApplicationName)); Argument.AssertNotNull(galleryApplication, nameof(galleryApplication)); using var scope = _galleryApplicationClientDiagnostics.CreateScope("GalleryApplicationCollection.CreateOrUpdate"); scope.Start(); try { var response = await _galleryApplicationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, galleryApplicationName, galleryApplication, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <GalleryApplication>(new GalleryApplicationOperationSource(Client), _galleryApplicationClientDiagnostics, Pipeline, _galleryApplicationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, galleryApplicationName, galleryApplication).Request, response, OperationFinalStateVia.Location); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ArmOperation <DiskAccess> > CreateOrUpdateAsync(bool waitForCompletion, string diskAccessName, DiskAccessData diskAccess, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(diskAccessName, nameof(diskAccessName)); Argument.AssertNotNull(diskAccess, nameof(diskAccess)); using var scope = _diskAccessClientDiagnostics.CreateScope("DiskAccessCollection.CreateOrUpdate"); scope.Start(); try { var response = await _diskAccessRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, diskAccessName, diskAccess, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <DiskAccess>(new DiskAccessOperationSource(Client), _diskAccessClientDiagnostics, Pipeline, _diskAccessRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, diskAccessName, diskAccess).Request, response, OperationFinalStateVia.Location); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <SshPublicKey> > CreateOrUpdateAsync(WaitUntil waitUntil, string sshPublicKeyName, SshPublicKeyData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(sshPublicKeyName, nameof(sshPublicKeyName)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _sshPublicKeyClientDiagnostics.CreateScope("SshPublicKeyCollection.CreateOrUpdate"); scope.Start(); try { var response = await _sshPublicKeyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, sshPublicKeyName, parameters, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <SshPublicKey>(Response.FromValue(new SshPublicKey(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ArmOperation <DedicatedHostGroup> > CreateOrUpdateAsync(bool waitForCompletion, string hostGroupName, DedicatedHostGroupData parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(hostGroupName, nameof(hostGroupName)); Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _dedicatedHostGroupClientDiagnostics.CreateScope("DedicatedHostGroupCollection.CreateOrUpdate"); scope.Start(); try { var response = await _dedicatedHostGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, hostGroupName, parameters, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <DedicatedHostGroup>(Response.FromValue(new DedicatedHostGroup(Client, response), response.GetRawResponse())); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <ManagedDiskResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string diskName, ManagedDiskData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(diskName, nameof(diskName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _managedDiskDisksClientDiagnostics.CreateScope("ManagedDiskCollection.CreateOrUpdate"); scope.Start(); try { var response = await _managedDiskDisksRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, diskName, data, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <ManagedDiskResource>(new ManagedDiskOperationSource(Client), _managedDiskDisksClientDiagnostics, Pipeline, _managedDiskDisksRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, diskName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <PrivateEndpointConnection> > CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, PrivateEndpointConnectionData privateEndpointConnection, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); Argument.AssertNotNull(privateEndpointConnection, nameof(privateEndpointConnection)); using var scope = _privateEndpointConnectionDiskAccessesClientDiagnostics.CreateScope("PrivateEndpointConnectionCollection.CreateOrUpdate"); scope.Start(); try { var response = await _privateEndpointConnectionDiskAccessesRestClient.UpdateAPrivateEndpointConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, privateEndpointConnection, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <PrivateEndpointConnection>(new PrivateEndpointConnectionOperationSource(Client), _privateEndpointConnectionDiskAccessesClientDiagnostics, Pipeline, _privateEndpointConnectionDiskAccessesRestClient.CreateUpdateAPrivateEndpointConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, privateEndpointConnection).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ArmOperation <VirtualMachineScaleSetVirtualMachineRunCommand> > CreateOrUpdateAsync(bool waitForCompletion, string runCommandName, VirtualMachineRunCommandData runCommand, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); Argument.AssertNotNull(runCommand, nameof(runCommand)); using var scope = _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsClientDiagnostics.CreateScope("VirtualMachineScaleSetVirtualMachineRunCommandCollection.CreateOrUpdate"); scope.Start(); try { var response = await _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runCommandName, runCommand, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <VirtualMachineScaleSetVirtualMachineRunCommand>(new VirtualMachineScaleSetVirtualMachineRunCommandOperationSource(Client), _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsClientDiagnostics, Pipeline, _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runCommandName, runCommand).Request, response, OperationFinalStateVia.Location); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <Snapshot> > CreateOrUpdateAsync(WaitUntil waitUntil, string snapshotName, SnapshotData snapshot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); Argument.AssertNotNull(snapshot, nameof(snapshot)); using var scope = _snapshotClientDiagnostics.CreateScope("SnapshotCollection.CreateOrUpdate"); scope.Start(); try { var response = await _snapshotRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, snapshotName, snapshot, cancellationToken).ConfigureAwait(false); var operation = new ComputeArmOperation <Snapshot>(new SnapshotOperationSource(Client), _snapshotClientDiagnostics, Pipeline, _snapshotRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, snapshotName, snapshot).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }