kubernetes_asyncio.client.models.v1_network_policy_spec module

Kubernetes

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501

The version of the OpenAPI document: v1.34.3 Generated by: https://openapi-generator.tech

class kubernetes_asyncio.client.models.v1_network_policy_spec.V1NetworkPolicySpec(egress=None, ingress=None, pod_selector=None, policy_types=None, local_vars_configuration=None)

Bases: object

NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech

Do not edit the class manually.

attribute_map = {'egress': 'egress', 'ingress': 'ingress', 'pod_selector': 'podSelector', 'policy_types': 'policyTypes'}
property egress

Gets the egress of this V1NetworkPolicySpec. # noqa: E501

egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8 # noqa: E501

Returns:

The egress of this V1NetworkPolicySpec. # noqa: E501

Return type:

list[V1NetworkPolicyEgressRule]

property ingress

Gets the ingress of this V1NetworkPolicySpec. # noqa: E501

ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod’s local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default) # noqa: E501

Returns:

The ingress of this V1NetworkPolicySpec. # noqa: E501

Return type:

list[V1NetworkPolicyIngressRule]

openapi_types = {'egress': 'list[V1NetworkPolicyEgressRule]', 'ingress': 'list[V1NetworkPolicyIngressRule]', 'pod_selector': 'V1LabelSelector', 'policy_types': 'list[str]'}
property pod_selector

Gets the pod_selector of this V1NetworkPolicySpec. # noqa: E501

Returns:

The pod_selector of this V1NetworkPolicySpec. # noqa: E501

Return type:

V1LabelSelector

property policy_types

Gets the policy_types of this V1NetworkPolicySpec. # noqa: E501

policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are [“Ingress”], [“Egress”], or [“Ingress”, “Egress”]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ “Egress” ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include “Egress” (since such a policy would not include an egress section and would otherwise default to just [ “Ingress” ]). This field is beta-level in 1.8 # noqa: E501

Returns:

The policy_types of this V1NetworkPolicySpec. # noqa: E501

Return type:

list[str]

to_dict(serialize=False)

Returns the model properties as a dict

to_str()

Returns the string representation of the model