kubernetes.client.models.v1_network_policy_peer module

Kubernetes

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

The version of the OpenAPI document: release-1.36 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

class kubernetes.client.models.v1_network_policy_peer.V1NetworkPolicyPeer(*, ip_block: V1IPBlock | None = None, namespace_selector: V1LabelSelector | None = None, pod_selector: V1LabelSelector | None = None)

Bases: BaseModel

NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed

Attributes:
openapi_types (dict): The key is attribute name

and the value is attribute type.

attribute_map (dict): The key is attribute name

and the value is json key in definition.

attribute_map: ClassVar[Dict[str, str]] = {'ip_block': 'ipBlock', 'namespace_selector': 'namespaceSelector', 'pod_selector': 'podSelector'}
classmethod from_dict(obj: Dict[str, Any] | None) Self | None

Create an instance of V1NetworkPolicyPeer from a dict

classmethod from_json(json_str: str) Self | None

Create an instance of V1NetworkPolicyPeer from a JSON string

ip_block: V1IPBlock | None
model_config = {'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

namespace_selector: V1LabelSelector | None
openapi_types: ClassVar[Dict[str, str]] = {'ip_block': 'V1IPBlock', 'namespace_selector': 'V1LabelSelector', 'pod_selector': 'V1LabelSelector'}
pod_selector: V1LabelSelector | None
to_dict(serialize: bool = False) Dict[str, Any]

Return all declared model fields using public or wire names.

to_json() str

Returns the JSON representation of the model using alias

to_str() str

Returns the string representation of the model