@azure-rest/arm-servicefabric 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport ServiceFabricClient from \"./serviceFabricClient\";\n\nexport * from \"./serviceFabricClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default ServiceFabricClient;\n"]}
@@ -0,0 +1,155 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ const responseMap = {
4
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
5
+ "200",
6
+ ],
7
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
8
+ "200",
9
+ "202",
10
+ ],
11
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
12
+ "200",
13
+ "202",
14
+ ],
15
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
16
+ "200",
17
+ "204",
18
+ ],
19
+ "GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": [
20
+ "200",
21
+ ],
22
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": ["200"],
23
+ "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": [
24
+ "200",
25
+ ],
26
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": [
27
+ "200",
28
+ ],
29
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}": [
30
+ "200",
31
+ ],
32
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions": [
33
+ "200",
34
+ ],
35
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions": [
36
+ "200",
37
+ ],
38
+ "GET /providers/Microsoft.ServiceFabric/operations": ["200"],
39
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
40
+ "200",
41
+ ],
42
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
43
+ "200",
44
+ ],
45
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
46
+ "202",
47
+ "204",
48
+ ],
49
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes": [
50
+ "200",
51
+ ],
52
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
53
+ "200",
54
+ ],
55
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
56
+ "202",
57
+ ],
58
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
59
+ "202",
60
+ "204",
61
+ ],
62
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions": [
63
+ "200",
64
+ ],
65
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
66
+ "200",
67
+ ],
68
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
69
+ "202",
70
+ ],
71
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
72
+ "202",
73
+ ],
74
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
75
+ "202",
76
+ "204",
77
+ ],
78
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications": [
79
+ "200",
80
+ ],
81
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
82
+ "200",
83
+ ],
84
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
85
+ "202",
86
+ ],
87
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
88
+ "202",
89
+ ],
90
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
91
+ "202",
92
+ "204",
93
+ ],
94
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services": [
95
+ "200",
96
+ ],
97
+ };
98
+ export function isUnexpected(response) {
99
+ const lroOriginal = response.headers["x-ms-original-url"];
100
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
101
+ const method = response.request.method;
102
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
103
+ if (!pathDetails) {
104
+ pathDetails = geParametrizedPathSuccess(url.pathname);
105
+ }
106
+ return !pathDetails.includes(response.status);
107
+ }
108
+ function geParametrizedPathSuccess(path) {
109
+ const pathParts = path.split("/");
110
+ // Iterate the responseMap to find a match
111
+ for (const [key, value] of Object.entries(responseMap)) {
112
+ // Extracting the path from the map key which is in format
113
+ // GET /path/foo
114
+ const candidatePath = getPathFromMapKey(key);
115
+ // Get each part of the url path
116
+ const candidateParts = candidatePath.split("/");
117
+ // If the candidate and actual paths don't match in size
118
+ // we move on to the next candidate path
119
+ if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
120
+ // track if we have found a match to return the values found.
121
+ let found = true;
122
+ for (let i = 0; i < candidateParts.length; i++) {
123
+ if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
124
+ // If the current part of the candidate is a "template" part
125
+ // it is a match with the actual path part on hand
126
+ // skip as the parameterized part can match anything
127
+ continue;
128
+ }
129
+ // If the candidate part is not a template and
130
+ // the parts don't match mark the candidate as not found
131
+ // to move on with the next candidate path.
132
+ if (candidateParts[i] !== pathParts[i]) {
133
+ found = false;
134
+ break;
135
+ }
136
+ }
137
+ // We finished evaluating the current candidate parts
138
+ // if all parts matched we return the success values form
139
+ // the path mapping.
140
+ if (found) {
141
+ return value;
142
+ }
143
+ }
144
+ }
145
+ // No match was found, return an empty array.
146
+ return [];
147
+ }
148
+ function hasParametrizedPath(path) {
149
+ return path.includes("/{");
150
+ }
151
+ function getPathFromMapKey(mapKey) {
152
+ const pathStart = mapKey.indexOf("/");
153
+ return mapKey.slice(pathStart);
154
+ }
155
+ //# sourceMappingURL=isUnexpected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwElC,MAAM,WAAW,GAA6B;IAC5C,iIAAiI,EAAE;QACjI,KAAK;KACN;IACD,iIAAiI,EAAE;QACjI,KAAK;QACL,KAAK;KACN;IACD,mIAAmI,EAAE;QACnI,KAAK;QACL,KAAK;KACN;IACD,oIAAoI,EAAE;QACpI,KAAK;QACL,KAAK;KACN;IACD,mHAAmH,EAAE;QACnH,KAAK;KACN;IACD,gFAAgF,EAAE,CAAC,KAAK,CAAC;IACzF,yJAAyJ,EAAE;QACzJ,KAAK;KACN;IACD,6HAA6H,EAAE;QAC7H,KAAK;KACN;IACD,wJAAwJ,EAAE;QACxJ,KAAK;KACN;IACD,4GAA4G,EAAE;QAC5G,KAAK;KACN;IACD,uIAAuI,EAAE;QACvI,KAAK;KACN;IACD,mDAAmD,EAAE,CAAC,KAAK,CAAC;IAC5D,wKAAwK,EAAE;QACxK,KAAK;KACN;IACD,wKAAwK,EAAE;QACxK,KAAK;KACN;IACD,2KAA2K,EAAE;QAC3K,KAAK;QACL,KAAK;KACN;IACD,kJAAkJ,EAAE;QAClJ,KAAK;KACN;IACD,2LAA2L,EAAE;QAC3L,KAAK;KACN;IACD,2LAA2L,EAAE;QAC3L,KAAK;KACN;IACD,8LAA8L,EAAE;QAC9L,KAAK;QACL,KAAK;KACN;IACD,iLAAiL,EAAE;QACjL,KAAK;KACN;IACD,gKAAgK,EAAE;QAChK,KAAK;KACN;IACD,gKAAgK,EAAE;QAChK,KAAK;KACN;IACD,kKAAkK,EAAE;QAClK,KAAK;KACN;IACD,mKAAmK,EAAE;QACnK,KAAK;QACL,KAAK;KACN;IACD,8IAA8I,EAAE;QAC9I,KAAK;KACN;IACD,uLAAuL,EAAE;QACvL,KAAK;KACN;IACD,uLAAuL,EAAE;QACvL,KAAK;KACN;IACD,yLAAyL,EAAE;QACzL,KAAK;KACN;IACD,0LAA0L,EAAE;QAC1L,KAAK;QACL,KAAK;KACN;IACD,yKAAyK,EAAE;QACzK,KAAK;KACN;CACF,CAAC;AAkHF,MAAM,UAAU,YAAY,CAC1B,QAmE+B;IAgC/B,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KACvD;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACtD,0DAA0D;QAC1D,gBAAgB;QAChB,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,wDAAwD;QACxD,wCAAwC;QACxC,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAC1E,6DAA6D;YAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACxE,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ApplicationTypeVersionsCreateOrUpdate202Response,\n ApplicationTypeVersionsCreateOrUpdatedefaultResponse,\n ApplicationTypeVersionsDelete202Response,\n ApplicationTypeVersionsDelete204Response,\n ApplicationTypeVersionsDeletedefaultResponse,\n ApplicationTypeVersionsGet200Response,\n ApplicationTypeVersionsGetdefaultResponse,\n ApplicationTypeVersionsList200Response,\n ApplicationTypeVersionsListdefaultResponse,\n ApplicationTypesCreateOrUpdate200Response,\n ApplicationTypesCreateOrUpdatedefaultResponse,\n ApplicationTypesDelete202Response,\n ApplicationTypesDelete204Response,\n ApplicationTypesDeletedefaultResponse,\n ApplicationTypesGet200Response,\n ApplicationTypesGetdefaultResponse,\n ApplicationTypesList200Response,\n ApplicationTypesListdefaultResponse,\n ApplicationsCreateOrUpdate202Response,\n ApplicationsCreateOrUpdatedefaultResponse,\n ApplicationsDelete202Response,\n ApplicationsDelete204Response,\n ApplicationsDeletedefaultResponse,\n ApplicationsGet200Response,\n ApplicationsGetdefaultResponse,\n ApplicationsList200Response,\n ApplicationsListdefaultResponse,\n ApplicationsUpdate202Response,\n ApplicationsUpdatedefaultResponse,\n ClusterVersionsGet200Response,\n ClusterVersionsGetByEnvironment200Response,\n ClusterVersionsGetByEnvironmentdefaultResponse,\n ClusterVersionsGetdefaultResponse,\n ClusterVersionsList200Response,\n ClusterVersionsListByEnvironment200Response,\n ClusterVersionsListByEnvironmentdefaultResponse,\n ClusterVersionsListdefaultResponse,\n ClustersCreateOrUpdate200Response,\n ClustersCreateOrUpdate202Response,\n ClustersCreateOrUpdatedefaultResponse,\n ClustersDelete200Response,\n ClustersDelete204Response,\n ClustersDeletedefaultResponse,\n ClustersGet200Response,\n ClustersGetdefaultResponse,\n ClustersList200Response,\n ClustersListByResourceGroup200Response,\n ClustersListByResourceGroupdefaultResponse,\n ClustersListUpgradableVersions200Response,\n ClustersListUpgradableVersionsdefaultResponse,\n ClustersListdefaultResponse,\n ClustersUpdate200Response,\n ClustersUpdate202Response,\n ClustersUpdatedefaultResponse,\n OperationsList200Response,\n OperationsListdefaultResponse,\n ServicesCreateOrUpdate202Response,\n ServicesCreateOrUpdatedefaultResponse,\n ServicesDelete202Response,\n ServicesDelete204Response,\n ServicesDeletedefaultResponse,\n ServicesGet200Response,\n ServicesGetdefaultResponse,\n ServicesList200Response,\n ServicesListdefaultResponse,\n ServicesUpdate202Response,\n ServicesUpdatedefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters\": [\"200\"],\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions\": [\n \"200\",\n ],\n \"GET /providers/Microsoft.ServiceFabric/operations\": [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"200\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services\": [\n \"200\",\n ],\n};\n\nexport function isUnexpected(\n response: ClustersGet200Response | ClustersGetdefaultResponse\n): response is ClustersGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdatedefaultResponse\n): response is ClustersCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse\n): response is ClustersUpdatedefaultResponse;\nexport function isUnexpected(\n response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse\n): response is ClustersDeletedefaultResponse;\nexport function isUnexpected(\n response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse\n): response is ClustersListByResourceGroupdefaultResponse;\nexport function isUnexpected(\n response: ClustersList200Response | ClustersListdefaultResponse\n): response is ClustersListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsdefaultResponse\n): response is ClustersListUpgradableVersionsdefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsGet200Response | ClusterVersionsGetdefaultResponse\n): response is ClusterVersionsGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentdefaultResponse\n): response is ClusterVersionsGetByEnvironmentdefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsList200Response | ClusterVersionsListdefaultResponse\n): response is ClusterVersionsListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentdefaultResponse\n): response is ClusterVersionsListByEnvironmentdefaultResponse;\nexport function isUnexpected(\n response: OperationsList200Response | OperationsListdefaultResponse\n): response is OperationsListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesGet200Response | ApplicationTypesGetdefaultResponse\n): response is ApplicationTypesGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdatedefaultResponse\n): response is ApplicationTypesCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeletedefaultResponse\n): response is ApplicationTypesDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesList200Response | ApplicationTypesListdefaultResponse\n): response is ApplicationTypesListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse\n): response is ApplicationTypeVersionsGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n): response is ApplicationTypeVersionsCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeletedefaultResponse\n): response is ApplicationTypeVersionsDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse\n): response is ApplicationTypeVersionsListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationsGet200Response | ApplicationsGetdefaultResponse\n): response is ApplicationsGetdefaultResponse;\nexport function isUnexpected(\n response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse\n): response is ApplicationsCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ApplicationsUpdate202Response | ApplicationsUpdatedefaultResponse\n): response is ApplicationsUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeletedefaultResponse\n): response is ApplicationsDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationsList200Response | ApplicationsListdefaultResponse\n): response is ApplicationsListdefaultResponse;\nexport function isUnexpected(\n response: ServicesGet200Response | ServicesGetdefaultResponse\n): response is ServicesGetdefaultResponse;\nexport function isUnexpected(\n response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdatedefaultResponse\n): response is ServicesCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ServicesUpdate202Response | ServicesUpdatedefaultResponse\n): response is ServicesUpdatedefaultResponse;\nexport function isUnexpected(\n response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse\n): response is ServicesDeletedefaultResponse;\nexport function isUnexpected(\n response: ServicesList200Response | ServicesListdefaultResponse\n): response is ServicesListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersGet200Response\n | ClustersGetdefaultResponse\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdatedefaultResponse\n | ClustersUpdate200Response\n | ClustersUpdate202Response\n | ClustersUpdatedefaultResponse\n | ClustersDelete200Response\n | ClustersDelete204Response\n | ClustersDeletedefaultResponse\n | ClustersListByResourceGroup200Response\n | ClustersListByResourceGroupdefaultResponse\n | ClustersList200Response\n | ClustersListdefaultResponse\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsdefaultResponse\n | ClusterVersionsGet200Response\n | ClusterVersionsGetdefaultResponse\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentdefaultResponse\n | ClusterVersionsList200Response\n | ClusterVersionsListdefaultResponse\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentdefaultResponse\n | OperationsList200Response\n | OperationsListdefaultResponse\n | ApplicationTypesGet200Response\n | ApplicationTypesGetdefaultResponse\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdatedefaultResponse\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeletedefaultResponse\n | ApplicationTypesList200Response\n | ApplicationTypesListdefaultResponse\n | ApplicationTypeVersionsGet200Response\n | ApplicationTypeVersionsGetdefaultResponse\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeletedefaultResponse\n | ApplicationTypeVersionsList200Response\n | ApplicationTypeVersionsListdefaultResponse\n | ApplicationsGet200Response\n | ApplicationsGetdefaultResponse\n | ApplicationsCreateOrUpdate202Response\n | ApplicationsCreateOrUpdatedefaultResponse\n | ApplicationsUpdate202Response\n | ApplicationsUpdatedefaultResponse\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeletedefaultResponse\n | ApplicationsList200Response\n | ApplicationsListdefaultResponse\n | ServicesGet200Response\n | ServicesGetdefaultResponse\n | ServicesCreateOrUpdate202Response\n | ServicesCreateOrUpdatedefaultResponse\n | ServicesUpdate202Response\n | ServicesUpdatedefaultResponse\n | ServicesDelete202Response\n | ServicesDelete204Response\n | ServicesDeletedefaultResponse\n | ServicesList200Response\n | ServicesListdefaultResponse\n): response is\n | ClustersGetdefaultResponse\n | ClustersCreateOrUpdatedefaultResponse\n | ClustersUpdatedefaultResponse\n | ClustersDeletedefaultResponse\n | ClustersListByResourceGroupdefaultResponse\n | ClustersListdefaultResponse\n | ClustersListUpgradableVersionsdefaultResponse\n | ClusterVersionsGetdefaultResponse\n | ClusterVersionsGetByEnvironmentdefaultResponse\n | ClusterVersionsListdefaultResponse\n | ClusterVersionsListByEnvironmentdefaultResponse\n | OperationsListdefaultResponse\n | ApplicationTypesGetdefaultResponse\n | ApplicationTypesCreateOrUpdatedefaultResponse\n | ApplicationTypesDeletedefaultResponse\n | ApplicationTypesListdefaultResponse\n | ApplicationTypeVersionsGetdefaultResponse\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n | ApplicationTypeVersionsDeletedefaultResponse\n | ApplicationTypeVersionsListdefaultResponse\n | ApplicationsGetdefaultResponse\n | ApplicationsCreateOrUpdatedefaultResponse\n | ApplicationsUpdatedefaultResponse\n | ApplicationsDeletedefaultResponse\n | ApplicationsListdefaultResponse\n | ServicesGetdefaultResponse\n | ServicesCreateOrUpdatedefaultResponse\n | ServicesUpdatedefaultResponse\n | ServicesDeletedefaultResponse\n | ServicesListdefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i].startsWith(\"{\") && candidateParts[i].endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface Cluster extends Resource {\n /** The cluster resource properties */\n properties?: ClusterProperties;\n}\n\nexport interface ClusterProperties {\n /** The list of add-on features to enable in the cluster. */\n addOnFeatures?: Array<\n \"RepairManager\" | \"DnsService\" | \"BackupRestoreService\" | \"ResourceMonitorService\"\n >;\n /** The Service Fabric runtime versions available for this cluster. */\n availableClusterVersions?: Array<ClusterVersionDetails>;\n /** The AAD authentication settings of the cluster. */\n azureActiveDirectory?: AzureActiveDirectory;\n /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */\n certificate?: CertificateDescription;\n /** Describes a list of server certificates referenced by common name that are used to secure the cluster. */\n certificateCommonNames?: ServerCertificateCommonNames;\n /** The list of client certificates referenced by common name that are allowed to manage the cluster. */\n clientCertificateCommonNames?: Array<ClientCertificateCommonName>;\n /** The list of client certificates referenced by thumbprint that are allowed to manage the cluster. */\n clientCertificateThumbprints?: Array<ClientCertificateThumbprint>;\n /** The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. */\n clusterCodeVersion?: string;\n /** The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. */\n clusterEndpoint?: string;\n /** A service generated unique identifier for the cluster resource. */\n clusterId?: string;\n /**\n * The current state of the cluster.\n *\n * - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM extension to boot up and report to it.\n * - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state until the cluster boots up and system services are up.\n * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically initiated when the cluster boots up for the first time.\n * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration.\n * - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate.\n * - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only when the **upgradeMode** is set to 'Automatic'.\n * - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected version.\n * - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this state cannot be managed by the Resource Provider.\n * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted.\n * - Ready - Indicates that the cluster is in a stable state.\n *\n */\n clusterState?:\n | \"WaitingForNodes\"\n | \"Deploying\"\n | \"BaselineUpgrade\"\n | \"UpdatingUserConfiguration\"\n | \"UpdatingUserCertificate\"\n | \"UpdatingInfrastructure\"\n | \"EnforcingClusterVersion\"\n | \"UpgradeServiceUnreachable\"\n | \"AutoScale\"\n | \"Ready\";\n /** The storage account information for storing Service Fabric diagnostic logs. */\n diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfig;\n /** Indicates if the event store service is enabled. */\n eventStoreServiceEnabled?: boolean;\n /** The list of custom fabric settings to configure the cluster. */\n fabricSettings?: Array<SettingsSectionDescription>;\n /** The http management endpoint of the cluster. */\n managementEndpoint: string;\n /** The list of node types in the cluster. */\n nodeTypes: Array<NodeTypeDescription>;\n /** The provisioning state of the cluster resource. */\n provisioningState?: \"Updating\" | \"Succeeded\" | \"Failed\" | \"Canceled\";\n /**\n * The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity).\n *\n * - None - Run the System services with a target replica set count of 1. This should only be used for test clusters.\n * - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters.\n * - Silver - Run the System services with a target replica set count of 5.\n * - Gold - Run the System services with a target replica set count of 7.\n * - Platinum - Run the System services with a target replica set count of 9.\n *\n */\n reliabilityLevel?: \"None\" | \"Bronze\" | \"Silver\" | \"Gold\" | \"Platinum\";\n /** The server certificate used by reverse proxy. */\n reverseProxyCertificate?: CertificateDescription;\n /** Describes a list of server certificates referenced by common name that are used to secure the cluster. */\n reverseProxyCertificateCommonNames?: ServerCertificateCommonNames;\n /** The policy to use when upgrading the cluster. */\n upgradeDescription?: ClusterUpgradePolicy;\n /** The upgrade mode of the cluster when new Service Fabric runtime version is available. */\n upgradeMode?: \"Automatic\" | \"Manual\";\n /** The policy used to clean up unused versions. */\n applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicy;\n /** The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. */\n vmImage?: string;\n /** This property controls the logical grouping of VMs in upgrade domains (UDs). This property can't be modified if a node type with multiple Availability Zones is already present in the cluster. */\n sfZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a node type with multiple Availability Zones is added. */\n vmssZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** Indicates if infrastructure service manager is enabled. */\n infrastructureServiceManager?: boolean;\n /** Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **upgradeMode** is set to 'Automatic'. */\n upgradeWave?: \"Wave0\" | \"Wave1\" | \"Wave2\";\n /** Indicates the start date and time to pause automatic runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). */\n upgradePauseStartTimestampUtc?: Date | string;\n /** Indicates the end date and time to pause automatic runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). */\n upgradePauseEndTimestampUtc?: Date | string;\n /** Boolean to pause automatic runtime version upgrades to the cluster. */\n waveUpgradePaused?: boolean;\n /** Indicates a list of notification channels for cluster events. */\n notifications?: Array<Notification>;\n}\n\nexport interface ClusterVersionDetails {\n /** The Service Fabric runtime version of the cluster. */\n codeVersion?: string;\n /** The date of expiry of support of the version. */\n supportExpiryUtc?: string;\n /** Indicates if this version is for Windows or Linux operating system. */\n environment?: \"Windows\" | \"Linux\";\n}\n\nexport interface AzureActiveDirectory {\n /** Azure active directory tenant id. */\n tenantId?: string;\n /** Azure active directory cluster application id. */\n clusterApplication?: string;\n /** Azure active directory client application id. */\n clientApplication?: string;\n}\n\nexport interface CertificateDescription {\n /** Thumbprint of the primary certificate. */\n thumbprint: string;\n /** Thumbprint of the secondary certificate. */\n thumbprintSecondary?: string;\n /** The local certificate store location. */\n x509StoreName?:\n | \"AddressBook\"\n | \"AuthRoot\"\n | \"CertificateAuthority\"\n | \"Disallowed\"\n | \"My\"\n | \"Root\"\n | \"TrustedPeople\"\n | \"TrustedPublisher\";\n}\n\nexport interface ServerCertificateCommonNames {\n /** The list of server certificates referenced by common name that are used to secure the cluster. */\n commonNames?: Array<ServerCertificateCommonName>;\n /** The local certificate store location. */\n x509StoreName?:\n | \"AddressBook\"\n | \"AuthRoot\"\n | \"CertificateAuthority\"\n | \"Disallowed\"\n | \"My\"\n | \"Root\"\n | \"TrustedPeople\"\n | \"TrustedPublisher\";\n}\n\nexport interface ServerCertificateCommonName {\n /** The common name of the server certificate. */\n certificateCommonName: string;\n /** The issuer thumbprint of the server certificate. */\n certificateIssuerThumbprint: string;\n}\n\nexport interface ClientCertificateCommonName {\n /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */\n isAdmin: boolean;\n /** The common name of the client certificate. */\n certificateCommonName: string;\n /** The issuer thumbprint of the client certificate. */\n certificateIssuerThumbprint: string;\n}\n\nexport interface ClientCertificateThumbprint {\n /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */\n isAdmin: boolean;\n /** The thumbprint of the client certificate. */\n certificateThumbprint: string;\n}\n\nexport interface DiagnosticsStorageAccountConfig {\n /** The Azure storage account name. */\n storageAccountName: string;\n /** The protected diagnostics storage key name. */\n protectedAccountKeyName: string;\n /** The secondary protected diagnostics storage key name. If one of the storage account keys is rotated the cluster will fallback to using the other. */\n protectedAccountKeyName2?: string;\n /** The blob endpoint of the azure storage account. */\n blobEndpoint: string;\n /** The queue endpoint of the azure storage account. */\n queueEndpoint: string;\n /** The table endpoint of the azure storage account. */\n tableEndpoint: string;\n}\n\nexport interface SettingsSectionDescription {\n /** The section name of the fabric settings. */\n name: string;\n /** The collection of parameters in the section. */\n parameters: Array<SettingsParameterDescription>;\n}\n\nexport interface SettingsParameterDescription {\n /** The parameter name of fabric setting. */\n name: string;\n /** The parameter value of fabric setting. */\n value: string;\n}\n\nexport interface NodeTypeDescription {\n /** The name of the node type. */\n name: string;\n /** The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. */\n placementProperties?: Record<string, string>;\n /** The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. */\n capacities?: Record<string, string>;\n /** The TCP cluster management endpoint port. */\n clientConnectionEndpointPort: number;\n /** The HTTP cluster management endpoint port. */\n httpGatewayEndpointPort: number;\n /**\n * The durability level of the node type. Learn about [DurabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity).\n *\n * - Bronze - No privileges. This is the default.\n * - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD.\n * - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on full node VM skus like D15_V2, G5 etc.\n *\n */\n durabilityLevel?: \"Bronze\" | \"Silver\" | \"Gold\";\n /** The range of ports from which cluster assigned port to Service Fabric applications. */\n applicationPorts?: EndpointRangeDescription;\n /** The range of ephemeral ports that nodes in this node type should be configured with. */\n ephemeralPorts?: EndpointRangeDescription;\n /** The node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. */\n isPrimary: boolean;\n /** VMInstanceCount should be 1 to n, where n indicates the number of VM instances corresponding to this nodeType. VMInstanceCount = 0 can be done only in these scenarios: NodeType is a secondary nodeType. Durability = Bronze or Durability >= Bronze and InfrastructureServiceManager = true. If VMInstanceCount = 0, implies the VMs for this nodeType will not be used for the initial cluster size computation. */\n vmInstanceCount: number;\n /** The endpoint used by reverse proxy. */\n reverseProxyEndpointPort?: number;\n /** Indicates if the node type can only host Stateless workloads. */\n isStateless?: boolean;\n /** Indicates if the node type is enabled to support multiple zones. */\n multipleAvailabilityZones?: boolean;\n}\n\nexport interface EndpointRangeDescription {\n /** Starting port of a range of ports */\n startPort: number;\n /** End port of a range of ports */\n endPort: number;\n}\n\nexport interface ClusterUpgradePolicy {\n /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */\n forceRestart?: boolean;\n /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeReplicaSetCheckTimeout: string;\n /** The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckWaitDuration: string;\n /** The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckStableDuration: string;\n /** The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckRetryTimeout: string;\n /** The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeTimeout: string;\n /** The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeDomainTimeout: string;\n /** The cluster health policy used when upgrading the cluster. */\n healthPolicy: ClusterHealthPolicy;\n /** The cluster delta health policy used when upgrading the cluster. */\n deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicy;\n}\n\nexport interface ClusterHealthPolicy {\n /**\n * The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10.\n *\n * The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error.\n * If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning.\n * The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster.\n * The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.\n *\n * In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that.\n *\n */\n maxPercentUnhealthyNodes?: number;\n /**\n * The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10.\n *\n * The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error.\n * If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning.\n * This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap.\n * The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero.\n *\n */\n maxPercentUnhealthyApplications?: number;\n /** Defines the application health policy map used to evaluate the health of an application or one of its children entities. */\n applicationHealthPolicies?: Record<string, ApplicationHealthPolicy>;\n}\n\nexport interface ApplicationHealthPolicy {\n /** The health policy used by default to evaluate the health of a service type. */\n defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicy;\n /** The map with service type health policy per service type name. The map is empty by default. */\n serviceTypeHealthPolicies?: Record<string, ServiceTypeHealthPolicy>;\n}\n\nexport interface ServiceTypeHealthPolicy {\n /**\n * The maximum percentage of services allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyServices?: number;\n}\n\nexport interface ClusterUpgradeDeltaHealthPolicy {\n /**\n * The maximum allowed percentage of nodes health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits.\n *\n */\n maxPercentDeltaUnhealthyNodes: number;\n /**\n * The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits.\n *\n */\n maxPercentUpgradeDomainDeltaUnhealthyNodes: number;\n /**\n * The maximum allowed percentage of applications health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this.\n *\n */\n maxPercentDeltaUnhealthyApplications: number;\n /** Defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. */\n applicationDeltaHealthPolicies?: Record<string, ApplicationDeltaHealthPolicy>;\n}\n\nexport interface ApplicationDeltaHealthPolicy {\n /** The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. */\n defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicy;\n /** The map with service type delta health policy per service type name. The map is empty by default. */\n serviceTypeDeltaHealthPolicies?: Record<string, ServiceTypeDeltaHealthPolicy>;\n}\n\nexport interface ServiceTypeDeltaHealthPolicy {\n /**\n * The maximum allowed percentage of services health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the services at the beginning of upgrade and the state of the services at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits.\n *\n */\n maxPercentDeltaUnhealthyServices?: number;\n}\n\nexport interface ApplicationTypeVersionsCleanupPolicy {\n /** Number of unused versions per application type to keep. */\n maxUnusedVersionsToKeep: number;\n}\n\nexport interface Notification {\n /** Indicates if the notification is enabled. */\n isEnabled: boolean;\n /** The category of notification. */\n notificationCategory: \"WaveProgress\";\n /** The level of notification. */\n notificationLevel: \"Critical\" | \"All\";\n /** List of targets that subscribe to the notification. */\n notificationTargets: Array<NotificationTarget>;\n}\n\nexport interface NotificationTarget {\n /** The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. */\n notificationChannel: \"EmailUser\" | \"EmailSubscription\";\n /** List of targets that subscribe to the notification. */\n receivers: Array<string>;\n}\n\nexport interface Resource {\n /** Azure resource identifier. */\n id?: string;\n /** Azure resource name. */\n name?: string;\n /** Azure resource type. */\n type?: string;\n /** Azure resource location. */\n location: string;\n /** Azure resource tags. */\n tags?: Record<string, string>;\n /** Azure resource etag. */\n etag?: string;\n /** Metadata pertaining to creation and last modification of the resource. */\n systemData?: SystemData;\n}\n\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: string;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date | string;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: string;\n /** The timestamp of resource last modification (UTC). */\n lastModifiedAt?: Date | string;\n}\n\nexport interface ClusterUpdateParameters {\n /** Describes the cluster resource properties that can be updated during PATCH operation. */\n properties?: ClusterPropertiesUpdateParameters;\n /** Cluster update parameters */\n tags?: Record<string, string>;\n}\n\nexport interface ClusterPropertiesUpdateParameters {\n /** The list of add-on features to enable in the cluster. */\n addOnFeatures?: Array<\n \"RepairManager\" | \"DnsService\" | \"BackupRestoreService\" | \"ResourceMonitorService\"\n >;\n /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */\n certificate?: CertificateDescription;\n /** Describes a list of server certificates referenced by common name that are used to secure the cluster. */\n certificateCommonNames?: ServerCertificateCommonNames;\n /** The list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. */\n clientCertificateCommonNames?: Array<ClientCertificateCommonName>;\n /** The list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. */\n clientCertificateThumbprints?: Array<ClientCertificateThumbprint>;\n /** The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. */\n clusterCodeVersion?: string;\n /** Indicates if the event store service is enabled. */\n eventStoreServiceEnabled?: boolean;\n /** The list of custom fabric settings to configure the cluster. This will overwrite the existing list. */\n fabricSettings?: Array<SettingsSectionDescription>;\n /** The list of node types in the cluster. This will overwrite the existing list. */\n nodeTypes?: Array<NodeTypeDescription>;\n /**\n * The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity).\n *\n * - None - Run the System services with a target replica set count of 1. This should only be used for test clusters.\n * - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters.\n * - Silver - Run the System services with a target replica set count of 5.\n * - Gold - Run the System services with a target replica set count of 7.\n * - Platinum - Run the System services with a target replica set count of 9.\n *\n */\n reliabilityLevel?: \"None\" | \"Bronze\" | \"Silver\" | \"Gold\" | \"Platinum\";\n /** The server certificate used by reverse proxy. */\n reverseProxyCertificate?: CertificateDescription;\n /** The policy to use when upgrading the cluster. */\n upgradeDescription?: ClusterUpgradePolicy;\n /** The policy used to clean up unused versions. */\n applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicy;\n /** The upgrade mode of the cluster when new Service Fabric runtime version is available. */\n upgradeMode?: \"Automatic\" | \"Manual\";\n /** This property controls the logical grouping of VMs in upgrade domains (UDs). This property can't be modified if a node type with multiple Availability Zones is already present in the cluster. */\n sfZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a node type with multiple Availability Zones is added. */\n vmssZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** Indicates if infrastructure service manager is enabled. */\n infrastructureServiceManager?: boolean;\n /** Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **upgradeMode** is set to 'Automatic'. */\n upgradeWave?: \"Wave0\" | \"Wave1\" | \"Wave2\";\n /** The start timestamp to pause runtime version upgrades on the cluster (UTC). */\n upgradePauseStartTimestampUtc?: Date | string;\n /** The end timestamp of pause runtime version upgrades on the cluster (UTC). */\n upgradePauseEndTimestampUtc?: Date | string;\n /** Boolean to pause automatic runtime version upgrades to the cluster. */\n waveUpgradePaused?: boolean;\n /** Indicates a list of notification channels for cluster events. */\n notifications?: Array<Notification>;\n}\n\nexport interface UpgradableVersionsDescription {\n /** The target code version. */\n targetVersion: string;\n}\n\nexport interface ApplicationTypeResource extends ProxyResource {\n /** The application type name properties */\n properties?: ApplicationTypeResourceProperties;\n}\n\nexport interface ApplicationTypeResourceProperties {\n /** The current deployment or provisioning state, which only appears in the response. */\n provisioningState?: string;\n}\n\nexport interface ProxyResource {\n /** Azure resource identifier. */\n id?: string;\n /** Azure resource name. */\n name?: string;\n /** Azure resource type. */\n type?: string;\n /** It will be deprecated in New API, resource location depends on the parent resource. */\n location?: string;\n /** Azure resource tags. */\n tags?: Record<string, string>;\n /** Azure resource etag. */\n etag?: string;\n /** Metadata pertaining to creation and last modification of the resource. */\n systemData?: SystemData;\n}\n\nexport interface ApplicationTypeVersionResource extends ProxyResource {\n /** The properties of the application type version resource. */\n properties?: ApplicationTypeVersionResourceProperties;\n}\n\nexport interface ApplicationTypeVersionResourceProperties {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The URL to the application package */\n appPackageUrl: string;\n /** List of application type parameters that can be overridden when creating or updating the application. */\n defaultParameterList?: Record<string, string>;\n}\n\nexport interface ApplicationResource extends ProxyResource {\n /** Describes the managed identities for an Azure resource. */\n identity?: ManagedIdentity;\n /** The application resource properties. */\n properties?: ApplicationResourceProperties;\n}\n\nexport interface ManagedIdentity {\n /** The principal id of the managed identity. This property will only be provided for a system assigned identity. */\n principalId?: string;\n /** The tenant id of the managed identity. This property will only be provided for a system assigned identity. */\n tenantId?: string;\n /** The type of managed identity for the resource. */\n type?: \"SystemAssigned\" | \"UserAssigned\" | \"SystemAssigned, UserAssigned\" | \"None\";\n /**\n * The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:\n * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.\n *\n */\n userAssignedIdentities?: Record<string, UserAssignedIdentity>;\n}\n\nexport interface UserAssignedIdentity {\n /** The principal id of user assigned identity. */\n principalId?: string;\n /** The client id of user assigned identity. */\n clientId?: string;\n}\n\nexport interface ApplicationResourceProperties extends ApplicationResourceUpdateProperties {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The application type name as defined in the application manifest. */\n typeName?: string;\n}\n\nexport interface ApplicationResourceUpdateProperties {\n /** The version of the application type as defined in the application manifest. */\n typeVersion?: string;\n /** List of application parameters with overridden values from their default values specified in the application manifest. */\n parameters?: Record<string, string>;\n /** Describes the policy for a monitored application upgrade. */\n upgradePolicy?: ApplicationUpgradePolicy;\n /** The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. */\n minimumNodes?: number;\n /** The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. */\n maximumNodes?: number;\n /** Remove the current application capacity settings. */\n removeApplicationCapacity?: boolean;\n /** List of application capacity metric description. */\n metrics?: Array<ApplicationMetricDescription>;\n /** List of user assigned identities for the application, each mapped to a friendly name. */\n managedIdentities?: Array<ApplicationUserAssignedIdentity>;\n}\n\nexport interface ApplicationUpgradePolicy {\n /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). */\n upgradeReplicaSetCheckTimeout?: string;\n /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */\n forceRestart?: boolean;\n /** The policy used for monitoring the application upgrade */\n rollingUpgradeMonitoringPolicy?: ArmRollingUpgradeMonitoringPolicy;\n /**\n * Defines a health policy used to evaluate the health of an application or one of its children entities.\n *\n */\n applicationHealthPolicy?: ArmApplicationHealthPolicy;\n /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */\n upgradeMode?: \"Invalid\" | \"UnmonitoredAuto\" | \"UnmonitoredManual\" | \"Monitored\";\n /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */\n recreateApplication?: boolean;\n}\n\nexport interface ArmRollingUpgradeMonitoringPolicy {\n /** The activation Mode of the service package */\n failureAction?: \"Rollback\" | \"Manual\";\n /** The amount of time to wait after completing an upgrade domain before applying health policies. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckWaitDuration?: string;\n /** The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckStableDuration?: string;\n /** The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckRetryTimeout?: string;\n /** The amount of time the overall upgrade has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n upgradeTimeout?: string;\n /** The amount of time each upgrade domain has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n upgradeDomainTimeout?: string;\n}\n\nexport interface ArmApplicationHealthPolicy {\n /** Indicates whether warnings are treated with the same severity as errors. */\n considerWarningAsError?: boolean;\n /**\n * The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100.\n * The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error.\n * This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster.\n * The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.\n *\n */\n maxPercentUnhealthyDeployedApplications?: number;\n /** The health policy used by default to evaluate the health of a service type. */\n defaultServiceTypeHealthPolicy?: ArmServiceTypeHealthPolicy;\n /** The map with service type health policy per service type name. The map is empty by default. */\n serviceTypeHealthPolicyMap?: Record<string, ArmServiceTypeHealthPolicy>;\n}\n\nexport interface ArmServiceTypeHealthPolicy {\n /**\n * The maximum percentage of services allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyServices?: number;\n /**\n * The maximum percentage of partitions per service allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyPartitionsPerService?: number;\n /**\n * The maximum percentage of replicas per partition allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyReplicasPerPartition?: number;\n}\n\nexport interface ApplicationMetricDescription {\n /** The name of the metric. */\n name?: string;\n /**\n * The maximum node capacity for Service Fabric application.\n * This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value.\n * If set to zero, capacity for this metric is unlimited on each node.\n * When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity.\n * When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity.\n *\n */\n maximumCapacity?: number;\n /**\n * The node reservation capacity for Service Fabric application.\n * This is the amount of load which is reserved on nodes which have instances of this application.\n * If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application.\n * If set to zero, no capacity is reserved for this metric.\n * When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric.\n *\n */\n reservationCapacity?: number;\n /**\n * The total metric capacity for Service Fabric application.\n * This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value.\n * When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value.\n *\n */\n totalApplicationCapacity?: number;\n}\n\nexport interface ApplicationUserAssignedIdentity {\n /** The friendly name of user assigned identity. */\n name: string;\n /** The principal id of user assigned identity. */\n principalId: string;\n}\n\nexport interface ApplicationResourceUpdate extends ProxyResource {\n /** The application resource properties for patch operations. */\n properties?: ApplicationResourceUpdateProperties;\n}\n\nexport interface ServiceResource extends ProxyResource {\n /** The service resource properties. */\n properties?: ServiceResourceProperties;\n}\n\nexport interface ServiceResourcePropertiesParent extends ServiceResourcePropertiesBase {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The name of the service type */\n serviceTypeName?: string;\n /** Describes how the service is partitioned. */\n partitionDescription?: PartitionSchemeDescription;\n /** The activation Mode of the service package */\n servicePackageActivationMode?: \"SharedProcess\" | \"ExclusiveProcess\";\n /** Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service name. */\n serviceDnsName?: string;\n serviceKind: \"ServiceResourceProperties\" | \"Stateful\" | \"Stateless\";\n}\n\nexport interface PartitionSchemeDescriptionParent {\n partitionScheme: \"PartitionSchemeDescription\" | \"Named\" | \"Singleton\" | \"UniformInt64Range\";\n}\n\nexport interface ServiceResourcePropertiesBase {\n /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\". */\n placementConstraints?: string;\n /** A list that describes the correlation of the service with other services. */\n correlationScheme?: Array<ServiceCorrelationDescription>;\n /** The service load metrics is given as an array of ServiceLoadMetricDescription objects. */\n serviceLoadMetrics?: Array<ServiceLoadMetricDescription>;\n /** A list that describes the correlation of the service with other services. */\n servicePlacementPolicies?: Array<ServicePlacementPolicyDescription>;\n /** Specifies the move cost for the service. */\n defaultMoveCost?: \"Zero\" | \"Low\" | \"Medium\" | \"High\";\n}\n\nexport interface ServiceCorrelationDescription {\n /** The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. */\n scheme: \"Invalid\" | \"Affinity\" | \"AlignedAffinity\" | \"NonAlignedAffinity\";\n /** The name of the service that the correlation relationship is established with. */\n serviceName: string;\n}\n\nexport interface ServiceLoadMetricDescription {\n /** The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. */\n name: string;\n /** The service load metric relative weight, compared to other metrics configured for this service, as a number. */\n weight?: \"Zero\" | \"Low\" | \"Medium\" | \"High\";\n /** Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. */\n primaryDefaultLoad?: number;\n /** Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. */\n secondaryDefaultLoad?: number;\n /** Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. */\n defaultLoad?: number;\n}\n\nexport interface ServicePlacementPolicyDescription {\n type: \"ServicePlacementPolicyDescription\";\n}\n\nexport interface ServiceResourceUpdate extends ProxyResource {\n /** The service resource properties for patch operations. */\n properties?: ServiceResourceUpdateProperties;\n}\n\nexport interface ServiceResourceUpdatePropertiesParent extends ServiceResourcePropertiesBase {\n serviceKind: \"ServiceResourceUpdateProperties\" | \"Stateful\" | \"Stateless\";\n}\n\nexport interface NamedPartitionSchemeDescription extends PartitionSchemeDescriptionParent {\n /** The number of partitions. */\n count: number;\n /** Array of size specified by the ‘count’ parameter, for the names of the partitions. */\n names: Array<string>;\n partitionScheme: \"Named\";\n}\n\nexport interface SingletonPartitionSchemeDescription extends PartitionSchemeDescriptionParent {\n partitionScheme: \"Singleton\";\n}\n\nexport interface StatefulServiceProperties extends ServiceResourcePropertiesParent {\n /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */\n hasPersistedState?: boolean;\n /** The target replica set size as a number. */\n targetReplicaSetSize?: number;\n /** The minimum replica set size as a number. */\n minReplicaSetSize?: number;\n /** The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). */\n replicaRestartWaitDuration?: Date | string;\n /** The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). */\n quorumLossWaitDuration?: Date | string;\n /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */\n standByReplicaKeepDuration?: Date | string;\n serviceKind: \"Stateful\";\n}\n\nexport interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent {\n /** The target replica set size as a number. */\n targetReplicaSetSize?: number;\n /** The minimum replica set size as a number. */\n minReplicaSetSize?: number;\n /** The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). */\n replicaRestartWaitDuration?: Date | string;\n /** The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). */\n quorumLossWaitDuration?: Date | string;\n /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */\n standByReplicaKeepDuration?: Date | string;\n serviceKind: \"Stateful\";\n}\n\nexport interface StatelessServiceProperties extends ServiceResourcePropertiesParent {\n /** The instance count. */\n instanceCount?: number;\n /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */\n instanceCloseDelayDuration?: string;\n serviceKind: \"Stateless\";\n}\n\nexport interface StatelessServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent {\n /** The instance count. */\n instanceCount?: number;\n /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). */\n instanceCloseDelayDuration?: string;\n serviceKind: \"Stateless\";\n}\n\nexport interface UniformInt64RangePartitionSchemeDescription\n extends PartitionSchemeDescriptionParent {\n /** The number of partitions. */\n count: number;\n /**\n * String indicating the lower bound of the partition key range that\n * should be split between the partition ‘count’\n *\n */\n lowKey: string;\n /**\n * String indicating the upper bound of the partition key range that\n * should be split between the partition ‘count’\n *\n */\n highKey: string;\n partitionScheme: \"UniformInt64Range\";\n}\n\nexport type ServiceResourceProperties = StatefulServiceProperties | StatelessServiceProperties;\nexport type PartitionSchemeDescription =\n | NamedPartitionSchemeDescription\n | SingletonPartitionSchemeDescription\n | UniformInt64RangePartitionSchemeDescription;\nexport type ServiceResourceUpdateProperties =\n | StatefulServiceUpdateProperties\n | StatelessServiceUpdateProperties;\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=outputModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface ClusterOutput extends ResourceOutput {\n /** The cluster resource properties */\n properties?: ClusterPropertiesOutput;\n}\n\nexport interface ClusterPropertiesOutput {\n /** The list of add-on features to enable in the cluster. */\n addOnFeatures?: Array<\n \"RepairManager\" | \"DnsService\" | \"BackupRestoreService\" | \"ResourceMonitorService\"\n >;\n /** The Service Fabric runtime versions available for this cluster. */\n availableClusterVersions?: Array<ClusterVersionDetailsOutput>;\n /** The AAD authentication settings of the cluster. */\n azureActiveDirectory?: AzureActiveDirectoryOutput;\n /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */\n certificate?: CertificateDescriptionOutput;\n /** Describes a list of server certificates referenced by common name that are used to secure the cluster. */\n certificateCommonNames?: ServerCertificateCommonNamesOutput;\n /** The list of client certificates referenced by common name that are allowed to manage the cluster. */\n clientCertificateCommonNames?: Array<ClientCertificateCommonNameOutput>;\n /** The list of client certificates referenced by thumbprint that are allowed to manage the cluster. */\n clientCertificateThumbprints?: Array<ClientCertificateThumbprintOutput>;\n /** The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. */\n clusterCodeVersion?: string;\n /** The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. */\n clusterEndpoint?: string;\n /** A service generated unique identifier for the cluster resource. */\n clusterId?: string;\n /**\n * The current state of the cluster.\n *\n * - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM extension to boot up and report to it.\n * - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state until the cluster boots up and system services are up.\n * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically initiated when the cluster boots up for the first time.\n * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration.\n * - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate.\n * - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only when the **upgradeMode** is set to 'Automatic'.\n * - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected version.\n * - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this state cannot be managed by the Resource Provider.\n * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted.\n * - Ready - Indicates that the cluster is in a stable state.\n *\n */\n clusterState?:\n | \"WaitingForNodes\"\n | \"Deploying\"\n | \"BaselineUpgrade\"\n | \"UpdatingUserConfiguration\"\n | \"UpdatingUserCertificate\"\n | \"UpdatingInfrastructure\"\n | \"EnforcingClusterVersion\"\n | \"UpgradeServiceUnreachable\"\n | \"AutoScale\"\n | \"Ready\";\n /** The storage account information for storing Service Fabric diagnostic logs. */\n diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfigOutput;\n /** Indicates if the event store service is enabled. */\n eventStoreServiceEnabled?: boolean;\n /** The list of custom fabric settings to configure the cluster. */\n fabricSettings?: Array<SettingsSectionDescriptionOutput>;\n /** The http management endpoint of the cluster. */\n managementEndpoint: string;\n /** The list of node types in the cluster. */\n nodeTypes: Array<NodeTypeDescriptionOutput>;\n /** The provisioning state of the cluster resource. */\n provisioningState?: \"Updating\" | \"Succeeded\" | \"Failed\" | \"Canceled\";\n /**\n * The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity).\n *\n * - None - Run the System services with a target replica set count of 1. This should only be used for test clusters.\n * - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters.\n * - Silver - Run the System services with a target replica set count of 5.\n * - Gold - Run the System services with a target replica set count of 7.\n * - Platinum - Run the System services with a target replica set count of 9.\n *\n */\n reliabilityLevel?: \"None\" | \"Bronze\" | \"Silver\" | \"Gold\" | \"Platinum\";\n /** The server certificate used by reverse proxy. */\n reverseProxyCertificate?: CertificateDescriptionOutput;\n /** Describes a list of server certificates referenced by common name that are used to secure the cluster. */\n reverseProxyCertificateCommonNames?: ServerCertificateCommonNamesOutput;\n /** The policy to use when upgrading the cluster. */\n upgradeDescription?: ClusterUpgradePolicyOutput;\n /** The upgrade mode of the cluster when new Service Fabric runtime version is available. */\n upgradeMode?: \"Automatic\" | \"Manual\";\n /** The policy used to clean up unused versions. */\n applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicyOutput;\n /** The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. */\n vmImage?: string;\n /** This property controls the logical grouping of VMs in upgrade domains (UDs). This property can't be modified if a node type with multiple Availability Zones is already present in the cluster. */\n sfZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a node type with multiple Availability Zones is added. */\n vmssZonalUpgradeMode?: \"Parallel\" | \"Hierarchical\";\n /** Indicates if infrastructure service manager is enabled. */\n infrastructureServiceManager?: boolean;\n /** Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **upgradeMode** is set to 'Automatic'. */\n upgradeWave?: \"Wave0\" | \"Wave1\" | \"Wave2\";\n /** Indicates the start date and time to pause automatic runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). */\n upgradePauseStartTimestampUtc?: string;\n /** Indicates the end date and time to pause automatic runtime version upgrades on the cluster for an specific period of time on the cluster (UTC). */\n upgradePauseEndTimestampUtc?: string;\n /** Boolean to pause automatic runtime version upgrades to the cluster. */\n waveUpgradePaused?: boolean;\n /** Indicates a list of notification channels for cluster events. */\n notifications?: Array<NotificationOutput>;\n}\n\nexport interface ClusterVersionDetailsOutput {\n /** The Service Fabric runtime version of the cluster. */\n codeVersion?: string;\n /** The date of expiry of support of the version. */\n supportExpiryUtc?: string;\n /** Indicates if this version is for Windows or Linux operating system. */\n environment?: \"Windows\" | \"Linux\";\n}\n\nexport interface AzureActiveDirectoryOutput {\n /** Azure active directory tenant id. */\n tenantId?: string;\n /** Azure active directory cluster application id. */\n clusterApplication?: string;\n /** Azure active directory client application id. */\n clientApplication?: string;\n}\n\nexport interface CertificateDescriptionOutput {\n /** Thumbprint of the primary certificate. */\n thumbprint: string;\n /** Thumbprint of the secondary certificate. */\n thumbprintSecondary?: string;\n /** The local certificate store location. */\n x509StoreName?:\n | \"AddressBook\"\n | \"AuthRoot\"\n | \"CertificateAuthority\"\n | \"Disallowed\"\n | \"My\"\n | \"Root\"\n | \"TrustedPeople\"\n | \"TrustedPublisher\";\n}\n\nexport interface ServerCertificateCommonNamesOutput {\n /** The list of server certificates referenced by common name that are used to secure the cluster. */\n commonNames?: Array<ServerCertificateCommonNameOutput>;\n /** The local certificate store location. */\n x509StoreName?:\n | \"AddressBook\"\n | \"AuthRoot\"\n | \"CertificateAuthority\"\n | \"Disallowed\"\n | \"My\"\n | \"Root\"\n | \"TrustedPeople\"\n | \"TrustedPublisher\";\n}\n\nexport interface ServerCertificateCommonNameOutput {\n /** The common name of the server certificate. */\n certificateCommonName: string;\n /** The issuer thumbprint of the server certificate. */\n certificateIssuerThumbprint: string;\n}\n\nexport interface ClientCertificateCommonNameOutput {\n /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */\n isAdmin: boolean;\n /** The common name of the client certificate. */\n certificateCommonName: string;\n /** The issuer thumbprint of the client certificate. */\n certificateIssuerThumbprint: string;\n}\n\nexport interface ClientCertificateThumbprintOutput {\n /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */\n isAdmin: boolean;\n /** The thumbprint of the client certificate. */\n certificateThumbprint: string;\n}\n\nexport interface DiagnosticsStorageAccountConfigOutput {\n /** The Azure storage account name. */\n storageAccountName: string;\n /** The protected diagnostics storage key name. */\n protectedAccountKeyName: string;\n /** The secondary protected diagnostics storage key name. If one of the storage account keys is rotated the cluster will fallback to using the other. */\n protectedAccountKeyName2?: string;\n /** The blob endpoint of the azure storage account. */\n blobEndpoint: string;\n /** The queue endpoint of the azure storage account. */\n queueEndpoint: string;\n /** The table endpoint of the azure storage account. */\n tableEndpoint: string;\n}\n\nexport interface SettingsSectionDescriptionOutput {\n /** The section name of the fabric settings. */\n name: string;\n /** The collection of parameters in the section. */\n parameters: Array<SettingsParameterDescriptionOutput>;\n}\n\nexport interface SettingsParameterDescriptionOutput {\n /** The parameter name of fabric setting. */\n name: string;\n /** The parameter value of fabric setting. */\n value: string;\n}\n\nexport interface NodeTypeDescriptionOutput {\n /** The name of the node type. */\n name: string;\n /** The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. */\n placementProperties?: Record<string, string>;\n /** The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. */\n capacities?: Record<string, string>;\n /** The TCP cluster management endpoint port. */\n clientConnectionEndpointPort: number;\n /** The HTTP cluster management endpoint port. */\n httpGatewayEndpointPort: number;\n /**\n * The durability level of the node type. Learn about [DurabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity).\n *\n * - Bronze - No privileges. This is the default.\n * - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD.\n * - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on full node VM skus like D15_V2, G5 etc.\n *\n */\n durabilityLevel?: \"Bronze\" | \"Silver\" | \"Gold\";\n /** The range of ports from which cluster assigned port to Service Fabric applications. */\n applicationPorts?: EndpointRangeDescriptionOutput;\n /** The range of ephemeral ports that nodes in this node type should be configured with. */\n ephemeralPorts?: EndpointRangeDescriptionOutput;\n /** The node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. */\n isPrimary: boolean;\n /** VMInstanceCount should be 1 to n, where n indicates the number of VM instances corresponding to this nodeType. VMInstanceCount = 0 can be done only in these scenarios: NodeType is a secondary nodeType. Durability = Bronze or Durability >= Bronze and InfrastructureServiceManager = true. If VMInstanceCount = 0, implies the VMs for this nodeType will not be used for the initial cluster size computation. */\n vmInstanceCount: number;\n /** The endpoint used by reverse proxy. */\n reverseProxyEndpointPort?: number;\n /** Indicates if the node type can only host Stateless workloads. */\n isStateless?: boolean;\n /** Indicates if the node type is enabled to support multiple zones. */\n multipleAvailabilityZones?: boolean;\n}\n\nexport interface EndpointRangeDescriptionOutput {\n /** Starting port of a range of ports */\n startPort: number;\n /** End port of a range of ports */\n endPort: number;\n}\n\nexport interface ClusterUpgradePolicyOutput {\n /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */\n forceRestart?: boolean;\n /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeReplicaSetCheckTimeout: string;\n /** The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckWaitDuration: string;\n /** The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckStableDuration: string;\n /** The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n healthCheckRetryTimeout: string;\n /** The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeTimeout: string;\n /** The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */\n upgradeDomainTimeout: string;\n /** The cluster health policy used when upgrading the cluster. */\n healthPolicy: ClusterHealthPolicyOutput;\n /** The cluster delta health policy used when upgrading the cluster. */\n deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicyOutput;\n}\n\nexport interface ClusterHealthPolicyOutput {\n /**\n * The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10.\n *\n * The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error.\n * If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning.\n * The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster.\n * The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.\n *\n * In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that.\n *\n */\n maxPercentUnhealthyNodes?: number;\n /**\n * The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10.\n *\n * The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error.\n * If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning.\n * This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap.\n * The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero.\n *\n */\n maxPercentUnhealthyApplications?: number;\n /** Defines the application health policy map used to evaluate the health of an application or one of its children entities. */\n applicationHealthPolicies?: Record<string, ApplicationHealthPolicyOutput>;\n}\n\nexport interface ApplicationHealthPolicyOutput {\n /** The health policy used by default to evaluate the health of a service type. */\n defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicyOutput;\n /** The map with service type health policy per service type name. The map is empty by default. */\n serviceTypeHealthPolicies?: Record<string, ServiceTypeHealthPolicyOutput>;\n}\n\nexport interface ServiceTypeHealthPolicyOutput {\n /**\n * The maximum percentage of services allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyServices?: number;\n}\n\nexport interface ClusterUpgradeDeltaHealthPolicyOutput {\n /**\n * The maximum allowed percentage of nodes health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits.\n *\n */\n maxPercentDeltaUnhealthyNodes: number;\n /**\n * The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits.\n *\n */\n maxPercentUpgradeDomainDeltaUnhealthyNodes: number;\n /**\n * The maximum allowed percentage of applications health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this.\n *\n */\n maxPercentDeltaUnhealthyApplications: number;\n /** Defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. */\n applicationDeltaHealthPolicies?: Record<string, ApplicationDeltaHealthPolicyOutput>;\n}\n\nexport interface ApplicationDeltaHealthPolicyOutput {\n /** The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. */\n defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicyOutput;\n /** The map with service type delta health policy per service type name. The map is empty by default. */\n serviceTypeDeltaHealthPolicies?: Record<string, ServiceTypeDeltaHealthPolicyOutput>;\n}\n\nexport interface ServiceTypeDeltaHealthPolicyOutput {\n /**\n * The maximum allowed percentage of services health degradation allowed during cluster upgrades.\n * The delta is measured between the state of the services at the beginning of upgrade and the state of the services at the time of the health evaluation.\n * The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits.\n *\n */\n maxPercentDeltaUnhealthyServices?: number;\n}\n\nexport interface ApplicationTypeVersionsCleanupPolicyOutput {\n /** Number of unused versions per application type to keep. */\n maxUnusedVersionsToKeep: number;\n}\n\nexport interface NotificationOutput {\n /** Indicates if the notification is enabled. */\n isEnabled: boolean;\n /** The category of notification. */\n notificationCategory: \"WaveProgress\";\n /** The level of notification. */\n notificationLevel: \"Critical\" | \"All\";\n /** List of targets that subscribe to the notification. */\n notificationTargets: Array<NotificationTargetOutput>;\n}\n\nexport interface NotificationTargetOutput {\n /** The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. */\n notificationChannel: \"EmailUser\" | \"EmailSubscription\";\n /** List of targets that subscribe to the notification. */\n receivers: Array<string>;\n}\n\nexport interface ResourceOutput {\n /** Azure resource identifier. */\n id?: string;\n /** Azure resource name. */\n name?: string;\n /** Azure resource type. */\n type?: string;\n /** Azure resource location. */\n location: string;\n /** Azure resource tags. */\n tags?: Record<string, string>;\n /** Azure resource etag. */\n etag?: string;\n /** Metadata pertaining to creation and last modification of the resource. */\n systemData?: SystemDataOutput;\n}\n\nexport interface SystemDataOutput {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: string;\n /** The timestamp of resource creation (UTC). */\n createdAt?: string;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: string;\n /** The timestamp of resource last modification (UTC). */\n lastModifiedAt?: string;\n}\n\nexport interface ErrorModelOutput {\n /** The error details. */\n error?: ErrorModelErrorOutput;\n}\n\nexport interface ErrorModelErrorOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n}\n\nexport interface ClusterListResultOutput {\n value?: Array<ClusterOutput>;\n /** The URL to use for getting the next set of results. */\n nextLink?: string;\n}\n\nexport interface ClusterCodeVersionsListResultOutput {\n value?: Array<ClusterCodeVersionsResultOutput>;\n /** The URL to use for getting the next set of results. */\n nextLink?: string;\n}\n\nexport interface ClusterCodeVersionsResultOutput {\n /** The identification of the result */\n id?: string;\n /** The name of the result */\n name?: string;\n /** The result resource type */\n type?: string;\n /** The detail of the Service Fabric runtime version result */\n properties?: ClusterVersionDetailsOutput;\n}\n\nexport interface UpgradableVersionPathResultOutput {\n supportedPath?: Array<string>;\n}\n\nexport interface OperationListResultOutput {\n /** List of operations supported by the Service Fabric resource provider. */\n value?: Array<OperationResultOutput>;\n /** URL to get the next set of operation list results if there are any. */\n nextLink?: string;\n}\n\nexport interface OperationResultOutput {\n /** The name of the operation. */\n name?: string;\n /** Indicates whether the operation is a data action */\n isDataAction?: boolean;\n /** The object that represents the operation. */\n display?: AvailableOperationDisplayOutput;\n /** Origin result */\n origin?: string;\n /** The URL to use for getting the next set of results. */\n nextLink?: string;\n}\n\nexport interface AvailableOperationDisplayOutput {\n /** The name of the provider. */\n provider?: string;\n /** The resource on which the operation is performed */\n resource?: string;\n /** The operation that can be performed. */\n operation?: string;\n /** Operation description */\n description?: string;\n}\n\nexport interface ApplicationTypeResourceOutput extends ProxyResourceOutput {\n /** The application type name properties */\n properties?: ApplicationTypeResourcePropertiesOutput;\n}\n\nexport interface ApplicationTypeResourcePropertiesOutput {\n /** The current deployment or provisioning state, which only appears in the response. */\n provisioningState?: string;\n}\n\nexport interface ProxyResourceOutput {\n /** Azure resource identifier. */\n id?: string;\n /** Azure resource name. */\n name?: string;\n /** Azure resource type. */\n type?: string;\n /** It will be deprecated in New API, resource location depends on the parent resource. */\n location?: string;\n /** Azure resource tags. */\n tags?: Record<string, string>;\n /** Azure resource etag. */\n etag?: string;\n /** Metadata pertaining to creation and last modification of the resource. */\n systemData?: SystemDataOutput;\n}\n\nexport interface ApplicationTypeResourceListOutput {\n value?: Array<ApplicationTypeResourceOutput>;\n /** URL to get the next set of application type list results if there are any. */\n nextLink?: string;\n}\n\nexport interface ApplicationTypeVersionResourceOutput extends ProxyResourceOutput {\n /** The properties of the application type version resource. */\n properties?: ApplicationTypeVersionResourcePropertiesOutput;\n}\n\nexport interface ApplicationTypeVersionResourcePropertiesOutput {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The URL to the application package */\n appPackageUrl: string;\n /** List of application type parameters that can be overridden when creating or updating the application. */\n defaultParameterList?: Record<string, string>;\n}\n\nexport interface ApplicationTypeVersionResourceListOutput {\n value?: Array<ApplicationTypeVersionResourceOutput>;\n /** URL to get the next set of application type version list results if there are any. */\n nextLink?: string;\n}\n\nexport interface ApplicationResourceOutput extends ProxyResourceOutput {\n /** Describes the managed identities for an Azure resource. */\n identity?: ManagedIdentityOutput;\n /** The application resource properties. */\n properties?: ApplicationResourcePropertiesOutput;\n}\n\nexport interface ManagedIdentityOutput {\n /** The principal id of the managed identity. This property will only be provided for a system assigned identity. */\n principalId?: string;\n /** The tenant id of the managed identity. This property will only be provided for a system assigned identity. */\n tenantId?: string;\n /** The type of managed identity for the resource. */\n type?: \"SystemAssigned\" | \"UserAssigned\" | \"SystemAssigned, UserAssigned\" | \"None\";\n /**\n * The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:\n * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.\n *\n */\n userAssignedIdentities?: Record<string, UserAssignedIdentityOutput>;\n}\n\nexport interface UserAssignedIdentityOutput {\n /** The principal id of user assigned identity. */\n principalId?: string;\n /** The client id of user assigned identity. */\n clientId?: string;\n}\n\nexport interface ApplicationResourcePropertiesOutput\n extends ApplicationResourceUpdatePropertiesOutput {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The application type name as defined in the application manifest. */\n typeName?: string;\n}\n\nexport interface ApplicationResourceUpdatePropertiesOutput {\n /** The version of the application type as defined in the application manifest. */\n typeVersion?: string;\n /** List of application parameters with overridden values from their default values specified in the application manifest. */\n parameters?: Record<string, string>;\n /** Describes the policy for a monitored application upgrade. */\n upgradePolicy?: ApplicationUpgradePolicyOutput;\n /** The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. */\n minimumNodes?: number;\n /** The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. */\n maximumNodes?: number;\n /** Remove the current application capacity settings. */\n removeApplicationCapacity?: boolean;\n /** List of application capacity metric description. */\n metrics?: Array<ApplicationMetricDescriptionOutput>;\n /** List of user assigned identities for the application, each mapped to a friendly name. */\n managedIdentities?: Array<ApplicationUserAssignedIdentityOutput>;\n}\n\nexport interface ApplicationUpgradePolicyOutput {\n /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). */\n upgradeReplicaSetCheckTimeout?: string;\n /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */\n forceRestart?: boolean;\n /** The policy used for monitoring the application upgrade */\n rollingUpgradeMonitoringPolicy?: ArmRollingUpgradeMonitoringPolicyOutput;\n /**\n * Defines a health policy used to evaluate the health of an application or one of its children entities.\n *\n */\n applicationHealthPolicy?: ArmApplicationHealthPolicyOutput;\n /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */\n upgradeMode?: \"Invalid\" | \"UnmonitoredAuto\" | \"UnmonitoredManual\" | \"Monitored\";\n /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */\n recreateApplication?: boolean;\n}\n\nexport interface ArmRollingUpgradeMonitoringPolicyOutput {\n /** The activation Mode of the service package */\n failureAction?: \"Rollback\" | \"Manual\";\n /** The amount of time to wait after completing an upgrade domain before applying health policies. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckWaitDuration?: string;\n /** The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckStableDuration?: string;\n /** The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n healthCheckRetryTimeout?: string;\n /** The amount of time the overall upgrade has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n upgradeTimeout?: string;\n /** The amount of time each upgrade domain has to complete before FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. */\n upgradeDomainTimeout?: string;\n}\n\nexport interface ArmApplicationHealthPolicyOutput {\n /** Indicates whether warnings are treated with the same severity as errors. */\n considerWarningAsError?: boolean;\n /**\n * The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100.\n * The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error.\n * This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster.\n * The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.\n *\n */\n maxPercentUnhealthyDeployedApplications?: number;\n /** The health policy used by default to evaluate the health of a service type. */\n defaultServiceTypeHealthPolicy?: ArmServiceTypeHealthPolicyOutput;\n /** The map with service type health policy per service type name. The map is empty by default. */\n serviceTypeHealthPolicyMap?: Record<string, ArmServiceTypeHealthPolicyOutput>;\n}\n\nexport interface ArmServiceTypeHealthPolicyOutput {\n /**\n * The maximum percentage of services allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyServices?: number;\n /**\n * The maximum percentage of partitions per service allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyPartitionsPerService?: number;\n /**\n * The maximum percentage of replicas per partition allowed to be unhealthy before your application is considered in error.\n *\n */\n maxPercentUnhealthyReplicasPerPartition?: number;\n}\n\nexport interface ApplicationMetricDescriptionOutput {\n /** The name of the metric. */\n name?: string;\n /**\n * The maximum node capacity for Service Fabric application.\n * This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value.\n * If set to zero, capacity for this metric is unlimited on each node.\n * When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity.\n * When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity.\n *\n */\n maximumCapacity?: number;\n /**\n * The node reservation capacity for Service Fabric application.\n * This is the amount of load which is reserved on nodes which have instances of this application.\n * If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application.\n * If set to zero, no capacity is reserved for this metric.\n * When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric.\n *\n */\n reservationCapacity?: number;\n /**\n * The total metric capacity for Service Fabric application.\n * This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value.\n * When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value.\n *\n */\n totalApplicationCapacity?: number;\n}\n\nexport interface ApplicationUserAssignedIdentityOutput {\n /** The friendly name of user assigned identity. */\n name: string;\n /** The principal id of user assigned identity. */\n principalId: string;\n}\n\nexport interface ApplicationResourceUpdateOutput extends ProxyResourceOutput {\n /** The application resource properties for patch operations. */\n properties?: ApplicationResourceUpdatePropertiesOutput;\n}\n\nexport interface ApplicationResourceListOutput {\n value?: Array<ApplicationResourceOutput>;\n /** URL to get the next set of application list results if there are any. */\n nextLink?: string;\n}\n\nexport interface ServiceResourceOutput extends ProxyResourceOutput {\n /** The service resource properties. */\n properties?: ServiceResourcePropertiesOutput;\n}\n\nexport interface ServiceResourcePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput {\n /** The current deployment or provisioning state, which only appears in the response */\n provisioningState?: string;\n /** The name of the service type */\n serviceTypeName?: string;\n /** Describes how the service is partitioned. */\n partitionDescription?: PartitionSchemeDescriptionOutput;\n /** The activation Mode of the service package */\n servicePackageActivationMode?: \"SharedProcess\" | \"ExclusiveProcess\";\n /** Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service name. */\n serviceDnsName?: string;\n serviceKind: \"ServiceResourceProperties\" | \"Stateful\" | \"Stateless\";\n}\n\nexport interface PartitionSchemeDescriptionOutputParent {\n partitionScheme: \"PartitionSchemeDescription\" | \"Named\" | \"Singleton\" | \"UniformInt64Range\";\n}\n\nexport interface ServiceResourcePropertiesBaseOutput {\n /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\". */\n placementConstraints?: string;\n /** A list that describes the correlation of the service with other services. */\n correlationScheme?: Array<ServiceCorrelationDescriptionOutput>;\n /** The service load metrics is given as an array of ServiceLoadMetricDescription objects. */\n serviceLoadMetrics?: Array<ServiceLoadMetricDescriptionOutput>;\n /** A list that describes the correlation of the service with other services. */\n servicePlacementPolicies?: Array<ServicePlacementPolicyDescriptionOutput>;\n /** Specifies the move cost for the service. */\n defaultMoveCost?: \"Zero\" | \"Low\" | \"Medium\" | \"High\";\n}\n\nexport interface ServiceCorrelationDescriptionOutput {\n /** The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. */\n scheme: \"Invalid\" | \"Affinity\" | \"AlignedAffinity\" | \"NonAlignedAffinity\";\n /** The name of the service that the correlation relationship is established with. */\n serviceName: string;\n}\n\nexport interface ServiceLoadMetricDescriptionOutput {\n /** The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. */\n name: string;\n /** The service load metric relative weight, compared to other metrics configured for this service, as a number. */\n weight?: \"Zero\" | \"Low\" | \"Medium\" | \"High\";\n /** Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. */\n primaryDefaultLoad?: number;\n /** Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. */\n secondaryDefaultLoad?: number;\n /** Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. */\n defaultLoad?: number;\n}\n\nexport interface ServicePlacementPolicyDescriptionOutput {\n type: \"ServicePlacementPolicyDescription\";\n}\n\nexport interface ServiceResourceUpdateOutput extends ProxyResourceOutput {\n /** The service resource properties for patch operations. */\n properties?: ServiceResourceUpdatePropertiesOutput;\n}\n\nexport interface ServiceResourceUpdatePropertiesOutputParent\n extends ServiceResourcePropertiesBaseOutput {\n serviceKind: \"ServiceResourceUpdateProperties\" | \"Stateful\" | \"Stateless\";\n}\n\nexport interface ServiceResourceListOutput {\n value?: Array<ServiceResourceOutput>;\n /** URL to get the next set of service list results if there are any. */\n nextLink?: string;\n}\n\nexport interface NamedPartitionSchemeDescriptionOutput\n extends PartitionSchemeDescriptionOutputParent {\n /** The number of partitions. */\n count: number;\n /** Array of size specified by the ‘count’ parameter, for the names of the partitions. */\n names: Array<string>;\n partitionScheme: \"Named\";\n}\n\nexport interface SingletonPartitionSchemeDescriptionOutput\n extends PartitionSchemeDescriptionOutputParent {\n partitionScheme: \"Singleton\";\n}\n\nexport interface StatefulServicePropertiesOutput extends ServiceResourcePropertiesOutputParent {\n /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */\n hasPersistedState?: boolean;\n /** The target replica set size as a number. */\n targetReplicaSetSize?: number;\n /** The minimum replica set size as a number. */\n minReplicaSetSize?: number;\n /** The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). */\n replicaRestartWaitDuration?: string;\n /** The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). */\n quorumLossWaitDuration?: string;\n /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */\n standByReplicaKeepDuration?: string;\n serviceKind: \"Stateful\";\n}\n\nexport interface StatefulServiceUpdatePropertiesOutput\n extends ServiceResourceUpdatePropertiesOutputParent {\n /** The target replica set size as a number. */\n targetReplicaSetSize?: number;\n /** The minimum replica set size as a number. */\n minReplicaSetSize?: number;\n /** The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). */\n replicaRestartWaitDuration?: string;\n /** The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). */\n quorumLossWaitDuration?: string;\n /** The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). */\n standByReplicaKeepDuration?: string;\n serviceKind: \"Stateful\";\n}\n\nexport interface StatelessServicePropertiesOutput extends ServiceResourcePropertiesOutputParent {\n /** The instance count. */\n instanceCount?: number;\n /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */\n instanceCloseDelayDuration?: string;\n serviceKind: \"Stateless\";\n}\n\nexport interface StatelessServiceUpdatePropertiesOutput\n extends ServiceResourceUpdatePropertiesOutputParent {\n /** The instance count. */\n instanceCount?: number;\n /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). */\n instanceCloseDelayDuration?: string;\n serviceKind: \"Stateless\";\n}\n\nexport interface UniformInt64RangePartitionSchemeDescriptionOutput\n extends PartitionSchemeDescriptionOutputParent {\n /** The number of partitions. */\n count: number;\n /**\n * String indicating the lower bound of the partition key range that\n * should be split between the partition ‘count’\n *\n */\n lowKey: string;\n /**\n * String indicating the upper bound of the partition key range that\n * should be split between the partition ‘count’\n *\n */\n highKey: string;\n partitionScheme: \"UniformInt64Range\";\n}\n\nexport type ServiceResourcePropertiesOutput =\n | StatefulServicePropertiesOutput\n | StatelessServicePropertiesOutput;\nexport type PartitionSchemeDescriptionOutput =\n | NamedPartitionSchemeDescriptionOutput\n | SingletonPartitionSchemeDescriptionOutput\n | UniformInt64RangePartitionSchemeDescriptionOutput;\nexport type ServiceResourceUpdatePropertiesOutput =\n | StatefulServiceUpdatePropertiesOutput\n | StatelessServiceUpdatePropertiesOutput;\n"]}
@@ -0,0 +1,70 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { getPagedAsyncIterator } from "@azure/core-paging";
4
+ import { createRestError } from "@azure-rest/core-client";
5
+ /**
6
+ * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
+ * @param client - Client to use for sending the next page requests
8
+ * @param initialResponse - Initial response containing the nextLink and current page of elements
9
+ * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
10
+ * @returns - PagedAsyncIterableIterator to iterate the elements
11
+ */
12
+ export function paginate(client, initialResponse, options = {}) {
13
+ let firstRun = true;
14
+ const itemName = "value";
15
+ const nextLinkName = "nextLink";
16
+ const { customGetPage } = options;
17
+ const pagedResult = {
18
+ firstPageLink: "",
19
+ getPage: typeof customGetPage === "function"
20
+ ? customGetPage
21
+ : async (pageLink) => {
22
+ const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
23
+ firstRun = false;
24
+ checkPagingRequest(result);
25
+ const nextLink = getNextLink(result.body, nextLinkName);
26
+ const values = getElements(result.body, itemName);
27
+ return {
28
+ page: values,
29
+ nextPageLink: nextLink,
30
+ };
31
+ },
32
+ };
33
+ return getPagedAsyncIterator(pagedResult);
34
+ }
35
+ /**
36
+ * Gets for the value of nextLink in the body
37
+ */
38
+ function getNextLink(body, nextLinkName) {
39
+ if (!nextLinkName) {
40
+ return undefined;
41
+ }
42
+ const nextLink = body[nextLinkName];
43
+ if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
44
+ throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
45
+ }
46
+ return nextLink;
47
+ }
48
+ /**
49
+ * Gets the elements of the current request in the body.
50
+ */
51
+ function getElements(body, itemName) {
52
+ const value = body[itemName];
53
+ // value has to be an array according to the x-ms-pageable extension.
54
+ // The fact that this must be an array is used above to calculate the
55
+ // type of elements in the page in PaginateReturn
56
+ if (!Array.isArray(value)) {
57
+ throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
58
+ }
59
+ return value !== null && value !== void 0 ? value : [];
60
+ }
61
+ /**
62
+ * Checks if a request failed
63
+ */
64
+ function checkPagingRequest(response) {
65
+ const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
66
+ if (!Http2xxStatusCodes.includes(response.status)) {
67
+ throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
68
+ }
69
+ }
70
+ //# sourceMappingURL=paginateHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAA2C,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAiC,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WAAW,CAAW,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC5D,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,YAAY,EAAE,QAAQ;iBACvB,CAAC;YACJ,CAAC;KACR,CAAC;IAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;KAClF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;KACH;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PagedAsyncIterableIterator, PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport {\n ApplicationResource,\n ApplicationResourceUpdate,\n ApplicationTypeResource,\n ApplicationTypeVersionResource,\n Cluster,\n ClusterUpdateParameters,\n ServiceResource,\n ServiceResourceUpdate,\n UpgradableVersionsDescription,\n} from \"./models\";\n\nexport type ClustersGetParameters = RequestParameters;\n\nexport interface ClustersCreateOrUpdateBodyParam {\n /** The cluster resource. */\n body: Cluster;\n}\n\nexport interface ClustersCreateOrUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ClustersCreateOrUpdateParameters = ClustersCreateOrUpdateMediaTypesParam &\n ClustersCreateOrUpdateBodyParam &\n RequestParameters;\n\nexport interface ClustersUpdateBodyParam {\n /** The parameters which contains the property value and property name which used to update the cluster configuration. */\n body: ClusterUpdateParameters;\n}\n\nexport interface ClustersUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ClustersUpdateParameters = ClustersUpdateMediaTypesParam &\n ClustersUpdateBodyParam &\n RequestParameters;\nexport type ClustersDeleteParameters = RequestParameters;\nexport type ClustersListByResourceGroupParameters = RequestParameters;\nexport type ClustersListParameters = RequestParameters;\n\nexport interface ClustersListUpgradableVersionsBodyParam {\n /** The upgrade path description with target version. */\n body?: UpgradableVersionsDescription;\n}\n\nexport interface ClustersListUpgradableVersionsMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ClustersListUpgradableVersionsParameters = ClustersListUpgradableVersionsMediaTypesParam &\n ClustersListUpgradableVersionsBodyParam &\n RequestParameters;\nexport type ClusterVersionsGetParameters = RequestParameters;\nexport type ClusterVersionsGetByEnvironmentParameters = RequestParameters;\nexport type ClusterVersionsListParameters = RequestParameters;\nexport type ClusterVersionsListByEnvironmentParameters = RequestParameters;\nexport type OperationsListParameters = RequestParameters;\nexport type ApplicationTypesGetParameters = RequestParameters;\n\nexport interface ApplicationTypesCreateOrUpdateBodyParam {\n /** The application type name resource. */\n body: ApplicationTypeResource;\n}\n\nexport interface ApplicationTypesCreateOrUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ApplicationTypesCreateOrUpdateParameters = ApplicationTypesCreateOrUpdateMediaTypesParam &\n ApplicationTypesCreateOrUpdateBodyParam &\n RequestParameters;\nexport type ApplicationTypesDeleteParameters = RequestParameters;\nexport type ApplicationTypesListParameters = RequestParameters;\nexport type ApplicationTypeVersionsGetParameters = RequestParameters;\n\nexport interface ApplicationTypeVersionsCreateOrUpdateBodyParam {\n /** The application type version resource. */\n body: ApplicationTypeVersionResource;\n}\n\nexport interface ApplicationTypeVersionsCreateOrUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ApplicationTypeVersionsCreateOrUpdateParameters = ApplicationTypeVersionsCreateOrUpdateMediaTypesParam &\n ApplicationTypeVersionsCreateOrUpdateBodyParam &\n RequestParameters;\nexport type ApplicationTypeVersionsDeleteParameters = RequestParameters;\nexport type ApplicationTypeVersionsListParameters = RequestParameters;\nexport type ApplicationsGetParameters = RequestParameters;\n\nexport interface ApplicationsCreateOrUpdateBodyParam {\n /** The application resource. */\n body: ApplicationResource;\n}\n\nexport interface ApplicationsCreateOrUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ApplicationsCreateOrUpdateParameters = ApplicationsCreateOrUpdateMediaTypesParam &\n ApplicationsCreateOrUpdateBodyParam &\n RequestParameters;\n\nexport interface ApplicationsUpdateBodyParam {\n /** The application resource for patch operations. */\n body: ApplicationResourceUpdate;\n}\n\nexport interface ApplicationsUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ApplicationsUpdateParameters = ApplicationsUpdateMediaTypesParam &\n ApplicationsUpdateBodyParam &\n RequestParameters;\nexport type ApplicationsDeleteParameters = RequestParameters;\nexport type ApplicationsListParameters = RequestParameters;\nexport type ServicesGetParameters = RequestParameters;\n\nexport interface ServicesCreateOrUpdateBodyParam {\n /** The service resource. */\n body: ServiceResource;\n}\n\nexport interface ServicesCreateOrUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ServicesCreateOrUpdateParameters = ServicesCreateOrUpdateMediaTypesParam &\n ServicesCreateOrUpdateBodyParam &\n RequestParameters;\n\nexport interface ServicesUpdateBodyParam {\n /** The service resource for patch operations. */\n body: ServiceResourceUpdate;\n}\n\nexport interface ServicesUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ServicesUpdateParameters = ServicesUpdateMediaTypesParam &\n ServicesUpdateBodyParam &\n RequestParameters;\nexport type ServicesDeleteParameters = RequestParameters;\nexport type ServicesListParameters = RequestParameters;\n"]}