@aws-sdk/client-eks 3.185.0 → 3.188.0
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.
- package/CHANGELOG.md +16 -0
- package/dist-es/EKS.js +138 -145
- package/dist-es/EKSClient.js +22 -28
- package/dist-es/commands/AssociateEncryptionConfigCommand.js +21 -28
- package/dist-es/commands/AssociateIdentityProviderConfigCommand.js +21 -28
- package/dist-es/commands/CreateAddonCommand.js +21 -28
- package/dist-es/commands/CreateClusterCommand.js +21 -28
- package/dist-es/commands/CreateFargateProfileCommand.js +21 -28
- package/dist-es/commands/CreateNodegroupCommand.js +21 -28
- package/dist-es/commands/DeleteAddonCommand.js +21 -28
- package/dist-es/commands/DeleteClusterCommand.js +21 -28
- package/dist-es/commands/DeleteFargateProfileCommand.js +21 -28
- package/dist-es/commands/DeleteNodegroupCommand.js +21 -28
- package/dist-es/commands/DeregisterClusterCommand.js +21 -28
- package/dist-es/commands/DescribeAddonCommand.js +21 -28
- package/dist-es/commands/DescribeAddonVersionsCommand.js +21 -28
- package/dist-es/commands/DescribeClusterCommand.js +21 -28
- package/dist-es/commands/DescribeFargateProfileCommand.js +21 -28
- package/dist-es/commands/DescribeIdentityProviderConfigCommand.js +21 -28
- package/dist-es/commands/DescribeNodegroupCommand.js +21 -28
- package/dist-es/commands/DescribeUpdateCommand.js +21 -28
- package/dist-es/commands/DisassociateIdentityProviderConfigCommand.js +21 -28
- package/dist-es/commands/ListAddonsCommand.js +21 -28
- package/dist-es/commands/ListClustersCommand.js +21 -28
- package/dist-es/commands/ListFargateProfilesCommand.js +21 -28
- package/dist-es/commands/ListIdentityProviderConfigsCommand.js +21 -28
- package/dist-es/commands/ListNodegroupsCommand.js +21 -28
- package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
- package/dist-es/commands/ListUpdatesCommand.js +21 -28
- package/dist-es/commands/RegisterClusterCommand.js +21 -28
- package/dist-es/commands/TagResourceCommand.js +21 -28
- package/dist-es/commands/UntagResourceCommand.js +21 -28
- package/dist-es/commands/UpdateAddonCommand.js +21 -28
- package/dist-es/commands/UpdateClusterConfigCommand.js +21 -28
- package/dist-es/commands/UpdateClusterVersionCommand.js +21 -28
- package/dist-es/commands/UpdateNodegroupConfigCommand.js +21 -28
- package/dist-es/commands/UpdateNodegroupVersionCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/EKSServiceException.js +5 -10
- package/dist-es/models/models_0.js +507 -282
- package/dist-es/pagination/DescribeAddonVersionsPaginator.js +25 -68
- package/dist-es/pagination/ListAddonsPaginator.js +25 -68
- package/dist-es/pagination/ListClustersPaginator.js +25 -68
- package/dist-es/pagination/ListFargateProfilesPaginator.js +25 -68
- package/dist-es/pagination/ListIdentityProviderConfigsPaginator.js +25 -68
- package/dist-es/pagination/ListNodegroupsPaginator.js +25 -68
- package/dist-es/pagination/ListUpdatesPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +2836 -3829
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/dist-es/waiters/waitForAddonActive.js +45 -65
- package/dist-es/waiters/waitForAddonDeleted.js +30 -50
- package/dist-es/waiters/waitForClusterActive.js +45 -65
- package/dist-es/waiters/waitForClusterDeleted.js +48 -68
- package/dist-es/waiters/waitForFargateProfileActive.js +36 -56
- package/dist-es/waiters/waitForFargateProfileDeleted.js +30 -50
- package/dist-es/waiters/waitForNodegroupActive.js +36 -56
- package/dist-es/waiters/waitForNodegroupDeleted.js +30 -50
- package/package.json +34 -34
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import packageInfo from "../package.json";
|
|
3
2
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
3
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
|
|
@@ -12,15 +11,30 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
|
12
11
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
12
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
14
13
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
export const getRuntimeConfig = (config) => {
|
|
15
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
16
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
17
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
18
|
+
return {
|
|
19
|
+
...clientSharedValues,
|
|
20
|
+
...config,
|
|
21
|
+
runtime: "browser",
|
|
22
|
+
defaultsMode,
|
|
23
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
24
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
25
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
26
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
27
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
28
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
29
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
30
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
31
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
32
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
33
|
+
sha256: config?.sha256 ?? Sha256,
|
|
34
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
35
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
36
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
37
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
38
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
39
|
+
};
|
|
26
40
|
};
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import packageInfo from "../package.json";
|
|
3
2
|
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
4
3
|
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver";
|
|
@@ -15,16 +14,35 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar
|
|
|
15
14
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
16
15
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
|
|
17
16
|
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
18
|
-
export
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
17
|
+
export const getRuntimeConfig = (config) => {
|
|
20
18
|
emitWarningIfUnsupportedVersion(process.version);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
28
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
29
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
30
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
31
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
32
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
33
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
34
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
35
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
36
|
+
retryMode: config?.retryMode ??
|
|
37
|
+
loadNodeConfig({
|
|
38
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
39
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
40
|
+
}),
|
|
41
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
42
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
43
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
45
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
46
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
47
|
+
};
|
|
30
48
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
3
2
|
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
8
11
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { parseUrl } from "@aws-sdk/url-parser";
|
|
2
2
|
import { defaultRegionInfoProvider } from "./endpoints";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : parseUrl,
|
|
12
|
-
});
|
|
13
|
-
};
|
|
3
|
+
export const getRuntimeConfig = (config) => ({
|
|
4
|
+
apiVersion: "2017-11-01",
|
|
5
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
6
|
+
logger: config?.logger ?? {},
|
|
7
|
+
regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
|
|
8
|
+
serviceId: config?.serviceId ?? "EKS",
|
|
9
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
10
|
+
});
|
|
@@ -1,69 +1,49 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
2
|
import { DescribeAddonCommand } from "../commands/DescribeAddonCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return result_1.addon.status;
|
|
17
|
-
};
|
|
18
|
-
if (returnComparator() === "CREATE_FAILED") {
|
|
19
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
try {
|
|
24
|
-
returnComparator = function () {
|
|
25
|
-
return result_1.addon.status;
|
|
26
|
-
};
|
|
27
|
-
if (returnComparator() === "DEGRADED") {
|
|
28
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (e) { }
|
|
32
|
-
try {
|
|
33
|
-
returnComparator = function () {
|
|
34
|
-
return result_1.addon.status;
|
|
35
|
-
};
|
|
36
|
-
if (returnComparator() === "ACTIVE") {
|
|
37
|
-
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (e) { }
|
|
41
|
-
return [3, 3];
|
|
42
|
-
case 2:
|
|
43
|
-
exception_1 = _a.sent();
|
|
44
|
-
reason = exception_1;
|
|
45
|
-
return [3, 3];
|
|
46
|
-
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
3
|
+
const checkState = async (client, input) => {
|
|
4
|
+
let reason;
|
|
5
|
+
try {
|
|
6
|
+
const result = await client.send(new DescribeAddonCommand(input));
|
|
7
|
+
reason = result;
|
|
8
|
+
try {
|
|
9
|
+
const returnComparator = () => {
|
|
10
|
+
return result.addon.status;
|
|
11
|
+
};
|
|
12
|
+
if (returnComparator() === "CREATE_FAILED") {
|
|
13
|
+
return { state: WaiterState.FAILURE, reason };
|
|
14
|
+
}
|
|
47
15
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}); };
|
|
57
|
-
export var waitUntilAddonActive = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var serviceDefaults, result;
|
|
59
|
-
return __generator(this, function (_a) {
|
|
60
|
-
switch (_a.label) {
|
|
61
|
-
case 0:
|
|
62
|
-
serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
63
|
-
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
64
|
-
case 1:
|
|
65
|
-
result = _a.sent();
|
|
66
|
-
return [2, checkExceptions(result)];
|
|
16
|
+
catch (e) { }
|
|
17
|
+
try {
|
|
18
|
+
const returnComparator = () => {
|
|
19
|
+
return result.addon.status;
|
|
20
|
+
};
|
|
21
|
+
if (returnComparator() === "DEGRADED") {
|
|
22
|
+
return { state: WaiterState.FAILURE, reason };
|
|
23
|
+
}
|
|
67
24
|
}
|
|
68
|
-
|
|
69
|
-
|
|
25
|
+
catch (e) { }
|
|
26
|
+
try {
|
|
27
|
+
const returnComparator = () => {
|
|
28
|
+
return result.addon.status;
|
|
29
|
+
};
|
|
30
|
+
if (returnComparator() === "ACTIVE") {
|
|
31
|
+
return { state: WaiterState.SUCCESS, reason };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) { }
|
|
35
|
+
}
|
|
36
|
+
catch (exception) {
|
|
37
|
+
reason = exception;
|
|
38
|
+
}
|
|
39
|
+
return { state: WaiterState.RETRY, reason };
|
|
40
|
+
};
|
|
41
|
+
export const waitForAddonActive = async (params, input) => {
|
|
42
|
+
const serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
43
|
+
return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
44
|
+
};
|
|
45
|
+
export const waitUntilAddonActive = async (params, input) => {
|
|
46
|
+
const serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
47
|
+
const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
48
|
+
return checkExceptions(result);
|
|
49
|
+
};
|
|
@@ -1,54 +1,34 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
2
|
import { DescribeAddonCommand } from "../commands/DescribeAddonCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return result_1.addon.status;
|
|
17
|
-
};
|
|
18
|
-
if (returnComparator() === "DELETE_FAILED") {
|
|
19
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
return [3, 3];
|
|
24
|
-
case 2:
|
|
25
|
-
exception_1 = _a.sent();
|
|
26
|
-
reason = exception_1;
|
|
27
|
-
if (exception_1.name && exception_1.name == "ResourceNotFoundException") {
|
|
28
|
-
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
29
|
-
}
|
|
30
|
-
return [3, 3];
|
|
31
|
-
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
3
|
+
const checkState = async (client, input) => {
|
|
4
|
+
let reason;
|
|
5
|
+
try {
|
|
6
|
+
const result = await client.send(new DescribeAddonCommand(input));
|
|
7
|
+
reason = result;
|
|
8
|
+
try {
|
|
9
|
+
const returnComparator = () => {
|
|
10
|
+
return result.addon.status;
|
|
11
|
+
};
|
|
12
|
+
if (returnComparator() === "DELETE_FAILED") {
|
|
13
|
+
return { state: WaiterState.FAILURE, reason };
|
|
14
|
+
}
|
|
32
15
|
}
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
40
|
-
});
|
|
41
|
-
}); };
|
|
42
|
-
export var waitUntilAddonDeleted = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
43
|
-
var serviceDefaults, result;
|
|
44
|
-
return __generator(this, function (_a) {
|
|
45
|
-
switch (_a.label) {
|
|
46
|
-
case 0:
|
|
47
|
-
serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
48
|
-
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
49
|
-
case 1:
|
|
50
|
-
result = _a.sent();
|
|
51
|
-
return [2, checkExceptions(result)];
|
|
16
|
+
catch (e) { }
|
|
17
|
+
}
|
|
18
|
+
catch (exception) {
|
|
19
|
+
reason = exception;
|
|
20
|
+
if (exception.name && exception.name == "ResourceNotFoundException") {
|
|
21
|
+
return { state: WaiterState.SUCCESS, reason };
|
|
52
22
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
23
|
+
}
|
|
24
|
+
return { state: WaiterState.RETRY, reason };
|
|
25
|
+
};
|
|
26
|
+
export const waitForAddonDeleted = async (params, input) => {
|
|
27
|
+
const serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
28
|
+
return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
29
|
+
};
|
|
30
|
+
export const waitUntilAddonDeleted = async (params, input) => {
|
|
31
|
+
const serviceDefaults = { minDelay: 10, maxDelay: 120 };
|
|
32
|
+
const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
33
|
+
return checkExceptions(result);
|
|
34
|
+
};
|
|
@@ -1,69 +1,49 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
2
|
import { DescribeClusterCommand } from "../commands/DescribeClusterCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return result_1.cluster.status;
|
|
17
|
-
};
|
|
18
|
-
if (returnComparator() === "DELETING") {
|
|
19
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
try {
|
|
24
|
-
returnComparator = function () {
|
|
25
|
-
return result_1.cluster.status;
|
|
26
|
-
};
|
|
27
|
-
if (returnComparator() === "FAILED") {
|
|
28
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (e) { }
|
|
32
|
-
try {
|
|
33
|
-
returnComparator = function () {
|
|
34
|
-
return result_1.cluster.status;
|
|
35
|
-
};
|
|
36
|
-
if (returnComparator() === "ACTIVE") {
|
|
37
|
-
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (e) { }
|
|
41
|
-
return [3, 3];
|
|
42
|
-
case 2:
|
|
43
|
-
exception_1 = _a.sent();
|
|
44
|
-
reason = exception_1;
|
|
45
|
-
return [3, 3];
|
|
46
|
-
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
3
|
+
const checkState = async (client, input) => {
|
|
4
|
+
let reason;
|
|
5
|
+
try {
|
|
6
|
+
const result = await client.send(new DescribeClusterCommand(input));
|
|
7
|
+
reason = result;
|
|
8
|
+
try {
|
|
9
|
+
const returnComparator = () => {
|
|
10
|
+
return result.cluster.status;
|
|
11
|
+
};
|
|
12
|
+
if (returnComparator() === "DELETING") {
|
|
13
|
+
return { state: WaiterState.FAILURE, reason };
|
|
14
|
+
}
|
|
47
15
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}); };
|
|
57
|
-
export var waitUntilClusterActive = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var serviceDefaults, result;
|
|
59
|
-
return __generator(this, function (_a) {
|
|
60
|
-
switch (_a.label) {
|
|
61
|
-
case 0:
|
|
62
|
-
serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
63
|
-
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
64
|
-
case 1:
|
|
65
|
-
result = _a.sent();
|
|
66
|
-
return [2, checkExceptions(result)];
|
|
16
|
+
catch (e) { }
|
|
17
|
+
try {
|
|
18
|
+
const returnComparator = () => {
|
|
19
|
+
return result.cluster.status;
|
|
20
|
+
};
|
|
21
|
+
if (returnComparator() === "FAILED") {
|
|
22
|
+
return { state: WaiterState.FAILURE, reason };
|
|
23
|
+
}
|
|
67
24
|
}
|
|
68
|
-
|
|
69
|
-
|
|
25
|
+
catch (e) { }
|
|
26
|
+
try {
|
|
27
|
+
const returnComparator = () => {
|
|
28
|
+
return result.cluster.status;
|
|
29
|
+
};
|
|
30
|
+
if (returnComparator() === "ACTIVE") {
|
|
31
|
+
return { state: WaiterState.SUCCESS, reason };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) { }
|
|
35
|
+
}
|
|
36
|
+
catch (exception) {
|
|
37
|
+
reason = exception;
|
|
38
|
+
}
|
|
39
|
+
return { state: WaiterState.RETRY, reason };
|
|
40
|
+
};
|
|
41
|
+
export const waitForClusterActive = async (params, input) => {
|
|
42
|
+
const serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
43
|
+
return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
44
|
+
};
|
|
45
|
+
export const waitUntilClusterActive = async (params, input) => {
|
|
46
|
+
const serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
47
|
+
const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
48
|
+
return checkExceptions(result);
|
|
49
|
+
};
|
|
@@ -1,72 +1,52 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
2
|
import { DescribeClusterCommand } from "../commands/DescribeClusterCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return result_1.cluster.status;
|
|
17
|
-
};
|
|
18
|
-
if (returnComparator() === "ACTIVE") {
|
|
19
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
try {
|
|
24
|
-
returnComparator = function () {
|
|
25
|
-
return result_1.cluster.status;
|
|
26
|
-
};
|
|
27
|
-
if (returnComparator() === "CREATING") {
|
|
28
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (e) { }
|
|
32
|
-
try {
|
|
33
|
-
returnComparator = function () {
|
|
34
|
-
return result_1.cluster.status;
|
|
35
|
-
};
|
|
36
|
-
if (returnComparator() === "PENDING") {
|
|
37
|
-
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (e) { }
|
|
41
|
-
return [3, 3];
|
|
42
|
-
case 2:
|
|
43
|
-
exception_1 = _a.sent();
|
|
44
|
-
reason = exception_1;
|
|
45
|
-
if (exception_1.name && exception_1.name == "ResourceNotFoundException") {
|
|
46
|
-
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
47
|
-
}
|
|
48
|
-
return [3, 3];
|
|
49
|
-
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
3
|
+
const checkState = async (client, input) => {
|
|
4
|
+
let reason;
|
|
5
|
+
try {
|
|
6
|
+
const result = await client.send(new DescribeClusterCommand(input));
|
|
7
|
+
reason = result;
|
|
8
|
+
try {
|
|
9
|
+
const returnComparator = () => {
|
|
10
|
+
return result.cluster.status;
|
|
11
|
+
};
|
|
12
|
+
if (returnComparator() === "ACTIVE") {
|
|
13
|
+
return { state: WaiterState.FAILURE, reason };
|
|
14
|
+
}
|
|
50
15
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}); };
|
|
60
|
-
export var waitUntilClusterDeleted = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
-
var serviceDefaults, result;
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0:
|
|
65
|
-
serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
66
|
-
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
67
|
-
case 1:
|
|
68
|
-
result = _a.sent();
|
|
69
|
-
return [2, checkExceptions(result)];
|
|
16
|
+
catch (e) { }
|
|
17
|
+
try {
|
|
18
|
+
const returnComparator = () => {
|
|
19
|
+
return result.cluster.status;
|
|
20
|
+
};
|
|
21
|
+
if (returnComparator() === "CREATING") {
|
|
22
|
+
return { state: WaiterState.FAILURE, reason };
|
|
23
|
+
}
|
|
70
24
|
}
|
|
71
|
-
|
|
72
|
-
|
|
25
|
+
catch (e) { }
|
|
26
|
+
try {
|
|
27
|
+
const returnComparator = () => {
|
|
28
|
+
return result.cluster.status;
|
|
29
|
+
};
|
|
30
|
+
if (returnComparator() === "PENDING") {
|
|
31
|
+
return { state: WaiterState.FAILURE, reason };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) { }
|
|
35
|
+
}
|
|
36
|
+
catch (exception) {
|
|
37
|
+
reason = exception;
|
|
38
|
+
if (exception.name && exception.name == "ResourceNotFoundException") {
|
|
39
|
+
return { state: WaiterState.SUCCESS, reason };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { state: WaiterState.RETRY, reason };
|
|
43
|
+
};
|
|
44
|
+
export const waitForClusterDeleted = async (params, input) => {
|
|
45
|
+
const serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
46
|
+
return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
47
|
+
};
|
|
48
|
+
export const waitUntilClusterDeleted = async (params, input) => {
|
|
49
|
+
const serviceDefaults = { minDelay: 30, maxDelay: 120 };
|
|
50
|
+
const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
|
51
|
+
return checkExceptions(result);
|
|
52
|
+
};
|