com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyPeerPatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes Show documentation
Show all versions of kubernetes Show documentation
A Pulumi package for creating and managing Kubernetes 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.kubernetes.extensions.v1beta1.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.extensions.v1beta1.outputs.IPBlockPatch;
import com.pulumi.kubernetes.meta.v1.outputs.LabelSelectorPatch;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class NetworkPolicyPeerPatch {
/**
* @return IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
*
*/
private @Nullable IPBlockPatch ipBlock;
/**
* @return Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.
*
* If PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
*
*/
private @Nullable LabelSelectorPatch namespaceSelector;
/**
* @return This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.
*
* If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
*
*/
private @Nullable LabelSelectorPatch podSelector;
private NetworkPolicyPeerPatch() {}
/**
* @return IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
*
*/
public Optional ipBlock() {
return Optional.ofNullable(this.ipBlock);
}
/**
* @return Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.
*
* If PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
*
*/
public Optional namespaceSelector() {
return Optional.ofNullable(this.namespaceSelector);
}
/**
* @return This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.
*
* If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
*
*/
public Optional podSelector() {
return Optional.ofNullable(this.podSelector);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NetworkPolicyPeerPatch defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable IPBlockPatch ipBlock;
private @Nullable LabelSelectorPatch namespaceSelector;
private @Nullable LabelSelectorPatch podSelector;
public Builder() {}
public Builder(NetworkPolicyPeerPatch defaults) {
Objects.requireNonNull(defaults);
this.ipBlock = defaults.ipBlock;
this.namespaceSelector = defaults.namespaceSelector;
this.podSelector = defaults.podSelector;
}
@CustomType.Setter
public Builder ipBlock(@Nullable IPBlockPatch ipBlock) {
this.ipBlock = ipBlock;
return this;
}
@CustomType.Setter
public Builder namespaceSelector(@Nullable LabelSelectorPatch namespaceSelector) {
this.namespaceSelector = namespaceSelector;
return this;
}
@CustomType.Setter
public Builder podSelector(@Nullable LabelSelectorPatch podSelector) {
this.podSelector = podSelector;
return this;
}
public NetworkPolicyPeerPatch build() {
final var _resultValue = new NetworkPolicyPeerPatch();
_resultValue.ipBlock = ipBlock;
_resultValue.namespaceSelector = namespaceSelector;
_resultValue.podSelector = podSelector;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy