history method
Returns stack update history.
Implementation
Future<List<Map<String, dynamic>>> history({
int? pageSize,
int? page,
bool showSecrets = false,
}) async {
final args = <String>['stack', 'history', '--json', '--stack', name];
if (pageSize != null) {
args.addAll(<String>['--page-size', '$pageSize']);
}
if (page != null) {
args.addAll(<String>['--page', '$page']);
}
if (showSecrets) {
args.add('--show-secrets');
}
final result = await workspace.runPulumiCommand(args);
final decoded = jsonDecode(result.stdout);
if (decoded is! List) {
throw FormatException(
'Expected array JSON from `pulumi stack history --json`',
);
}
return decoded
.whereType<Map>()
.map((entry) => entry.map((key, value) => MapEntry('$key', value)))
.toList(growable: false);
}