Share via


SnapshotCollection.CreateOrUpdate Method

Definition

Creates or updates a snapshot.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}
  • Operation Id: Snapshots_CreateOrUpdate
  • Default Api Version: 2024-03-02
  • Resource: SnapshotResource
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SnapshotResource> CreateOrUpdate (Azure.WaitUntil waitUntil, string snapshotName, Azure.ResourceManager.Compute.SnapshotData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Compute.SnapshotData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SnapshotResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Compute.SnapshotData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SnapshotResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, snapshotName As String, data As SnapshotData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of SnapshotResource)

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

snapshotName
String

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

data
SnapshotData

Snapshot object supplied in the body of the Put disk operation.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

snapshotName is an empty string, and was expected to be non-empty.

snapshotName or data is null.

Applies to