Skip to content

Commit 2a255f4

Browse files
Merge pull request #232418 from dlepow/pol2
[APIM] Policy expression support in policies - 2
2 parents a91c580 + 99a3980 commit 2a255f4

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

articles/api-management/emit-metric-policy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The `emit-metric` policy sends custom metrics in the specified format to Applica
3232

3333
| Attribute | Description | Required | Default value |
3434
| --------- | -------------------------- | ------------------ | -------------- |
35-
| name | A string or policy expression. Name of custom metric. | Yes | N/A |
36-
| namespace | A string or policy expression. Namespace of custom metric. | No | API Management |
37-
| value | An integer or policy expression. Value of custom metric. | No | 1 |
35+
| name | A string. Name of custom metric. Policy expressions aren't allowed. | Yes | N/A |
36+
| namespace | A string. Namespace of custom metric. Policy expressions aren't allowed. | No | API Management |
37+
| value | Value of custom metric expressed as an integer. Policy expressions are allowed. | No | 1 |
3838

3939

4040
## Elements

articles/api-management/find-and-replace-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ The `find-and-replace` policy finds a request or response substring and replaces
2727

2828
| Attribute | Description | Required | Default |
2929
| ----------------- | ------------------------------------------------------ | -------- | ------- |
30-
|from|The string to search for.|Yes|N/A|
31-
|to|The replacement string. Specify a zero length replacement string to remove the search string.|Yes|N/A|
30+
|from|The string to search for. Policy expressions are allowed. |Yes|N/A|
31+
|to|The replacement string. Specify a zero length replacement string to remove the search string. Policy expressions are allowed. |Yes|N/A|
3232

3333
## Usage
3434

articles/api-management/forward-request-policy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ The `forward-request` policy forwards the incoming request to the backend servic
3030

3131
| Attribute | Description | Required | Default |
3232
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
33-
| timeout | The amount of time in seconds to wait for the HTTP response headers to be returned by the backend service before a timeout error is raised. Minimum value is 0 seconds. Values greater than 240 seconds may not be honored, because the underlying network infrastructure can drop idle connections after this time. | No | 300 |
34-
| follow-redirects | Specifies whether redirects from the backend service are followed by the gateway or returned to the caller. | No | `false` |
33+
| timeout | The amount of time in seconds to wait for the HTTP response headers to be returned by the backend service before a timeout error is raised. Minimum value is 0 seconds. Values greater than 240 seconds may not be honored, because the underlying network infrastructure can drop idle connections after this time. Policy expressions are allowed. | No | 300 |
34+
| follow-redirects | Specifies whether redirects from the backend service are followed by the gateway or returned to the caller. Policy expressions are allowed. | No | `false` |
3535
| buffer-request-body | When set to `true`, request is buffered and will be reused on [retry](retry-policy.md). | No | `false` |
36-
| buffer-response | Affects processing of chunked responses. When set to `false`, each chunk received from the backend is immediately returned to the caller. When set to `true`, chunks are buffered (8 KB, unless end of stream is detected) and only then returned to the caller.<br/><br/>Set to `false` with backends such as those implementing [server-sent events (SSE)](how-to-server-sent-events.md) that require content to be returned or streamed immediately to the caller. | No | `true` |
37-
| fail-on-error-status-code | When set to `true`, triggers [on-error](api-management-error-handling-policies.md) section for response codes in the range from 400 to 599 inclusive. | No | `false` |
36+
| buffer-response | Affects processing of chunked responses. When set to `false`, each chunk received from the backend is immediately returned to the caller. When set to `true`, chunks are buffered (8 KB, unless end of stream is detected) and only then returned to the caller.<br/><br/>Set to `false` with backends such as those implementing [server-sent events (SSE)](how-to-server-sent-events.md) that require content to be returned or streamed immediately to the caller. Policy expressions aren't allowed. | No | `true` |
37+
| fail-on-error-status-code | When set to `true`, triggers [on-error](api-management-error-handling-policies.md) section for response codes in the range from 400 to 599 inclusive. Policy expressions aren't allowed. | No | `false` |
3838

3939

4040
## Usage

articles/api-management/include-fragment-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The policy inserts the policy fragment as-is at the location you select in the p
2828

2929
| Attribute | Description | Required | Default |
3030
| --------- | -------------------------------------------------------------------------------------------------- | -------- | ------- |
31-
| fragment-id | A string. Specifies the identifier (name) of a policy fragment created in the API Management instance. | Yes | N/A |
31+
| fragment-id | A string. Specifies the identifier (name) of a policy fragment created in the API Management instance. Policy expressions aren't allowed. | Yes | N/A |
3232

3333
## Usage
3434

articles/api-management/invoke-dapr-binding-policy.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@ The policy assumes that Dapr runtime is running in a sidecar container in the sa
3535

3636
| Attribute | Description | Required | Default |
3737
|------------------|---------------------------------|----------|---------|
38-
| name | Target binding name. Must match the name of the bindings [defined](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#bindings-structure) in Dapr. | Yes | N/A |
39-
| operation | Target operation name (binding specific). Maps to the [operation](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#invoking-output-bindings) property in Dapr. | No | None |
40-
| 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` |
41-
| 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 |
42-
| timeout | Time (in seconds) to wait for Dapr runtime to respond. Can range from 1 to 240 seconds. | No | 5 |
43-
| template | Templating engine to use for transforming the message content. "Liquid" is the only supported value. | No | None |
38+
| name | Target binding name. Must match the name of the bindings [defined](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#bindings-structure) in Dapr. Policy expressions are allowed. | Yes | N/A |
39+
| operation | Target operation name (binding specific). Maps to the [operation](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#invoking-output-bindings) property in Dapr. Policy expressions aren't allowed. | No | None |
40+
| 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` |
41+
| 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 |
42+
| timeout | Time (in seconds) to wait for Dapr runtime to respond. Can range from 1 to 240 seconds. Policy expressions are allowed.| No | 5 |
43+
| template | Templating engine to use for transforming the message content. "Liquid" is the only supported value. | No | None |
4444
| content-type | Type of the message content. "application/json" is the only supported value. | No | None |
4545

46+
## Elements
47+
48+
| Element | Description | Required |
49+
|---------------------|--------------|----------|
50+
| metadata | Binding specific metadata in the form of key/value pairs. Maps to the [metadata](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#invoking-output-bindings) property in Dapr. | No |
51+
| data | Content of the message. Maps to the [data](https://github.com/dapr/docs/blob/master/daprdocs/content/en/reference/api/bindings_api.md#invoking-output-bindings) property in Dapr. Policy expressions are allowed. | No |
52+
4653
## Usage
4754

4855
- [**Policy sections:**](./api-management-howto-policies.md#sections) inbound, outbound, on-error

articles/api-management/ip-filter-policy.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ The `ip-filter` policy filters (allows/denies) calls from specific IP addresses
2929

3030
| Attribute | Description | Required | Default |
3131
| ----------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------- | ------- |
32-
| address-range from="address" to="address" | A range of IP addresses to allow or deny access for. | Required when the `address-range` element is used. | N/A |
33-
| action | Specifies whether calls should be allowed (`allow`) or not (`forbid`) for the specified IP addresses and ranges. | Yes | N/A |
32+
| action | Specifies whether calls should be allowed (`allow`) or not (`forbid`) for the specified IP addresses and ranges. Policy expressions are allowed. | Yes | N/A |
3433

3534
## Elements
3635

3736
| Element | Description | Required |
3837
| ----------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------- |
39-
| address | Add one or more of these elements to specify a single IP address on which to filter. | At least one `address` or `address-range` element is required. |
38+
| address | Add one or more of these elements to specify a single IP address on which to filter. Policy expressions are allowed. | At least one `address` or `address-range` element is required. |
4039
| address-range | Add one or more of these elements to specify a range of IP addresses `from` "address" `to` "address" on which to filter. | At least one `address` or `address-range` element is required. |
4140

4241

0 commit comments

Comments
 (0)