Share via


DataCollectionRuleCollection.CreateOrUpdate Method

Definition

Creates or updates a data collection rule.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}
  • Operation Id: DataCollectionRules_Create
  • Default Api Version: 2022-06-01
  • Resource: DataCollectionRuleResource
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource> CreateOrUpdate (Azure.WaitUntil waitUntil, string dataCollectionRuleName, Azure.ResourceManager.Monitor.DataCollectionRuleData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.DataCollectionRuleData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.DataCollectionRuleData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.DataCollectionRuleResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, dataCollectionRuleName As String, data As DataCollectionRuleData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of DataCollectionRuleResource)

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.

dataCollectionRuleName
String

The name of the data collection rule. The name is case insensitive.

data
DataCollectionRuleData

The payload.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

dataCollectionRuleName or data is null.

Applies to