> ## 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.

# Services

> Ports de service typés exposés par une sandbox.

<h2 id="service">
  Service
</h2>

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

```python theme={"system"}
class Service(*, port: int, name: str | None = None, protocol: ServiceProtocol | str | None = None, visibility: ServiceVisibility | str | None = None, endpoint: Endpoint | dict[str, Any] | None = None)
```

Port de service typé exposé par une sandbox.

Remplace le modèle de la version bêta, qui reposait sur des modes ingress/trafic sortant définis par string dans `NetworkOptions`.

**Attributs**

* `name` (`str | None`) : nom de service facultatif.
* `protocol` (`ServiceProtocol | str | None`) : protocole L4 (TCP par défaut s’il n’est pas défini). Doit être non défini ou
  TCP lorsque `endpoint` est défini.
* `visibility` (`ServiceVisibility | str | None`) : qui peut accéder à ce port (PUBLIC/PRIVATE/CUSTOM).
  CUSTOM signifie que la flotte détermine l’accessibilité ; `service_urls`
  reste vide, sauf si l’API renvoie une URL. Le service
  apparaît tout de même dans `exposed_ports`. Doit être PUBLIC lorsque `endpoint`
  est défini.
* `endpoint` (`Endpoint | dict[str, Any] | None`) : point de terminaison de produit facultatif. HTTPS/OPEN (avec
  `request_timeout_seconds` facultatif) ou TLS\_PASSTHROUGH (authentification et
  délai d’expiration non définis). À omettre pour un simple port TCP/UDP.

***

<h2 id="serviceprotocol">
  ServiceProtocol
</h2>

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

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

* `UNSPECIFIED` = `'unspecified'`
* `TCP` = `'tcp'`
* `UDP` = `'udp'`
* `SCTP` = `'sctp'`

***

<h2 id="servicevisibility">
  ServiceVisibility
</h2>

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

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

* `UNSPECIFIED` = `'unspecified'`
* `PUBLIC` = `'public'`
* `PRIVATE` = `'private'`
* `CUSTOM` = `'custom'`

***
