• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StorageAccount类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.microsoft.azure.management.storage.StorageAccount的典型用法代码示例。如果您正苦于以下问题:Java StorageAccount类的具体用法?Java StorageAccount怎么用?Java StorageAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StorageAccount类属于com.microsoft.azure.management.storage包,在下文中一共展示了StorageAccount类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: withNewAzureFileShareVolume

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public ContainerGroupImpl withNewAzureFileShareVolume(String volumeName, String shareName) {
    if (this.newFileShares == null || this.creatableStorageAccountKey == null) {
        StorageAccount.DefinitionStages.WithGroup definitionWithGroup = this.storageManager
            .storageAccounts()
            .define(SdkContext.randomResourceName("fs", 24))
            .withRegion(this.regionName());
        Creatable<StorageAccount> creatable;
        if (this.creatableGroup != null) {
            creatable = definitionWithGroup.withNewResourceGroup(this.creatableGroup);
        } else {
            creatable = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
        }
        this.creatableStorageAccountKey = this.addDependency(creatable);
        this.newFileShares = new HashMap<>();
    }
    this.newFileShares.put(volumeName, shareName);

    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:21,代码来源:ContainerGroupImpl.java


示例2: createResourceAsync

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public Observable<StorageAccount> createResourceAsync() {
    this.networkRulesHelper.setDefaultActionIfRequired();
    createParameters.withLocation(this.regionName());
    createParameters.withTags(this.inner().getTags());
    final StorageAccountsInner client = this.manager().inner().storageAccounts();
    return this.manager().inner().storageAccounts().createAsync(
            this.resourceGroupName(), this.name(), createParameters)
            .flatMap(new Func1<StorageAccountInner, Observable<StorageAccountInner>>() {
                @Override
                public Observable<StorageAccountInner> call(StorageAccountInner storageAccountInner) {
                    return client.getByResourceGroupAsync(resourceGroupName(), name());
                }
            })
            .map(innerToFluentMap(this))
            .doOnNext(new Action1<StorageAccount>() {
                @Override
                public void call(StorageAccount storageAccount) {
                    clearWrapperProperties();
                }
            });
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:23,代码来源:StorageAccountImpl.java


示例3: createResourceAsync

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public Observable<Registry> createResourceAsync() {
    final RegistryImpl self = this;
    if (isInCreateMode()) {
        if (self.creatableStorageAccountKey != null) {
            StorageAccount storageAccount = self.<StorageAccount>taskResult(this.creatableStorageAccountKey);
            self.inner().storageAccount().withId(storageAccount.id());
        } else if (storageAccountId != null) {
            self.inner().storageAccount().withId(storageAccountId);
        }

        return manager().inner().registries().createAsync(self.resourceGroupName(), self.name(), self.inner())
            .map(innerToFluentMap(this));
    } else {
        updateParameters.withTags(inner().getTags());
        return manager().inner().registries().updateAsync(self.resourceGroupName(), self.name(), self.updateParameters)
            .map(innerToFluentMap(this));
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:20,代码来源:RegistryImpl.java


示例4: withNewStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public RegistryImpl withNewStorageAccount(String storageAccountName) {
    this.storageAccountId = null;

    StorageAccount.DefinitionStages.WithGroup definitionWithGroup = this.storageManager
            .storageAccounts()
            .define(storageAccountName)
            .withRegion(this.regionName());
    Creatable<StorageAccount> definitionAfterGroup;
    if (this.creatableGroup != null) {
        definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup);
    } else {
        definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
    }

    return withNewStorageAccount(definitionAfterGroup);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:18,代码来源:RegistryImpl.java


示例5: handleStorageSettings

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
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());
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:18,代码来源:BatchAccountImpl.java


示例6: beforeGroupCreateOrUpdate

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public void beforeGroupCreateOrUpdate() {
    // [1]. StorageProfile: If implicit storage account creation is required then add Creatable<StorageAccount>.
    //
    if (creatableStorageAccountKey == null && existingStorageAccountToAssociate == null) {
        if (osDiskRequiresImplicitStorageAccountCreation()
                || dataDisksRequiresImplicitStorageAccountCreation()) {
            Creatable<StorageAccount> storageAccountCreatable = null;
            if (this.creatableGroup != null) {
                storageAccountCreatable = this.storageManager.storageAccounts()
                        .define(this.namer.randomName("stg", 24).replace("-", ""))
                        .withRegion(this.regionName())
                        .withNewResourceGroup(this.creatableGroup);
            } else {
                storageAccountCreatable = this.storageManager.storageAccounts()
                        .define(this.namer.randomName("stg", 24).replace("-", ""))
                        .withRegion(this.regionName())
                        .withExistingResourceGroup(this.resourceGroupName());
            }
            this.creatableStorageAccountKey = this.addDependency(storageAccountCreatable);
        }
    }
    // [2]. BootDiagnosticsProfile: If any implicit resource creation is required then add Creatable<?>.
    //
    this.bootDiagnosticsHandler.prepare();
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:27,代码来源:VirtualMachineImpl.java


示例7: canEnableBootDiagnosticsWithCreatableStorageOnManagedVMCreation

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Test
public void canEnableBootDiagnosticsWithCreatableStorageOnManagedVMCreation() {
    final String storageName = SdkContext.randomResourceName("st", 14);
    Creatable<StorageAccount> creatableStorageAccount = storageManager.storageAccounts()
            .define(storageName)
            .withRegion(REGION)
            .withNewResourceGroup(RG_NAME);

    VirtualMachine virtualMachine = computeManager.virtualMachines()
            .define(VMNAME)
            .withRegion(REGION)
            .withNewResourceGroup(RG_NAME)
            .withNewPrimaryNetwork("10.0.0.0/28")
            .withPrimaryPrivateIPAddressDynamic()
            .withoutPrimaryPublicIPAddress()
            .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
            .withRootUsername("Foo12")
            .withRootPassword("[email protected]#F0orL")
            .withBootDiagnostics(creatableStorageAccount)
            .create();
    Assert.assertNotNull(virtualMachine);
    Assert.assertTrue(virtualMachine.isBootDiagnosticsEnabled());
    Assert.assertNotNull(virtualMachine.bootDiagnosticsStorageUri());
    Assert.assertTrue(virtualMachine.bootDiagnosticsStorageUri().contains(storageName));
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:26,代码来源:VirtualMachineBootDiagnosticsTests.java


示例8: withNewStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public FunctionAppImpl withNewStorageAccount(String name, SkuName sku) {
    StorageAccount.DefinitionStages.WithGroup storageDefine = manager().storageManager().storageAccounts()
        .define(name)
        .withRegion(regionName());
    if (super.creatableGroup != null && isInCreateMode()) {
        storageAccountCreatable = storageDefine.withNewResourceGroup(super.creatableGroup)
            .withGeneralPurposeAccountKind()
            .withSku(sku);
    } else {
        storageAccountCreatable = storageDefine.withExistingResourceGroup(resourceGroupName())
            .withGeneralPurposeAccountKind()
            .withSku(sku);
    }
    this.addDependency(storageAccountCreatable);
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:18,代码来源:FunctionAppImpl.java


示例9: createStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
public StorageAccount createStorageAccount(String resourceGroup, String storageName, String storageLocation, SkuName accType, Boolean encryted,
        Map<String, String> tags, Map<String, String> costFollowerTags) {
    Map<String, String> resultTags = new HashMap<>();
    for (Map.Entry<String, String> entry : costFollowerTags.entrySet()) {
        resultTags.put(entry.getKey(), entry.getValue());
    }
    resultTags.putAll(tags);
    return handleAuthException(() -> {
        StorageAccount.DefinitionStages.WithCreate withCreate = azure.storageAccounts()
                .define(storageName)
                .withRegion(storageLocation)
                .withExistingResourceGroup(resourceGroup)
                .withTags(resultTags)
                .withSku(accType);
        if (encryted) {
            withCreate.withEncryption();
        }

        return withCreate.create();
    });
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:22,代码来源:AzureClient.java


示例10: createInner

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
protected Observable<ContainerGroupInner> createInner() {
    final ContainerGroupImpl self = this;

    if (!isInCreateMode()) {
        throw new UnsupportedOperationException("Update on an existing container group resource is not supported");
    } else if (newFileShares == null || creatableStorageAccountKey == null) {
        return this.manager().inner().containerGroups().createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner());
    } else {
        final StorageAccount storageAccount = this.<StorageAccount>taskResult(this.creatableStorageAccountKey);
        return createFileShareAsync(storageAccount)
            .collect(new Func0<List<Triple<String, String, String>>>() {
                @Override
                public List<Triple<String, String, String>> call() {
                    return new ArrayList<>();
                }
            }, new Action2<List<Triple<String, String, String>>, Triple<String, String, String>>() {
                @Override
                public void call(List<Triple<String, String, String>> cloudFileShares, Triple<String, String, String> fileShare) {
                    cloudFileShares.add(fileShare);
                }
            })
            .flatMap(new Func1<List<Triple<String, String, String>>, Observable<? extends ContainerGroupInner>>() {
                @Override
                public Observable<? extends ContainerGroupInner> call(List<Triple<String, String, String>> fileShares) {
                    for (Triple<String, String, String> fileShareEntry : fileShares) {
                        self.defineVolume(fileShareEntry.getLeft())
                            .withExistingReadWriteAzureFileShare(fileShareEntry.getMiddle())
                            .withStorageAccountName(storageAccount.name())
                            .withStorageAccountKey(fileShareEntry.getRight())
                            .attach();
                    }
                    return self.manager().inner().containerGroups().createOrUpdateAsync(self.resourceGroupName(), self.name(), self.inner());
                }
            });
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:38,代码来源:ContainerGroupImpl.java


示例11: createFileShareAsync

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
private Observable<Triple<String, String, String>> createFileShareAsync(final StorageAccount storageAccount) {
    return storageAccount.getKeysAsync()
        .map(new Func1<List<StorageAccountKey>, String>() {
            @Override
            public String call(List<StorageAccountKey> storageAccountKeys) {
                return storageAccountKeys.get(0).value();
            }
        })
    .flatMap(new Func1<String, Observable<Triple<String, String, String>>>() {
        CloudFileClient cloudFileClient;
        @Override
        public Observable<Triple<String, String, String>> call(final String storageAccountKey) {
            try {
                cloudFileClient = CloudStorageAccount.parse(String.format("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=core.windows.net",
                    storageAccount.name(),
                    storageAccountKey))
                    .createCloudFileClient();
            } catch (URISyntaxException syntaxException) {
                throw Exceptions.propagate(syntaxException);
            } catch (InvalidKeyException keyException) {
                throw Exceptions.propagate(keyException);
            }
            return Observable.from(newFileShares.entrySet())
                .flatMap(new Func1<Map.Entry<String, String>, Observable<Triple<String, String, String>>>() {
                    @Override
                    public Observable<Triple<String, String, String>> call(Map.Entry<String, String> fileShareEntry) {
                        return createSingleFileShareAsync(cloudFileClient, fileShareEntry.getKey(), fileShareEntry.getValue(), storageAccountKey);
                    }
                });
        }
    });
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:33,代码来源:ContainerGroupImpl.java


示例12: refreshAsync

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public Observable<StorageAccount> refreshAsync() {
    return super.refreshAsync().map(new Func1<StorageAccount, StorageAccount>() {
        @Override
        public StorageAccount call(StorageAccount storageAccount) {
            StorageAccountImpl impl = (StorageAccountImpl) storageAccount;
            impl.clearWrapperProperties();
            return impl;
        }
    });
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:12,代码来源:StorageAccountImpl.java


示例13: updateResourceAsync

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public Observable<StorageAccount> updateResourceAsync() {
    this.networkRulesHelper.setDefaultActionIfRequired();
    updateParameters.withTags(this.inner().getTags());
    return this.manager().inner().storageAccounts().updateAsync(
            resourceGroupName(), name(), updateParameters)
            .map(innerToFluentMap(this))
            .doOnNext(new Action1<StorageAccount>() {
                @Override
                public void call(StorageAccount storageAccount) {
                    clearWrapperProperties();
                }
            });
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:StorageAccountImpl.java


示例14: withNewStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public BatchAccountImpl withNewStorageAccount(Creatable<StorageAccount> creatable) {
    // This method's effect is NOT additive.
    if (this.creatableStorageAccountKey == null) {
        this.creatableStorageAccountKey = this.addDependency(creatable);
    }
    this.existingStorageAccountToAssociate = null;
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:10,代码来源:BatchAccountImpl.java


示例15: withNewStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public VirtualMachineScaleSetImpl withNewStorageAccount(String name) {
    StorageAccount.DefinitionStages.WithGroup definitionWithGroup = this.storageManager
            .storageAccounts()
            .define(name)
            .withRegion(this.regionName());
    Creatable<StorageAccount> definitionAfterGroup;
    if (this.creatableGroup != null) {
        definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup);
    } else {
        definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
    }
    return withNewStorageAccount(definitionAfterGroup);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:VirtualMachineScaleSetImpl.java


示例16: prepareOSDiskContainers

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
protected void prepareOSDiskContainers() {
    if (isManagedDiskEnabled()) {
        return;
    }
    final VirtualMachineScaleSetStorageProfile storageProfile = inner()
            .virtualMachineProfile()
            .storageProfile();
    if (isOSDiskFromStoredImage(storageProfile)) {
        // There is a restriction currently that virtual machine's disk cannot be stored in multiple storage
        // accounts if scale set is based on stored image. Remove this check once azure start supporting it.
        //
        return;
    }
    if (this.isInCreateMode()
            && this.creatableStorageAccountKeys.isEmpty()
            && this.existingStorageAccountsToAssociate.isEmpty()) {
        String accountName = this.namer.randomName("stg", 24).replace("-", "");
        Creatable<StorageAccount> storageAccountCreatable;
        if (this.creatableGroup != null) {
            storageAccountCreatable = this.storageManager.storageAccounts()
                    .define(accountName)
                    .withRegion(this.regionName())
                    .withNewResourceGroup(this.creatableGroup);
        } else {
            storageAccountCreatable = this.storageManager.storageAccounts()
                    .define(accountName)
                    .withRegion(this.regionName())
                    .withExistingResourceGroup(this.resourceGroupName());
        }
        this.creatableStorageAccountKeys.add(this.addDependency(storageAccountCreatable));
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:33,代码来源:VirtualMachineScaleSetImpl.java


示例17: withBootDiagnostics

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
BootDiagnosticsHandler withBootDiagnostics(Creatable<StorageAccount> creatable) {
    // Diagnostics storage uri will be set later by this.handleDiagnosticsSettings(..)
    //
    this.enableDisable(true);
    this.creatableDiagnosticsStorageAccountKey = this.vmssImpl.addDependency(creatable);
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:8,代码来源:VirtualMachineScaleSetImpl.java


示例18: handleDiagnosticsSettings

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
void handleDiagnosticsSettings() {
    DiagnosticsProfile diagnosticsProfile = this.vmssInner().virtualMachineProfile().diagnosticsProfile();
    if (diagnosticsProfile == null
            || diagnosticsProfile.bootDiagnostics() == null
            || diagnosticsProfile.bootDiagnostics().storageUri() != null) {
        return;
    }
    boolean enableBD = Utils.toPrimitiveBoolean(diagnosticsProfile.bootDiagnostics().enabled());
    if (!enableBD) {
        return;
    }
    StorageAccount storageAccount = null;
    if (creatableDiagnosticsStorageAccountKey != null) {
        storageAccount = this.vmssImpl.<StorageAccount>taskResult(creatableDiagnosticsStorageAccountKey);
    } else if (this.creatableStorageAccountKey != null) {
        storageAccount = this.vmssImpl.<StorageAccount>taskResult(this.creatableStorageAccountKey);
    } else if (this.existingStorageAccountToAssociate != null) {
        storageAccount = this.existingStorageAccountToAssociate;
    }
    if (storageAccount == null) {
        throw new IllegalStateException("Unable to retrieve expected storageAccount instance for BootDiagnostics");
    }
    vmssInner()
            .virtualMachineProfile()
            .diagnosticsProfile()
            .bootDiagnostics()
            .withStorageUri(storageAccount.endPoints().primary().blob());
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:29,代码来源:VirtualMachineScaleSetImpl.java


示例19: withNewStorageAccount

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
@Override
public VirtualMachineImpl withNewStorageAccount(Creatable<StorageAccount> creatable) {
    // This method's effect is NOT additive.
    if (this.creatableStorageAccountKey == null) {
        this.creatableStorageAccountKey = this.addDependency(creatable);
    }
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:9,代码来源:VirtualMachineImpl.java


示例20: handleUnManagedOSAndDataDisksStorageSettings

import com.microsoft.azure.management.storage.StorageAccount; //导入依赖的package包/类
/**
 * Prepare virtual machine disks profile (StorageProfile).
 */
private void handleUnManagedOSAndDataDisksStorageSettings() {
    if (isManagedDiskEnabled()) {
        // NOP if the virtual machine is based on managed disk (managed and un-managed disk cannot be mixed)
        return;
    }
    StorageAccount storageAccount = null;
    if (this.creatableStorageAccountKey != null) {
        storageAccount = this.<StorageAccount>taskResult(this.creatableStorageAccountKey);
    } else if (this.existingStorageAccountToAssociate != null) {
        storageAccount = this.existingStorageAccountToAssociate;
    }
    if (isInCreateMode()) {
        if (storageAccount != null) {
            if (isOSDiskFromPlatformImage(inner().storageProfile())) {
                String uri = inner()
                        .storageProfile()
                        .osDisk().vhd().uri()
                        .replaceFirst("\\{storage-base-url}", storageAccount.endPoints().primary().blob());
                inner().storageProfile().osDisk().vhd().withUri(uri);
            }
            UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, storageAccount, vmName);
        }
    } else {    // Update Mode
        if (storageAccount != null) {
            UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, storageAccount, vmName);
        } else {
            UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, vmName);
        }
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:34,代码来源:VirtualMachineImpl.java



注:本文中的com.microsoft.azure.management.storage.StorageAccount类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WSDLService类代码示例发布时间:2022-05-23
下一篇:
Java AutoFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap