use of com.microsoft.azuretools.telemetry.TelemetryConstants.ARM in project azure-tools-for-java by Microsoft.
the class ResourceTemplateView method updateDeployment.
private void updateDeployment() {
String oldTemplate = this.originTemplate;
String oldParameters = this.originParameters;
final AzureString title = AzureOperationBundle.title("arm|deployment.update", node.getDeployment().name());
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false, () -> {
EventUtil.executeWithLog(ARM, UPDATE_DEPLOYMENT_SHORTCUT, (operation -> {
ResourceTemplateView.this.originTemplate = getTemplate();
ResourceTemplateView.this.originParameters = getParameters();
node.getDeployment().update().withTemplate(ResourceTemplateView.this.originTemplate).withParameters(ResourceTemplateView.this.originParameters).withMode(DeploymentMode.INCREMENTAL).apply();
UIUtils.showNotification(project, NOTIFY_UPDATE_DEPLOYMENT_SUCCESS, MessageType.INFO);
}), (e) -> {
// Fall back the origin value when update fail.
ResourceTemplateView.this.originTemplate = oldTemplate;
ResourceTemplateView.this.originParameters = oldParameters;
UIUtils.showNotification(project, NOTIFY_UPDATE_DEPLOYMENT_FAIL + ", " + e.getMessage(), MessageType.ERROR);
});
}));
}
Aggregations