Skip to content

Commit b792cdf

Browse files
authored
Merge pull request #232484 from dlepow/pol3
[APIM] Policy expression support in policies - 3
2 parents a5dec34 + d2b7d80 commit b792cdf

9 files changed

+37
-36
lines changed

articles/api-management/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@
452452
href: invoke-dapr-binding-policy.md
453453
- name: ip-filter
454454
href: ip-filter-policy.md
455+
- name: jsonp
456+
href: jsonp-policy.md
455457
- name: json-to-xml
456458
href: json-to-xml-policy.md
457459
- name: limit-concurrency

articles/api-management/json-to-xml-policy.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ The `json-to-xml` policy converts a request or response body from JSON to XML.
3131

3232
| Attribute | Description | Required | Default |
3333
| ----------------- | ------------------------------------------------------ | -------- | ------- |
34-
|apply|The attribute must be set to one of the following values.<br /><br /> - `always` - always apply conversion.<br />- `content-type-json` - convert only if response Content-Type header indicates presence of JSON.|Yes|N/A|
35-
|consider-accept-header|The attribute must be set to one of the following values.<br /><br /> - `true` - apply conversion if XML is requested in request Accept header.<br />- `false` - always apply conversion.|No|`true`|
36-
|parse-date|When set to `false` date values are simply copied during transformation.|No|`true`|
37-
|namespace-separator|The character to use as a namespace separator.|No|Underscore|
38-
|namespace-prefix|The string that identifies property as namespace attribute, usually "xmlns". Properties with names beginning with specified prefix will be added to current element as namespace declarations.|No|N/A|
39-
|attribute-block-name|When set, properties inside the named object will be added to the element as attributes|No|Not set|
34+
|apply|The attribute must be set to one of the following values.<br /><br /> - `always` - always apply conversion.<br />- `content-type-json` - convert only if response Content-Type header indicates presence of JSON.<br/><br/>Policy expressions are allowed.|Yes|N/A|
35+
|consider-accept-header|The attribute must be set to one of the following values.<br /><br /> - `true` - apply conversion if XML is requested in request Accept header.<br />- `false` - always apply conversion.<br/><br/>Policy expressions are allowed.|No|`true`|
36+
|parse-date|When set to `false` date values are simply copied during transformation. Policy expressions aren't allowed.|No|`true`|
37+
|namespace-separator|The character to use as a namespace separator. Policy expressions are allowed.|No|Underscore|
38+
|namespace-prefix|The string that identifies property as namespace attribute, usually "xmlns". Properties with names beginning with specified prefix will be added to current element as namespace declarations. Policy expressions are allowed.|No|N/A|
39+
|attribute-block-name|When set, properties inside the named object will be added to the element as attributes. Policy expressions are allowed.|No|Not set|
4040

4141
## Usage
4242

articles/api-management/jsonp-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The `jsonp` policy adds JSON with padding (JSONP) support to an operation or an
2626

2727
|Name|Description|Required|Default|
2828
|----------|-----------------|--------------|-------------|
29-
|callback-parameter-name|The cross-domain JavaScript function call prefixed with the fully qualified domain name where the function resides.|Yes|N/A|
29+
|callback-parameter-name|The cross-domain JavaScript function call prefixed with the fully qualified domain name where the function resides. Policy expressions are allowed.|Yes|N/A|
3030

3131
## Usage
3232

articles/api-management/limit-concurrency-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The `limit-concurrency` policy prevents enclosed policies from executing by more
2828

2929
| Attribute | Description | Required | Default |
3030
| --------- | -------------------------------------------------------------------------------------------------- | -------- | ------- |
31-
| key | A string. Policy expression allowed. Specifies the concurrency scope. Can be shared by multiple policies. | Yes | N/A |
32-
| max-count | An integer. Specifies a maximum number of requests that are allowed to enter the policy. | Yes | N/A |
31+
| key | A string. Specifies the concurrency scope. Can be shared by multiple policies. Policy expressions are allowed. | Yes | N/A |
32+
| max-count | An integer. Specifies a maximum number of requests that are allowed to enter the policy. Policy expressions aren't allowed. | Yes | N/A |
3333

3434

3535
## Usage

