共用方式為


GovernanceRuleData Class

Definition

A class representing the GovernanceRule data model. Governance rule over a given scope

public class GovernanceRuleData : Azure.ResourceManager.Models.ResourceData
public class GovernanceRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.SecurityCenter.GovernanceRuleData>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.SecurityCenter.GovernanceRuleData>
type GovernanceRuleData = class
    inherit ResourceData
type GovernanceRuleData = class
    inherit ResourceData
    interface IJsonModel<GovernanceRuleData>
    interface IPersistableModel<GovernanceRuleData>
Public Class GovernanceRuleData
Inherits ResourceData
Public Class GovernanceRuleData
Inherits ResourceData
Implements IJsonModel(Of GovernanceRuleData), IPersistableModel(Of GovernanceRuleData)
Inheritance
GovernanceRuleData
Implements

Constructors

GovernanceRuleData()

Initializes a new instance of GovernanceRuleData.

Properties

ConditionSets

The governance rule conditionSets - see examples

To assign an object to the element of this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"): Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""): Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }): Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"): Creates a payload of { "key": "value" }.

Description

Description of the governance rule.

DisplayName

Display name of the governance rule.

ExcludedScopes

Excluded scopes, filter out the descendants of the scope (on management scopes).

GovernanceEmailNotification

The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners.

Id

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

(Inherited from ResourceData)
IncludeMemberScopes

Defines whether the rule is management scope rule (master connector as a single scope or management scope).

IsDisabled

Defines whether the rule is active/inactive.

IsGracePeriod

Defines whether there is a grace period on the governance rule.

Metadata

The governance rule metadata.

Name

The name of the resource.

(Inherited from ResourceData)
OwnerSource

The owner source for the governance rule - e.g. Manually by user@contoso.com - see example.

RemediationTimeframe

Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days.

ResourceType

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

(Inherited from ResourceData)
RulePriority

The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed.

RuleType

The rule type of the governance rule, defines the source of the rule e.g. Integrated.

SourceResourceType

The governance rule source, what the rule affects, e.g. Assessments.

SystemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

(Inherited from ResourceData)
TenantId

The tenantId (GUID).

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions) (Inherited from ResourceData)

Explicit Interface Implementations

IJsonModel<GovernanceRuleData>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<GovernanceRuleData>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<GovernanceRuleData>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<GovernanceRuleData>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<GovernanceRuleData>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to