@Override public boolean isLinuxPasswordAuthenticationEnabled() { if (this.inner().osProfile().linuxConfiguration() != null) { return !Utils.toPrimitiveBoolean(this.inner().osProfile().linuxConfiguration().disablePasswordAuthentication()); } return false; }
@Override public boolean isLinuxPasswordAuthenticationEnabled() { if (this.inner().osProfile().linuxConfiguration() != null) { return !Utils.toPrimitiveBoolean(this.inner().osProfile().linuxConfiguration().disablePasswordAuthentication()); } return false; }
@Override public VirtualMachineImpl withSsh(String publicKeyData) { OSProfile osProfile = this.inner().osProfile(); if (osProfile.linuxConfiguration().ssh() == null) { SshConfiguration sshConfiguration = new SshConfiguration(); sshConfiguration.withPublicKeys(new ArrayList<SshPublicKey>()); osProfile.linuxConfiguration().withSsh(sshConfiguration); } SshPublicKey sshPublicKey = new SshPublicKey(); sshPublicKey.withKeyData(publicKeyData); sshPublicKey.withPath("/home/" + osProfile.adminUsername() + "/.ssh/authorized_keys"); osProfile.linuxConfiguration().ssh().publicKeys().add(sshPublicKey); return this; }
@Override public VirtualMachineImpl withSsh(String publicKeyData) { OSProfile osProfile = this.inner().osProfile(); if (osProfile.linuxConfiguration().ssh() == null) { SshConfiguration sshConfiguration = new SshConfiguration(); sshConfiguration.withPublicKeys(new ArrayList<SshPublicKey>()); osProfile.linuxConfiguration().withSsh(sshConfiguration); } SshPublicKey sshPublicKey = new SshPublicKey(); sshPublicKey.withKeyData(publicKeyData); sshPublicKey.withPath("/home/" + osProfile.adminUsername() + "/.ssh/authorized_keys"); osProfile.linuxConfiguration().ssh().publicKeys().add(sshPublicKey); 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; }
if (osProfile.linuxConfiguration() == null) { osProfile.withLinuxConfiguration(new LinuxConfiguration()); .linuxConfiguration() .withDisablePasswordAuthentication(osProfile.adminPassword() == null);
if (osProfile.linuxConfiguration() == null) { osProfile.withLinuxConfiguration(new LinuxConfiguration()); .linuxConfiguration() .withDisablePasswordAuthentication(osProfile.adminPassword() == null);
@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; }