private boolean isInUpdateMode() { return !this.isInCreateMode(); }
private boolean isInUpdateMode() { return !this.isInCreateMode(); }
private void setHardwareProfileDefaults() { if (!isInCreateMode()) { return; } HardwareProfile hardwareProfile = this.inner().hardwareProfile(); if (hardwareProfile.vmSize() == null) { hardwareProfile.withVmSize(VirtualMachineSizeTypes.BASIC_A0); } }
private void setHardwareProfileDefaults() { if (!isInCreateMode()) { return; } HardwareProfile hardwareProfile = this.inner().hardwareProfile(); if (hardwareProfile.vmSize() == null) { hardwareProfile.withVmSize(VirtualMachineSizeTypes.BASIC_A0); } }
private boolean osDiskRequiresImplicitStorageAccountCreation() { if (isManagedDiskEnabled()) { return false; } if (this.creatableStorageAccountKey != null || this.existingStorageAccountToAssociate != null || !isInCreateMode()) { return false; } return isOSDiskFromPlatformImage(this.inner().storageProfile()); }
private boolean osDiskRequiresImplicitStorageAccountCreation() { if (isManagedDiskEnabled()) { return false; } if (this.creatableStorageAccountKey != null || this.existingStorageAccountToAssociate != null || !isInCreateMode()) { return false; } return isOSDiskFromPlatformImage(this.inner().storageProfile()); }
@Override public VirtualMachineImpl withAvailabilityZone(AvailabilityZoneId zoneId) { if (isInCreateMode()) { // Note: Zone is not updatable as of now, so this is available only during definition time. // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new // zone or remove one. Trying to remove the last one means attempt to change resource from // zonal to regional, which is not supported. // // though not updatable, still adding above 'isInCreateMode' check just as a reminder to // take special handling of 'implicitPipCreatable' when avail zone update is supported. // if (this.inner().zones() == null) { this.inner().withZones(new ArrayList<String>()); } this.inner().zones().add(zoneId.toString()); // zone aware VM can be attached to only zone aware public IP. // if (this.implicitPipCreatable != null) { this.implicitPipCreatable.withAvailabilityZone(zoneId); } } return this; }
@Override public VirtualMachineImpl withAvailabilityZone(AvailabilityZoneId zoneId) { if (isInCreateMode()) { // Note: Zone is not updatable as of now, so this is available only during definition time. // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new // zone or remove one. Trying to remove the last one means attempt to change resource from // zonal to regional, which is not supported. // // though not updatable, still adding above 'isInCreateMode' check just as a reminder to // take special handling of 'implicitPipCreatable' when avail zone update is supported. // if (this.inner().zones() == null) { this.inner().withZones(new ArrayList<String>()); } this.inner().zones().add(zoneId.toString()); // zone aware VM can be attached to only zone aware public IP. // if (this.implicitPipCreatable != null) { this.implicitPipCreatable.withAvailabilityZone(zoneId); } } return this; }
if (isInCreateMode()) { return hasEmptyVhd;
if (isInCreateMode()) { return hasEmptyVhd;
private void handleAvailabilitySettings() { if (!isInCreateMode()) { return; } AvailabilitySet availabilitySet = null; if (this.creatableAvailabilitySetKey != null) { availabilitySet = this.<AvailabilitySet>taskResult(this.creatableAvailabilitySetKey); } else if (this.existingAvailabilitySetToAssociate != null) { availabilitySet = this.existingAvailabilitySetToAssociate; } if (availabilitySet != null) { if (this.inner().availabilitySet() == null) { this.inner().withAvailabilitySet(new SubResource()); } this.inner().availabilitySet().withId(availabilitySet.id()); } }
private void handleAvailabilitySettings() { if (!isInCreateMode()) { return; } AvailabilitySet availabilitySet = null; if (this.creatableAvailabilitySetKey != null) { availabilitySet = this.<AvailabilitySet>taskResult(this.creatableAvailabilitySetKey); } else if (this.existingAvailabilitySetToAssociate != null) { availabilitySet = this.existingAvailabilitySetToAssociate; } if (availabilitySet != null) { if (this.inner().availabilitySet() == null) { this.inner().withAvailabilitySet(new SubResource()); } this.inner().availabilitySet().withId(availabilitySet.id()); } }
private void handleNetworkSettings() { if (isInCreateMode()) { NetworkInterface primaryNetworkInterface = null; if (this.creatablePrimaryNetworkInterfaceKey != null) {
private void handleNetworkSettings() { if (isInCreateMode()) { NetworkInterface primaryNetworkInterface = null; if (this.creatablePrimaryNetworkInterfaceKey != null) {
storageAccount = this.existingStorageAccountToAssociate; if (isInCreateMode()) { if (storageAccount != null) { if (isOSDiskFromPlatformImage(inner().storageProfile())) {
storageAccount = this.existingStorageAccountToAssociate; if (isInCreateMode()) { if (storageAccount != null) { if (isOSDiskFromPlatformImage(inner().storageProfile())) {
@Override public boolean isManagedDiskEnabled() { if (isOsDiskFromCustomImage(this.inner().storageProfile())) { return true; } if (isOSDiskAttachedManaged(this.inner().storageProfile().osDisk())) { return true; } if (isOSDiskFromStoredImage(this.inner().storageProfile())) { return false; } if (isOSDiskAttachedUnmanaged(this.inner().storageProfile().osDisk())) { return false; } if (isOSDiskFromPlatformImage(this.inner().storageProfile())) { if (this.isUnmanagedDiskSelected) { return false; } } if (isInCreateMode()) { return true; } else { return this.inner().storageProfile().osDisk().vhd() == null; } }
@Override public boolean isManagedDiskEnabled() { if (isOsDiskFromCustomImage(this.inner().storageProfile())) { return true; } if (isOSDiskAttachedManaged(this.inner().storageProfile().osDisk())) { return true; } if (isOSDiskFromStoredImage(this.inner().storageProfile())) { return false; } if (isOSDiskAttachedUnmanaged(this.inner().storageProfile().osDisk())) { return false; } if (isOSDiskFromPlatformImage(this.inner().storageProfile())) { if (this.isUnmanagedDiskSelected) { return false; } } if (isInCreateMode()) { return true; } else { return this.inner().storageProfile().osDisk().vhd() == null; } }