use of com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage in project azure-tools-for-java by Microsoft.
the class CreateFunctionAppAction method createFunctionApp.
@AzureOperation(name = "function.create_detail", params = { "config.getName()" }, type = AzureOperation.Type.ACTION)
private Single<IFunctionApp> createFunctionApp(final FunctionAppConfig config) {
final AzureString title = title("function.create_detail", config.getName());
final IntellijAzureMessager actionMessenger = new IntellijAzureMessager() {
@Override
public boolean show(IAzureMessage raw) {
if (raw.getType() != IAzureMessage.Type.INFO) {
return super.show(raw);
}
return false;
}
};
final AzureTask<IFunctionApp> task = new AzureTask<>(null, title, false, () -> {
final Operation operation = TelemetryManager.createOperation(TelemetryConstants.FUNCTION, TelemetryConstants.CREATE_FUNCTION_APP);
operation.trackProperties(config.getTelemetryProperties());
try {
AzureMessager.getContext().setMessager(actionMessenger);
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
indicator.setIndeterminate(true);
return functionAppService.createFunctionApp(config);
} finally {
operation.trackProperties(AzureTelemetry.getActionContext().getProperties());
operation.complete();
}
});
return AzureTaskManager.getInstance().runInModalAsObservable(task).toSingle().doOnSuccess(app -> {
AzureMessager.getMessager().success(message("function.create.success.message", app.name()), message("function.create.success.title"));
this.refreshAzureExplorer(app);
});
}
Aggregations