1 | import { OperationType, ResourceType } from "./common";
|
2 | import { CosmosClientOptions } from "./CosmosClientOptions";
|
3 | import { DatabaseAccount } from "./documents";
|
4 | import { RequestOptions } from "./index";
|
5 | import { ResourceResponse } from "./request";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class GlobalEndpointManager {
|
11 | private readDatabaseAccount;
|
12 | |
13 |
|
14 |
|
15 | private defaultEndpoint;
|
16 | |
17 |
|
18 |
|
19 | enableEndpointDiscovery: boolean;
|
20 | private isRefreshing;
|
21 | private options;
|
22 | |
23 |
|
24 |
|
25 | private preferredLocations;
|
26 | private writeableLocations;
|
27 | private readableLocations;
|
28 | |
29 |
|
30 |
|
31 | constructor(options: CosmosClientOptions, readDatabaseAccount: (opts: RequestOptions) => Promise<ResourceResponse<DatabaseAccount>>);
|
32 | /**
|
33 | * Gets the current read endpoint from the endpoint cache.
|
34 | */
|
35 | getReadEndpoint(): Promise<string>;
|
36 | /**
|
37 | * Gets the current write endpoint from the endpoint cache.
|
38 | */
|
39 | getWriteEndpoint(): Promise<string>;
|
40 | getReadEndpoints(): Promise<ReadonlyArray<string>>;
|
41 | getWriteEndpoints(): Promise<ReadonlyArray<string>>;
|
42 | markCurrentLocationUnavailableForRead(endpoint: string): Promise<void>;
|
43 | markCurrentLocationUnavailableForWrite(endpoint: string): Promise<void>;
|
44 | canUseMultipleWriteLocations(resourceType?: ResourceType, operationType?: OperationType): boolean;
|
45 | resolveServiceEndpoint(resourceType: ResourceType, operationType: OperationType): Promise<string>;
|
46 | /**
|
47 | * Refreshes the endpoint list by retrieving the writable and readable locations
|
48 | * from the geo-replicated database account and then updating the locations cache.
|
49 | * We skip the refreshing if enableEndpointDiscovery is set to False
|
50 | */
|
51 | refreshEndpointList(): Promise<void>;
|
52 | private refreshEndpoints;
|
53 | /**
|
54 | * Gets the database account first by using the default endpoint, and if that doesn't returns
|
55 | * use the endpoints for the preferred locations in the order they are specified to get
|
56 | * the database account.
|
57 | */
|
58 | private getDatabaseAccountFromAnyEndpoint;
|
59 | /**
|
60 | * Gets the locational endpoint using the location name passed to it using the default endpoint.
|
61 | *
|
62 | * @param defaultEndpoint - The default endpoint to use for the endpoint.
|
63 | * @param locationName - The location name for the azure region like "East US".
|
64 | */
|
65 | private static getLocationalEndpoint;
|
66 | }
|
67 | //# sourceMappingURL=globalEndpointManager.d.ts.map |
\ | No newline at end of file |