private static String buildConnectionString(StorageAccount storageAccount, Environment environment) { return storageAccount.getKeys().stream().findFirst().map(key -> StorageConnectionStringBuilder .build(storageAccount.name(), key.value(), environment)) .orElseThrow(() -> new RuntimeException("Storage account key is empty.")); }
@Override public Observable<Indexable> call(final Context context) { return storageAccount.getKeysAsync() .flatMap(new Func1<List<StorageAccountKey>, Observable<StorageAccountKey>>() { @Override public Observable<StorageAccountKey> call(List<StorageAccountKey> storageAccountKeys) { return Observable.from(storageAccountKeys).first(); } }) .flatMap(new Func1<StorageAccountKey, Observable<Indexable>>() { @Override public Observable<Indexable> call(StorageAccountKey storageAccountKey) { self.importRequestInner.withStorageUri(String.format("%s%s/%s", storageAccount.endPoints().primary().blob(), containerName, fileName)); self.importRequestInner.withStorageKeyType(StorageKeyType.STORAGE_ACCESS_KEY); self.importRequestInner.withStorageKey(storageAccountKey.value()); return context.voidObservable(); } }); } });
@Override public RegistryImpl withExistingStorageAccount(StorageAccount storageAccount) { this.storageAccountId = storageAccount.id(); return this; }
@Override public String getToolTip() { return storageAccount.name() + "\n" + storageAccount.regionName() + "<br>" + storageAccount.resourceGroupName(); }
@Override public Map<String, String> toProperties() { final Map<String, String> properties = new HashMap<>(); properties.put(AppInsightsConstants.SubscriptionId, ResourceId.fromString(this.storageAccount.id()).subscriptionId()); properties.put(AppInsightsConstants.Region, this.storageAccount.regionName()); return properties; }
public QueueModule(ClientStorageNode parent, StorageAccount storageAccount) { super(QUEUES + storageAccount.name(), QUEUES, parent, null); this.storageAccount = storageAccount; this.parent = parent; }
public static List<AzureDockerStorageAccount> getStorageAccounts(Azure azureClient) { List<AzureDockerStorageAccount> result = new ArrayList<>(); if (azureClient != null) { for (StorageAccount storageAccount : azureClient.storageAccounts().list()) { AzureDockerStorageAccount dockerStorageAccount = new AzureDockerStorageAccount(); dockerStorageAccount.name = storageAccount.name(); dockerStorageAccount.region = storageAccount.regionName(); dockerStorageAccount.resourceGroup = storageAccount.resourceGroupName(); dockerStorageAccount.sid = azureClient.subscriptionId(); dockerStorageAccount.skuType = storageAccount.sku().name().name(); result.add(dockerStorageAccount); } } return result; }
public static List<String> getAvailableStorageAccounts(Azure azureClient, String vmImageSizeType) { List<String> result = new ArrayList<>(); if (azureClient != null) { for (StorageAccount storageAccount : azureClient.storageAccounts().list()) { if (vmImageSizeType != null) { if (storageAccount.sku().name().name().toLowerCase().equals(vmImageSizeType.toLowerCase())) { result.add(storageAccount.name()); } } else { result.add(storageAccount.name()); } } } return result; }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
@Override protected void azureNodeAction(NodeActionEvent e) throws AzureCmdException { try { AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager(); // not signed in if (azureManager == null) { return; } Azure azure = azureManager.getAzure(subscriptionId); azure.storageAccounts().deleteByResourceGroup(storageAccount.resourceGroupName(), storageAccount.name()); DefaultLoader.getIdeHelper().invokeLater(new Runnable() { @Override public void run() { // instruct parent node to remove this node getParent().removeDirectChildNode(StorageNode.this); } }); } catch (Exception ex) { DefaultLoader.getUIHelper().showException("An error occurred while attempting to delete storage account.", ex, "MS Services - Error Deleting Storage Account", false, true); } }
.getKeys(); if (storageKeys.isEmpty()) { throw AzureCloudException.create("AzureVMManagementServiceDelegate: createDeployment: "
public TableModule(ClientStorageNode parent, StorageAccount storageAccount) { super(TABLES + storageAccount.name(), TABLES, parent, null); this.storageAccount = storageAccount; this.parent = parent; }
@Override public Map<String, String> toProperties() { final Map<String, String> properties = new HashMap<>(); properties.put(AppInsightsConstants.SubscriptionId, ResourceId.fromString(this.storageAccount.id()).subscriptionId()); properties.put(AppInsightsConstants.Region, this.storageAccount.regionName()); return properties; }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
public BlobModule(ClientStorageNode parent, StorageAccount storageAccount) { super(BLOBS + storageAccount.name(), BLOBS, parent, null); this.parent = parent; this.storageAccount = storageAccount; }
private Observable<Indexable> getOrCreateStorageAccountContainer(final StorageAccount storageAccount, final String containerName, final String fileName, final FunctionalTaskItem.Context context) { final SqlDatabaseImportRequestImpl self = this; return storageAccount.getKeysAsync() .flatMap(new Func1<List<StorageAccountKey>, Observable<StorageAccountKey>>() { @Override public Observable<StorageAccountKey> call(List<StorageAccountKey> storageAccountKeys) { return Observable.from(storageAccountKeys).first(); } }) .flatMap(new Func1<StorageAccountKey, Observable<Indexable>>() { @Override public Observable<Indexable> call(StorageAccountKey storageAccountKey) { self.inner.withStorageUri(String.format("%s%s/%s", storageAccount.endPoints().primary().blob(), containerName, fileName)); self.inner.withStorageKeyType(StorageKeyType.STORAGE_ACCESS_KEY); self.inner.withStorageKey(storageAccountKey.value()); return context.voidObservable(); } }); }
private void handleStorageSettings() { StorageAccount storageAccount; if (this.creatableStorageAccountKey != null) { storageAccount = this.<StorageAccount>taskResult(this.creatableStorageAccountKey); existingStorageAccountToAssociate = storageAccount; } else if (this.existingStorageAccountToAssociate != null) { storageAccount = this.existingStorageAccountToAssociate; } else { return; } if (autoStorage == null) { autoStorage = new AutoStorageProperties(); } autoStorage.withStorageAccountId(storageAccount.id()); }
@Override public Map<String, String> toProperties() { final Map<String, String> properties = new HashMap<>(); properties.put(AppInsightsConstants.SubscriptionId, ResourceId.fromString(this.storageAccount.id()).subscriptionId()); properties.put(AppInsightsConstants.Region, this.storageAccount.regionName()); return properties; }