get and store last run time in ssm
This commit is contained in:
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
import { GetParametersByPathCommand, } from "../commands/GetParametersByPathCommand";
|
||||
import { SSMClient } from "../SSMClient";
|
||||
const makePagedClientRequest = async (client, input, ...args) => {
|
||||
return await client.send(new GetParametersByPathCommand(input), ...args);
|
||||
};
|
||||
export async function* paginateGetParametersByPath(config, input, ...additionalArguments) {
|
||||
let token = config.startingToken || undefined;
|
||||
let hasNext = true;
|
||||
let page;
|
||||
while (hasNext) {
|
||||
input.NextToken = token;
|
||||
input["MaxResults"] = config.pageSize;
|
||||
if (config.client instanceof SSMClient) {
|
||||
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
||||
}
|
||||
else {
|
||||
throw new Error("Invalid client, expected SSM | SSMClient");
|
||||
}
|
||||
yield page;
|
||||
const prevToken = token;
|
||||
token = page.NextToken;
|
||||
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user