UNPKG

1.37 kBTypeScriptView Raw
1import { BaseRequestPolicy, RequestPolicy, RequestPolicyOptionsLike, RequestPolicyFactory } from "./requestPolicy";
2import { WebResourceLike } from "../webResource";
3import { HttpOperationResponse } from "../httpOperationResponse";
4/**
5 * Options that control how to retry on response status code 429.
6 */
7export interface ThrottlingRetryOptions {
8 /**
9 * The maximum number of retry attempts. Defaults to 3.
10 */
11 maxRetries?: number;
12}
13export declare function throttlingRetryPolicy(maxRetries?: number): RequestPolicyFactory;
14/**
15 * To learn more, please refer to
16 * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits,
17 * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and
18 * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors
19 */
20export declare class ThrottlingRetryPolicy extends BaseRequestPolicy {
21 private retryLimit;
22 constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptionsLike, retryLimit: number);
23 sendRequest(httpRequest: WebResourceLike): Promise<HttpOperationResponse>;
24 private retry;
25 static parseRetryAfterHeader(headerValue: string): number | undefined;
26 static parseDateRetryAfterHeader(headerValue: string): number | undefined;
27}
28//# sourceMappingURL=throttlingRetryPolicy.d.ts.map
\No newline at end of file