Search in sources :

Example 1 with StorageAccountParameters

use of com.microsoft.azure.management.containerregistry.StorageAccountParameters in project azure-sdk-for-java by Azure.

the class RegistryImpl method handleStorageSettings.

private Observable<StorageAccountParameters> handleStorageSettings() {
    final Func1<StorageAccount, StorageAccountParameters> onStorageAccountReady = new Func1<StorageAccount, StorageAccountParameters>() {

        @Override
        public StorageAccountParameters call(StorageAccount storageAccount) {
            RegistryImpl.this.storageAccount = storageAccount;
            List<StorageAccountKey> keys = storageAccount.getKeys();
            StorageAccountParameters storageAccountParameters = new StorageAccountParameters();
            storageAccountParameters.withName(storageAccount.name());
            storageAccountParameters.withAccessKey(keys.get(0).value());
            return storageAccountParameters;
        }
    };
    if (this.creatableStorageAccountKey != null) {
        return Observable.just((StorageAccount) this.createdResource(this.creatableStorageAccountKey)).map(onStorageAccountReady);
    } else {
        return Observable.just(this.storageAccount).map(onStorageAccountReady);
    }
}
Also used : StorageAccount(com.microsoft.azure.management.storage.StorageAccount) StorageAccountKey(com.microsoft.azure.management.storage.StorageAccountKey) Func1(rx.functions.Func1) StorageAccountParameters(com.microsoft.azure.management.containerregistry.StorageAccountParameters)

Aggregations

StorageAccountParameters (com.microsoft.azure.management.containerregistry.StorageAccountParameters)1 StorageAccount (com.microsoft.azure.management.storage.StorageAccount)1 StorageAccountKey (com.microsoft.azure.management.storage.StorageAccountKey)1 Func1 (rx.functions.Func1)1