Property rule

Add-PropertyRule

Synopsis

Add a rule or setting to a property.

Syntax

Add-PropertyRule [-PropertyName] <String> [-PropertyVersion] <String> -Path <String> -Value <Object> [-VersionNotes <String>] [-RuleFormat <String>] [-UpgradeRules] [-OriginalInput] [-DryRun] [-ValidateMode <String>] [-ValidateRules] [-GroupID <String>] [-ContractId <String>] [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Add-PropertyRule -PropertyID <String> [-PropertyVersion] <String> -Path <String> -Value <Object> [-VersionNotes <String>] [-RuleFormat <String>] [-UpgradeRules] [-OriginalInput] [-DryRun] [-ValidateMode <String>] [-ValidateRules] [-GroupID <String>] [-ContractId <String>] [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

Adds a rule or setting to a property using JSON Patch syntax. This can be a single string or integer, up to an entire rule, including its children. To find the JSONPath rule path, commonly we recommend pairing this command with New-BulkSearch. The -PropertyVersion parameter is an integer or the word latest.

Parameters

‑AccountSwitchKey

An account credential key that lets you move between accounts when using an API client enabled for multiple accounts. To find account switch keys, use Get-AccountSwitchKey.

‑ContractId

Your contract's ID. The parameter is optional if a property belongs to only one contract; otherwise, you need to specify it along with the -GroupID. This parameter is optional except for the create requests.

‑DryRun

With the validateRules query parameter also enabled, allows for a dry run in order to gather any possible errors without saving the rule tree.

‑EdgeRCFile

Your EdgeGrid resource file to authenticate your command. Defaults to ~/.edgerc.

‑GroupID

Your group's ID. The parameter is optional if a property belongs to only one group, otherwise you need to specify it along with the -ContractID. This parameter is optional except for the create requests.

‑OriginalInput

When you include this switch, PAPI outputs a property's rule tree in the original form provided by the Set-PropertyRules operation, deliberately suppressing any updates. Also, PAPI still upgrades catalog features in the background every time you run GET-PropertyRules and patch them on property version rules, but the response shows the rule tree just as you last saved it.

When you don't include this switch, your original input can include the latest rule changes, such as new options with default values.

‑Path
Required

An absolute path from the top of the rule tree.

‑PropertyID
Conditionally required

Your property's ID. Commonly, you only need to specify either -PropertyName or -PropertyID.

‑PropertyName
Conditionally required

A human-readable name for your property. Commonly, you only need to specify either -PropertyName or -PropertyID.

‑PropertyVersion
Required

Property's incremental version number. Can be an integer or the word latest.

‑RuleFormat

The name of the rule format. The rule format can be frozen to a specific version, or represent the latest set of behaviors and criteria. You can retrieve rule formats with Get-RuleFormat.

‑Section

The section name in your EdgeGrid resource file to retrieve authentication credentials from. Defaults to default.

‑UpgradeRules

When this switch parameter is present, PAPI upgrades the input rule tree object to ensure backward compatibility. You can continuously use the latest rule format and keep working with your current rule tree without causing new validation errors as Akamai dynamically modifies catalog options. Upgrade applies renames, and transformations, fills in default values for new features, and removes extraneous options. New PAPI users have this set to true automatically. Otherwise, you can set the default value manually in your API client.

‑ValidateMode

With -ValidateRules enabled, setting this to fast performs a quick validation check based on the provided JSON. This is faster than the default full validation, which performs more extensive checks on the converted XML metadata configuration.

‑ValidateRules

When enabled, performs validation tests that would identify potential problems within the response object's errors and warnings arrays.

‑Value
Required

The value to apply to the PATCH operation. Can be as simple as a string or integer, or an entire rule tree, depending on the -Path provided.

‑VersionNotes

Notes to add to your property or include version. Note that you can also provide this information as the top-level "comments" object in the rule tree JSON, but if both are present, this parameter takes precedence.

Related Links