@Override public String windowsTimeZone() { if (this.inner().osProfile().windowsConfiguration() != null) { return this.inner().osProfile().windowsConfiguration().timeZone(); } return null; }
@Override public String windowsTimeZone() { if (this.inner().osProfile().windowsConfiguration() != null) { return this.inner().osProfile().windowsConfiguration().timeZone(); } return null; }
@Override public VirtualMachineImpl withoutVMAgent() { this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(false); return this; }
@Override public boolean isWindowsVMAgentProvisioned() { if (this.inner().osProfile().windowsConfiguration() != null) { return Utils.toPrimitiveBoolean(this.inner().osProfile().windowsConfiguration().provisionVMAgent()); } return false; }
@Override public boolean isWindowsAutoUpdateEnabled() { if (this.inner().osProfile().windowsConfiguration() != null) { return Utils.toPrimitiveBoolean(this.inner().osProfile().windowsConfiguration().enableAutomaticUpdates()); } return false; }
@Override public VirtualMachineImpl withoutAutoUpdate() { this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(false); return this; }
@Override public VirtualMachineImpl withoutVMAgent() { this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(false); return this; }
@Override public VirtualMachineImpl withoutAutoUpdate() { this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(false); return this; }
@Override public VirtualMachineImpl withTimeZone(String timeZone) { this.inner().osProfile().windowsConfiguration().withTimeZone(timeZone); return this; }
@Override public VirtualMachineImpl withTimeZone(String timeZone) { this.inner().osProfile().windowsConfiguration().withTimeZone(timeZone); return this; }
@Override public boolean isWindowsVMAgentProvisioned() { if (this.inner().osProfile().windowsConfiguration() != null) { return Utils.toPrimitiveBoolean(this.inner().osProfile().windowsConfiguration().provisionVMAgent()); } return false; }
@Override public boolean isWindowsAutoUpdateEnabled() { if (this.inner().osProfile().windowsConfiguration() != null) { return Utils.toPrimitiveBoolean(this.inner().osProfile().windowsConfiguration().enableAutomaticUpdates()); } return false; }
@Override public VirtualMachineImpl withWinRM(WinRMListener listener) { if (this.inner().osProfile().windowsConfiguration().winRM() == null) { WinRMConfiguration winRMConfiguration = new WinRMConfiguration(); this.inner().osProfile().windowsConfiguration().withWinRM(winRMConfiguration); } this.inner().osProfile() .windowsConfiguration() .winRM() .listeners() .add(listener); return this; }
@Override public VirtualMachineImpl withWinRM(WinRMListener listener) { if (this.inner().osProfile().windowsConfiguration().winRM() == null) { WinRMConfiguration winRMConfiguration = new WinRMConfiguration(); this.inner().osProfile().windowsConfiguration().withWinRM(winRMConfiguration); } this.inner().osProfile() .windowsConfiguration() .winRM() .listeners() .add(listener); return this; }
@Override public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image" or "VM(Platform)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image" or "VM(Platform)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withWindowsCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image", "VM(Platform | Custom | Gallery)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withWindowsCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image", "VM(Platform | Custom | Gallery)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withStoredWindowsImage(String imageUrl) { VirtualHardDisk userImageVhd = new VirtualHardDisk(); userImageVhd.withUri(imageUrl); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().osDisk().withImage(userImageVhd); // For platform image osType will be null, azure will pick it from the image metadata. this.inner().storageProfile().osDisk().withOsType(OperatingSystemTypes.WINDOWS); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image" or "VM(Platform)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public OperatingSystemTypes osType() { if (inner().storageProfile().osDisk().osType() != null) { return inner().storageProfile().osDisk().osType(); } if (inner().osProfile() != null) { if (inner().osProfile().linuxConfiguration() != null) { return OperatingSystemTypes.LINUX; } if (inner().osProfile().windowsConfiguration() != null) { return OperatingSystemTypes.WINDOWS; } } return null; }