Udostępnij za pośrednictwem


StorageTaskCollection.CreateOrUpdateAsync Method

Definition

Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already created and a subsequent create request is issued with different properties, the storage task properties will be updated. If a storage task is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}
  • Operation Id: StorageTasks_Create
  • Default Api Version: 2023-01-01
  • Resource: StorageTaskResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.StorageActions.StorageTaskResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string storageTaskName, Azure.ResourceManager.StorageActions.StorageTaskData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.StorageActions.StorageTaskData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.StorageActions.StorageTaskResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.StorageActions.StorageTaskData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.StorageActions.StorageTaskResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, storageTaskName As String, data As StorageTaskData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of StorageTaskResource))

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.

storageTaskName
String

The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.

data
StorageTaskData

The parameters to create a Storage Task.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

storageTaskName or data is null.

Applies to