Language

CostControlRule Class

Definition

A cost limit and the population to which it applies.

public class CostControlRule : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.CognitiveServices.Models.CostControlRule>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.CognitiveServices.Models.CostControlRule>
type CostControlRule = class
    interface IJsonModel<CostControlRule>
    interface IPersistableModel<CostControlRule>
Public Class CostControlRule
Implements IJsonModel(Of CostControlRule), IPersistableModel(Of CostControlRule)
Inheritance
CostControlRule
Implements

Constructors

Name Description
CostControlRule(String, CostControlDimension, CostControlUnit, Double)

Initializes a new instance of CostControlRule.

Properties

Name Description
Amount

The maximum consumption allowed by this rule, expressed in the selected unit.

CounterKey

Gets or sets the single built-in dimension used to partition consumption. Custom dimensions are retained only for legacy reads and metadata-only updates. Legacy singleton arrays are accepted on read; serialization always emits an object. To track another field, create another rule.

Match

Gets or sets optional match arrays keyed by agentResourceIds, identityObjectIds, sessionIds, or projectIds. Each array contains 1 to 20 non-empty values. Agent resource IDs use /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with their canonical key.

Name

The stable rule identifier, unique within the cost control without regard to case.

Period

Gets or sets the calendar-aligned UTC renewal period. Authored rules support Day, Week, or Month. This field is required for recurring rules and must be omitted for non-recurring rules. Legacy stored minute, hour, and year periods are preserved when reading definitions.

Recurring

Whether the cost control renews. The default is true.

Thresholds

Gets or sets optional thresholds. Omitted or empty thresholds track usage without explicit actions. Authored thresholds must explicitly specify Alert or Block; Audit is retained for legacy reads.

Unit

The unit used for the cost control amount and absolute thresholds.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<CostControlRule>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<CostControlRule>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<CostControlRule>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<CostControlRule>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<CostControlRule>.Write(ModelReaderWriterOptions)

Applies to