Search in sources :

Example 1 with CREATE_STORAGE_ACCOUNT

use of com.microsoft.azuretools.telemetry.TelemetryConstants.CREATE_STORAGE_ACCOUNT in project azure-tools-for-java by Microsoft.

the class CreateArmStorageAccountAction method actionPerformed.

@Override
public void actionPerformed(NodeActionEvent e) {
    SignInCommandHandler.requireSignedIn(PluginUtil.getParentShell(), () -> {
        CreateArmStorageAccountForm createStorageAccountForm = new CreateArmStorageAccountForm(PluginUtil.getParentShell(), null, null);
        createStorageAccountForm.setOnCreate(() -> {
            AzureTaskManager.getInstance().runInBackground("Creating storage account " + createStorageAccountForm.getStorageAccount().getName() + "...", new Runnable() {

                @Override
                public void run() {
                    EventUtil.executeWithLog(STORAGE, CREATE_STORAGE_ACCOUNT, (operation) -> {
                        createStorageAccount(createStorageAccountForm.getStorageAccount());
                        storageModule.load(false);
                    }, (e) -> AzureTaskManager.getInstance().runLater(() -> PluginUtil.displayErrorDialog(PluginUtil.getParentShell(), Messages.err, "An error occurred while creating the storage account: " + e.getMessage())));
                }
            });
        });
        createStorageAccountForm.open();
    });
}
Also used : NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) Azure(com.microsoft.azure.toolkit.lib.Azure) Messages(com.microsoft.azuretools.core.utils.Messages) AzureStorageAccount(com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount) Name(com.microsoft.tooling.msservices.helpers.Name) ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup) StorageAccountConfig(com.microsoft.azure.toolkit.lib.storage.model.StorageAccountConfig) CREATE_STORAGE_ACCOUNT(com.microsoft.azuretools.telemetry.TelemetryConstants.CREATE_STORAGE_ACCOUNT) SignInCommandHandler(com.microsoft.azuretools.core.handlers.SignInCommandHandler) AzureTelemetry(com.microsoft.azure.toolkit.lib.common.telemetry.AzureTelemetry) Draft(com.microsoft.azuretools.azureexplorer.forms.common.Draft) CreateArmStorageAccountForm(com.microsoft.azuretools.azureexplorer.forms.CreateArmStorageAccountForm) StorageModule(com.microsoft.tooling.msservices.serviceexplorer.azure.storage.StorageModule) PluginUtil(com.microsoft.azuretools.core.utils.PluginUtil) AzureGroup(com.microsoft.azure.toolkit.lib.resource.AzureGroup) StorageAccount(com.microsoft.azure.toolkit.lib.storage.service.StorageAccount) STORAGE(com.microsoft.azuretools.telemetry.TelemetryConstants.STORAGE) EventUtil(com.microsoft.azuretools.telemetrywrapper.EventUtil) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) AzureTaskManager(com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager) CreateArmStorageAccountForm(com.microsoft.azuretools.azureexplorer.forms.CreateArmStorageAccountForm)

Aggregations

Azure (com.microsoft.azure.toolkit.lib.Azure)1 ResourceGroup (com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 AzureTelemetry (com.microsoft.azure.toolkit.lib.common.telemetry.AzureTelemetry)1 AzureGroup (com.microsoft.azure.toolkit.lib.resource.AzureGroup)1 StorageAccountConfig (com.microsoft.azure.toolkit.lib.storage.model.StorageAccountConfig)1 AzureStorageAccount (com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount)1 StorageAccount (com.microsoft.azure.toolkit.lib.storage.service.StorageAccount)1 CreateArmStorageAccountForm (com.microsoft.azuretools.azureexplorer.forms.CreateArmStorageAccountForm)1 Draft (com.microsoft.azuretools.azureexplorer.forms.common.Draft)1 SignInCommandHandler (com.microsoft.azuretools.core.handlers.SignInCommandHandler)1 Messages (com.microsoft.azuretools.core.utils.Messages)1 PluginUtil (com.microsoft.azuretools.core.utils.PluginUtil)1 CREATE_STORAGE_ACCOUNT (com.microsoft.azuretools.telemetry.TelemetryConstants.CREATE_STORAGE_ACCOUNT)1 STORAGE (com.microsoft.azuretools.telemetry.TelemetryConstants.STORAGE)1 EventUtil (com.microsoft.azuretools.telemetrywrapper.EventUtil)1 Name (com.microsoft.tooling.msservices.helpers.Name)1 NodeActionEvent (com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)1 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)1 StorageModule (com.microsoft.tooling.msservices.serviceexplorer.azure.storage.StorageModule)1