Share via


ContainerRegistryCacheRuleCollection.CreateOrUpdateAsync Method

Definition

Creates a cache rule for a container registry with the specified parameters.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}
  • Operation Id: CacheRules_Create
  • Default Api Version: 2024-11-01-preview
  • Resource: ContainerRegistryCacheRuleResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource>> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheRuleName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, cacheRuleName As String, data As ContainerRegistryCacheRuleData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of ContainerRegistryCacheRuleResource))

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.

cacheRuleName
String

The name of the cache rule.

data
ContainerRegistryCacheRuleData

The parameters for creating a cache rule.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

cacheRuleName or data is null.

Applies to