/** * Get the blob endpoint substring with prefix and suffix. * * @param storageAccount * @param startKey uses to get the start position of sub string, * if it's null or empty then whole input string will be used * @param prefix the prefix of substring will be added, if it's null or empty then it will not be added' * @param suffix the suffix will be append to substring if substring doesn't contain it, * if it's null or empty then it will not be added * @return endpointSuffix */ private static String getBlobEndPointSuffix( StorageAccount storageAccount, String startKey, String prefix, String suffix) { String endpointSuffix = null; if (storageAccount != null) { String blobUri = storageAccount.endPoints().primary().blob().toLowerCase(); endpointSuffix = getSubString(blobUri, startKey, prefix, suffix); } return endpointSuffix; }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); }
protected static void ensureDisksVhdUri(List<VirtualMachineUnmanagedDataDisk> dataDisks, StorageAccount storageAccount, String namePrefix) { for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY || dataDisk.creationMethod() == DiskCreateOptionTypes.FROM_IMAGE) { //New empty and from image data disk requires Vhd Uri to be set if (dataDisk.inner().vhd() == null) { dataDisk.inner().withVhd(new VirtualHardDisk()); dataDisk.inner().vhd().withUri(storageAccount.endPoints().primary().blob() + "vhds/" + namePrefix + "-data-disk-" + dataDisk.lun() + "-" + UUID.randomUUID().toString() + ".vhd"); } } } }
protected static void ensureDisksVhdUri(List<VirtualMachineUnmanagedDataDisk> dataDisks, StorageAccount storageAccount, String namePrefix) { for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY || dataDisk.creationMethod() == DiskCreateOptionTypes.FROM_IMAGE) { //New empty and from image data disk requires Vhd Uri to be set if (dataDisk.inner().vhd() == null) { dataDisk.inner().withVhd(new VirtualHardDisk()); dataDisk.inner().vhd().withUri(storageAccount.endPoints().primary().blob() + "vhds/" + namePrefix + "-data-disk-" + dataDisk.lun() + "-" + UUID.randomUUID().toString() + ".vhd"); } } } }
void handleDiagnosticsSettings() { DiagnosticsProfile diagnosticsProfile = this.vmInner().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.vmImpl.<StorageAccount>taskResult(creatableDiagnosticsStorageAccountKey); } else if (this.vmImpl.creatableStorageAccountKey != null) { storageAccount = this.vmImpl.<StorageAccount>taskResult(this.vmImpl.creatableStorageAccountKey); } else if (this.vmImpl.existingStorageAccountToAssociate != null) { storageAccount = this.vmImpl.existingStorageAccountToAssociate; } if (storageAccount == null) { throw new IllegalStateException("Unable to retrieve expected storageAccount instance for BootDiagnostics"); } vmInner() .diagnosticsProfile() .bootDiagnostics() .withStorageUri(storageAccount.endPoints().primary().blob()); }
void handleDiagnosticsSettings() { DiagnosticsProfile diagnosticsProfile = this.vmInner().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.vmImpl.<StorageAccount>taskResult(creatableDiagnosticsStorageAccountKey); } else if (this.vmImpl.creatableStorageAccountKey != null) { storageAccount = this.vmImpl.<StorageAccount>taskResult(this.vmImpl.creatableStorageAccountKey); } else if (this.vmImpl.existingStorageAccountToAssociate != null) { storageAccount = this.vmImpl.existingStorageAccountToAssociate; } if (storageAccount == null) { throw new IllegalStateException("Unable to retrieve expected storageAccount instance for BootDiagnostics"); } vmInner() .diagnosticsProfile() .bootDiagnostics() .withStorageUri(storageAccount.endPoints().primary().blob()); }
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()); }
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()); }
.storageProfile() .osDisk().vhd().uri() .replaceFirst("\\{storage-base-url}", storageAccount.endPoints().primary().blob()); inner().storageProfile().osDisk().vhd().withUri(uri);
.storageProfile() .osDisk().vhd().uri() .replaceFirst("\\{storage-base-url}", storageAccount.endPoints().primary().blob()); inner().storageProfile().osDisk().vhd().withUri(uri);