You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|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|
|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|
| 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 |
| 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 |
Copy file name to clipboardExpand all lines: articles/api-management/mock-response-policy.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ms.author: danlep
12
12
13
13
# Mock response
14
14
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.
| 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 |
| 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 |
39
39
| template | Templating engine to use for transforming the message content. "Liquid" is the only supported value. | No | None |
40
40
| content-type | Type of the message content. "application/json" is the only supported value. | No | None |
| 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 |
40
40
41
41
## Elements
42
42
@@ -51,20 +51,20 @@ To understand the difference between rate limits and quotas, [see Rate limits an
| 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 |
| 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 |
68
68
69
69
## Usage
70
70
@@ -75,7 +75,6 @@ To understand the difference between rate limits and quotas, [see Rate limits an
75
75
### Usage notes
76
76
77
77
* 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.
79
78
* This policy is only applied when an API is accessed using a subscription key.
0 commit comments