articles/api-management/log-to-eventhub-policy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The `log-to-eventhub` policy sends messages in the specified format to an event
3232

3333
| Attribute | Description | Required | Default |
3434
| ------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------- | ----|
35-
| logger-id | The ID of the Logger registered with your API Management service. | Yes | N/A |
36-
| partition-id | Specifies the index of the partition where messages are sent. | Optional. Do not use if `partition-key` is used. | N/A |
37-
| partition-key | Specifies the value used for partition assignment when messages are sent. | Optional. Do not use if `partition-id` is used. | N/A |
35+
| logger-id | The ID of the Logger registered with your API Management service. Policy expressions aren't allowed. | Yes | N/A |
36+
| partition-id | Specifies the index of the partition where messages are sent. Policy expressions aren't allowed. | Optional. Do not use if `partition-key` is used. | N/A |
37+
| partition-key | Specifies the value used for partition assignment when messages are sent. Policy expressions are allowed. | Optional. Do not use if `partition-id` is used. | N/A |
3838

3939
## Usage
4040

articles/api-management/mock-response-policy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: danlep
1212

1313
# Mock response
1414

15-
The `mock-response` policy, as the name implies, is used to mock APIs and operations. It cancels normal pipeline execution and returns a mocked response to the caller. The policy always tries to return responses of highest fidelity. It prefers response content examples, when available. It generates sample responses from schemas, when schemas are provided and examples are not. If neither examples or schemas are found, responses with no content are returned.
15+
The `mock-response` policy, as the name implies, is used to mock APIs and operations. It cancels normal pipeline execution and returns a mocked response to the caller. The policy always tries to return responses of highest fidelity. It prefers response content examples, when available. It generates sample responses from schemas, when schemas are provided and examples aren't. If neither examples or schemas are found, responses with no content are returned.
1616

1717
[!INCLUDE [api-management-policy-generic-alert](../../includes/api-management-policy-generic-alert.md)]
1818

@@ -27,8 +27,8 @@ The `mock-response` policy, as the name implies, is used to mock APIs and operat
2727

2828
| Attribute | Description | Required | Default |
2929
| ------------ | ----------------------------------------------------------------------------------------------------- | -------- | ------- |
30-
| status-code | Specifies response status code and is used to select corresponding example or schema. | No | 200 |
31-
| content-type | Specifies `Content-Type` response header value and is used to select corresponding example or schema. | No | None |
30+
| status-code | Specifies response status code and is used to select corresponding example or schema. Policy expressions aren't allowed. | No | 200 |
31+
| content-type | Specifies `Content-Type` response header value and is used to select corresponding example or schema. Policy expressions aren't allowed. | No | None |
3232

3333
## Usage
3434

articles/api-management/proxy-policy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The `proxy` policy allows you to route requests forwarded to backends via an HTT
2727

2828
| Attribute | Description | Required | Default |
2929
| ----------------- | ------------------------------------------------------ | -------- | ------- |
30-
| url | Proxy URL in the form of `http://host:port`. | Yes | N/A |
31-
| username | Username to be used for authentication with the proxy. | No | N/A |
32-
| password | Password to be used for authentication with the proxy. | No | N/A |
30+
| url | Proxy URL in the form of `http://host:port`. Policy expressions are allowed. | Yes | N/A |
31+
| username | Username to be used for authentication with the proxy. Policy expressions are allowed. | No | N/A |
32+
| password | Password to be used for authentication with the proxy. Policy expressions are allowed. | No | N/A |
3333

3434
## Usage
3535

articles/api-management/publish-to-dapr-policy.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ The policy assumes that Dapr runtime is running in a sidecar container in the sa
3131

