com.pulumi.libvirt.outputs.NetworkDns Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libvirt Show documentation
Show all versions of libvirt Show documentation
A Pulumi package for creating and managing libvirt cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.libvirt.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.libvirt.outputs.NetworkDnsForwarder;
import com.pulumi.libvirt.outputs.NetworkDnsHost;
import com.pulumi.libvirt.outputs.NetworkDnsSrv;
import java.lang.Boolean;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class NetworkDns {
/**
* @return when false, disable the DHCP server
*
*/
private @Nullable Boolean enabled;
/**
* @return Either `address`, `domain`, or both must be set
*
*/
private @Nullable List forwarders;
/**
* @return a DNS host entry block. You can have one or more of these
* blocks in your DNS definition. You must specify both `ip` and `hostname`.
*
* An advanced example of round-robin DNS (using DNS host templates) follows:
*
*/
private @Nullable List hosts;
/**
* @return true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
*
*/
private @Nullable Boolean localOnly;
/**
* @return a DNS SRV entry block. You can have one or more of these blocks
* in your DNS definition. You must specify `service` and `protocol`.
*
*/
private @Nullable List srvs;
private NetworkDns() {}
/**
* @return when false, disable the DHCP server
*
*/
public Optional enabled() {
return Optional.ofNullable(this.enabled);
}
/**
* @return Either `address`, `domain`, or both must be set
*
*/
public List forwarders() {
return this.forwarders == null ? List.of() : this.forwarders;
}
/**
* @return a DNS host entry block. You can have one or more of these
* blocks in your DNS definition. You must specify both `ip` and `hostname`.
*
* An advanced example of round-robin DNS (using DNS host templates) follows:
*
*/
public List hosts() {
return this.hosts == null ? List.of() : this.hosts;
}
/**
* @return true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
*
*/
public Optional localOnly() {
return Optional.ofNullable(this.localOnly);
}
/**
* @return a DNS SRV entry block. You can have one or more of these blocks
* in your DNS definition. You must specify `service` and `protocol`.
*
*/
public List srvs() {
return this.srvs == null ? List.of() : this.srvs;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NetworkDns defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable Boolean enabled;
private @Nullable List forwarders;
private @Nullable List hosts;
private @Nullable Boolean localOnly;
private @Nullable List srvs;
public Builder() {}
public Builder(NetworkDns defaults) {
Objects.requireNonNull(defaults);
this.enabled = defaults.enabled;
this.forwarders = defaults.forwarders;
this.hosts = defaults.hosts;
this.localOnly = defaults.localOnly;
this.srvs = defaults.srvs;
}
@CustomType.Setter
public Builder enabled(@Nullable Boolean enabled) {
this.enabled = enabled;
return this;
}
@CustomType.Setter
public Builder forwarders(@Nullable List forwarders) {
this.forwarders = forwarders;
return this;
}
public Builder forwarders(NetworkDnsForwarder... forwarders) {
return forwarders(List.of(forwarders));
}
@CustomType.Setter
public Builder hosts(@Nullable List hosts) {
this.hosts = hosts;
return this;
}
public Builder hosts(NetworkDnsHost... hosts) {
return hosts(List.of(hosts));
}
@CustomType.Setter
public Builder localOnly(@Nullable Boolean localOnly) {
this.localOnly = localOnly;
return this;
}
@CustomType.Setter
public Builder srvs(@Nullable List srvs) {
this.srvs = srvs;
return this;
}
public Builder srvs(NetworkDnsSrv... srvs) {
return srvs(List.of(srvs));
}
public NetworkDns build() {
final var _resultValue = new NetworkDns();
_resultValue.enabled = enabled;
_resultValue.forwarders = forwarders;
_resultValue.hosts = hosts;
_resultValue.localOnly = localOnly;
_resultValue.srvs = srvs;
return _resultValue;
}
}
}