> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Network 규칙

> 생성 시 egress 및 ingress 규칙과 이들이 수락하는 선택기입니다.

<h2 id="egressrule">
  EgressRule
</h2>

소스: [src/cwsandbox/\_types.py:524](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L524)

```python theme={"system"}
class EgressRule(*, dns_name: str | None = None, cidr: CidrBlock | Mapping[str, Any] | str | None = None, tenant: TenantScope | str | None = None, any: bool = False, selector: SelectorBlock | Mapping[str, Any] | None = None, ports: Sequence[PortRange | Mapping[str, Any] | int] | None = None, dns_name_except: Sequence[str] | None = None)
```

생성 시 egress 대상입니다.

정확히 하나의 대상을 설정해야 합니다: `dns_name`, `cidr`, `tenant`,
`any`, 또는 `selector`. DNS 이름은 HTTPS (TCP 443) 권한 부여입니다. 정확한
이름 (`pypi.org`) 또는 단일 최좌측 와일드카드 (`*.pypi.org`).
`"*"`는 정책 상한선이며, 샌드박스 권한 부여가 아닙니다.

**속성**

* `dns_name` (`str | None`) : HTTPS (TCP 443)에 대해 권한을 부여할 호스트 이름.
* `cidr` (`CidrBlock | Mapping[str, Any] | str | None`) : IP 범위 (`CidrBlock`, dict 또는 CIDR string).
* `tenant` (`TenantScope | str | None`) : 관계에 따라 선택된 다른 샌드박스.
* `any` (`bool`) : 플랫폼 내부 범위를 제외한 모든 대상. 기본값: `False`.
* `selector` (`SelectorBlock | Mapping[str, Any] | None`) : pod/namespace 레이블로 선택된 클러스터 워크로드.
* `ports` (`Sequence[PortRange | Mapping[str, Any] | int] | None`) : 선택적 대상 포트 필터. 비어 있으면 non-DNS 규칙의 모든 포트.
  DNS 이름 권한 부여는 포트를 생략하거나 정확히 TCP 443으로 설정합니다.
* `dns_name_except` (`Sequence[str] | None`) : 정책 전용 예외. 이
  생성 시 유형에서는 거부됩니다.

***

<h2 id="ingressrule">
  IngressRule
</h2>

소스: [src/cwsandbox/\_types.py:633](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L633)

```python theme={"system"}
class IngressRule(*, cidr: CidrBlock | Mapping[str, Any] | str | None = None, tenant: TenantScope | str | None = None, any: bool = False, ports: Sequence[PortRange | Mapping[str, Any] | int] | None = None)
```

생성 시점의 맞춤형 포트 ingress 소스입니다.

정확히 하나의 source를 설정해야 합니다: `cidr`, `tenant` 또는 `any`.

**속성**

* `cidr` (`CidrBlock | Mapping[str, Any] | str | None`) : 소스 IP 범위.
* `tenant` (`TenantScope | str | None`) : 관계에 따라 선택된 다른 샌드박스.
* `any` (`bool`) : 공용 인터넷을 포함한 모든 source. 기본값: `False`.
* `ports` (`Sequence[PortRange | Mapping[str, Any] | int] | None`) : 선택 포트 필터. 비어 있으면 모든 맞춤형 가시성 포트.

***

<h2 id="cidrblock">
  CidrBlock
</h2>

소스: [src/cwsandbox/\_types.py:441](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L441)

```python theme={"system"}
class CidrBlock(*, cidr: str, except_cidrs: Sequence[str] = ())
```

선택적으로 제외된 하위 범위가 있는 IP 범위.

**속성**

* `except_cidrs` (`Sequence[str]`) : 기본값: `()`.

***

<h2 id="portrange">
  PortRange
</h2>

소스: [src/cwsandbox/\_types.py:469](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L469)

```python theme={"system"}
class PortRange(*, port: int, end_port: int | None = None, protocol: str | None = None)
```

단일 포트 또는 양 끝값을 포함하는 포트 범위입니다.

**속성**

* `end_port` (`int | None`)
* `protocol` (`str | None`)

***

<h2 id="selectorblock">
  SelectorBlock
</h2>

소스: [src/cwsandbox/\_types.py:454](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L454)

```python theme={"system"}
class SelectorBlock(*, pod_labels: Mapping[str, str], namespace_labels: Mapping[str, str] | None = None)
```

클러스터 워크로드에 대한 레이블 선택기 (matchLabels만).

**속성**

* `namespace_labels` (`Mapping[str, str] | None`)

***

<h2 id="tenantscope">
  TenantScope
</h2>

Source: [src/cwsandbox/\_types.py:416](https://github.com/coreweave/cwsandbox-client/blob/v1.14.2/src/cwsandbox/_types.py#L416)

```python theme={"system"}
class TenantScope
```

* `UNSPECIFIED` = `'unspecified'`
* `SAME_USER` = `'same_user'`
* `SAME_ORG` = `'same_org'`
* `SANDBOX_NETWORK` = `'sandbox_network'`

***