3232
| Attribute | Description | Required | Default |
3333
|------------------|---------------------------------|----------|---------|
34-
| pubsub-name | The name of the target PubSub component. Maps to the [pubsubname](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/pubsub_api.md) parameter in Dapr. If not present, the `topic` attribute value must be in the form of `pubsub-name/topic-name`. | No | None |
35-
| topic | The name of the topic. Maps to the [topic](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/pubsub_api.md) parameter in Dapr. | Yes | N/A |
36-
| ignore-error | If set to `true`, instructs the policy not to trigger ["on-error"](api-management-error-handling-policies.md) section upon receiving error from Dapr runtime. | No | `false` |
37-
| response-variable-name | Name of the [Variables](api-management-policy-expressions.md#ContextVariables) collection entry to use for storing response from Dapr runtime. | No | None |
38-
| timeout | Time (in seconds) to wait for Dapr runtime to respond. Can range from 1 to 240 seconds. | No | 5 |
34+
| pubsub-name | The name of the target PubSub component. Maps to the [pubsubname](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/pubsub_api.md) parameter in Dapr. If not present, the `topic` attribute value must be in the form of `pubsub-name/topic-name`. Policy expressions are allowed. | No | None |
35+
| topic | The name of the topic. Maps to the [topic](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/pubsub_api.md) parameter in Dapr. Policy expressions are allowed. | Yes | N/A |
36+
| ignore-error | If set to `true`, instructs the policy not to trigger ["on-error"](api-management-error-handling-policies.md) section upon receiving error from Dapr runtime. Policy expressions aren't allowed. | No | `false` |
37+
| response-variable-name | Name of the [Variables](api-management-policy-expressions.md#ContextVariables) collection entry to use for storing response from Dapr runtime. Policy expressions aren't allowed. | No | None |
38+
| timeout | Time (in seconds) to wait for Dapr runtime to respond. Can range from 1 to 240 seconds. Policy expressions are allowed. | No | 5 |
3939
| template | Templating engine to use for transforming the message content. "Liquid" is the only supported value. | No | None |
4040
| content-type | Type of the message content. "application/json" is the only supported value. | No | None |
4141

articles/api-management/quota-policy.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ To understand the difference between rate limits and quotas, [see Rate limits an
3434

3535
| Attribute | Description | Required | Default |
3636
| -------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------- |
37-
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
38-
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
39-
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite.| Yes | N/A |
37+
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
38+
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
39+
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite. Policy expressions aren't allowed.| Yes | N/A |
4040

4141
## Elements
4242

@@ -51,20 +51,20 @@ To understand the difference between rate limits and quotas, [see Rate limits an
5151
| Attribute | Description | Required | Default |
5252
| -------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------- |
5353
| name | The name of the API for which to apply the call quota limit. | Either `name` or `id` must be specified. | N/A |
54-
| id | The ID of the API for which to apply the call quota. | Either `name` or `id` must be specified. | N/A |
55-
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
56-
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
57-
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite.| Yes | N/A |
54+
| id | The ID of the API for which to apply the call quota limit. | Either `name` or `id` must be specified. | N/A |
55+
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
56+
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
57+
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite. Policy expressions aren't allowed.| Yes | N/A |
5858

5959
## operation attributes
6060

6161
| Attribute | Description | Required | Default |
6262
| -------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------- |
63-
| name | The name of the operation for which to apply the rate limit. | Either `name` or `id` must be specified. | N/A |
64-
| id | The ID of the operation for which to apply the rate limit. | Either `name` or `id` must be specified. | N/A |
65-
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
66-
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
67-
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite.| Yes | N/A |
63+
| name | The name of the operation for which to apply the call quota limit. | Either `name` or `id` must be specified. | N/A |
64+
| id | The ID of the operation for which to apply the call quota limit. | Either `name` or `id` must be specified. | N/A |
65+
| bandwidth | The maximum total number of kilobytes allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
66+
| calls | The maximum total number of calls allowed during the time interval specified in the `renewal-period`. Policy expressions aren't allowed. | Either `calls`, `bandwidth`, or both together must be specified. | N/A |
67+
| renewal-period | The length in seconds of the fixed window after which the quota resets. The start of each period is calculated relative to the start time of the subscription. When `renewal-period` is set to `0`, the period is set to infinite. Policy expressions aren't allowed.| Yes | N/A |
6868

6969
## Usage
7070

@@ -75,7 +75,6 @@ To understand the difference between rate limits and quotas, [see Rate limits an
7575
### Usage notes
7676

7777
* This policy can be used only once per policy definition.
78-
* [Policy expressions](api-management-policy-expressions.md) can't be used in attribute values for this policy.
7978
* This policy is only applied when an API is accessed using a subscription key.
8079

8180

0 commit comments

Comments
 (0)