function clusterInfo = shutdownCloudClusterAfter(clusterID, numSeconds)
% Shutdown cluster after numSeconds seconds.

%   Copyright 2020 The MathWorks, Inc.

cloudCenterClient = parallel.internal.cloud.currentCloudCenterClient();
terminationPolicy = parallel.internal.types.TerminationPolicy.Fixed;
shutdownCloudClusterFcn = @() cloudCenterClient.updateClusterShutdown(clusterID, ...
                              terminationPolicy.toCloudCenterName(), numSeconds);
clusterInfoWithMessages = parallel.internal.mwa.invokeWithLogin(shutdownCloudClusterFcn);
parallel.internal.cloud.checkAndIssueWebServiceWarnings(clusterInfoWithMessages);

clusterInfo = clusterInfoWithMessages.data;
end