# Proxy

> API reference for Proxies (core.apoxy.dev/v1alpha2)

**API Group:** `core.apoxy.dev/v1alpha2`

## Operations

### List Proxies

<APIEndpoint method="GET" path="/apis/core.apoxy.dev/v1alpha2/proxies" />

List Proxy

**Response**

- `200`: OK

---

### Create Proxy

<APIEndpoint method="POST" path="/apis/core.apoxy.dev/v1alpha2/proxies" />

Create a Proxy

**Request Body**

Spec fields (`ProxySpec`):

| Field | Type | Description |
| --- | --- | --- |
| `provider` | string | Provider is the infrastructure provider where the proxy will be deployed. Defaults to "cloud" provider. |
| `shutdown` | [ShutdownConfig](#shutdownconfig) | Shutdown configuration for the proxy. |
| `telemetry` | [ProxyTelementry](#proxytelementry) | Telemetry configures telemetry for the Proxy. |

**Response**

- `200`: OK
- `201`: Created
- `202`: Accepted

---

### Delete All Proxies

<APIEndpoint method="DELETE" path="/apis/core.apoxy.dev/v1alpha2/proxies" />

Delete collection of Proxy

**Response**

- `200`: OK

---

### Get Proxy

<APIEndpoint method="GET" path="/apis/core.apoxy.dev/v1alpha2/proxies/{name}" />

Get the specified Proxy

**Response**

- `200`: OK

---

### Replace Proxy

<APIEndpoint method="PUT" path="/apis/core.apoxy.dev/v1alpha2/proxies/{name}" />

Replace the specified Proxy

**Request Body**

Spec fields (`ProxySpec`):

| Field | Type | Description |
| --- | --- | --- |
| `provider` | string | Provider is the infrastructure provider where the proxy will be deployed. Defaults to "cloud" provider. |
| `shutdown` | [ShutdownConfig](#shutdownconfig) | Shutdown configuration for the proxy. |
| `telemetry` | [ProxyTelementry](#proxytelementry) | Telemetry configures telemetry for the Proxy. |

**Response**

- `200`: OK
- `201`: Created

---

### Update Proxy

<APIEndpoint method="PATCH" path="/apis/core.apoxy.dev/v1alpha2/proxies/{name}" />

Partially update the specified Proxy

**Response**

- `200`: OK
- `201`: Created

---

### Delete Proxy

<APIEndpoint method="DELETE" path="/apis/core.apoxy.dev/v1alpha2/proxies/{name}" />

Delete a Proxy

**Response**

- `200`: OK
- `202`: Accepted

---

## Schema Reference

### ShutdownConfig

| Field | Type | Description |
| --- | --- | --- |
| `drainTimeout` | [Duration](#duration) | DrainTimeout is the amount of time to wait before terminating the proxy. Defaults to 30s. |
| `minimumDrainTime` | [Duration](#duration) | MinimumDrainTime is the minimum amount of time to wait before terminating the proxy. This is useful for ensuring downstream loadbalancers have enough time to pick up healthcheck status and drain the backend target. Can not be less than DrainTimeout. Defaults to 30s. |

### ProxyTelementry

| Field | Type | Description |
| --- | --- | --- |
| `accessLogs` | [ProxyAccessLogs](#proxyaccesslogs) | AccessLogs configures how access logs are handled. Note that access logs cannot be disabled. |
| `contentLogs` | [ProxyContentLogs](#proxycontentlogs) | ContentLogs configures how request and response body content are handled. Also refered to as Taps in Envoy. Disabled by default. |
| `otelCollectorConfig` | [LocalObjectReference](#localobjectreference) | Custom OpenTelemetry collector configuration. Only supported for unmanaged proxies. This must be a ConfigMap or a Secret in the same namespace as Backplane. |
| `thirdPartySinks` | [ThirdPartySinks](#thirdpartysinks) | For enabling third party integrations. This is only supported for cloud proxies. |
| `tracing` | [ProxyTracing](#proxytracing) | Tracing configures how tracing is handled. Disabled by default. |

### ProxyAccessLogs

| Field | Type | Description |
| --- | --- | --- |
| `json` | object | If set, additional fields to add to the default Envoy access logs. Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators) can be used as values for fields. Note that attempting to override default fields will not have any effect. |

### ProxyContentLogs

| Field | Type | Description |
| --- | --- | --- |
| `requestBodyEnabled` | boolean | Enable request body content logging. **(required)** |
| `responseBodyEnabled` | boolean | Enable response body content logging. **(required)** |

### LocalObjectReference

| Field | Type | Description |
| --- | --- | --- |
| `group` | string | Group is the API Group of the referenced object. **(required)** |
| `name` | string | Name is the name of the referenced object. **(required)** |

### ThirdPartySinks

| Field | Type | Description |
| --- | --- | --- |
| `axiomLogs` | [APIKey](#apikey) | AxiomLogs is the API key for Axiom logs. |
| `axiomTraces` | [APIKey](#apikey) | AxiomTraces is the API key for Axiom traces. |
| `datadogLogs` | [APIKey](#apikey) | DatadogLogs is the API key for Datadog logs. |
| `datadogTraces` | [APIKey](#apikey) | DatadogTraces is the API key for Datadog traces. |
| `openTelemetrySinks` | [OpenTelemetrySink](#opentelemetrysink)[] | OpenTelemetrySink is the OpenTelemetry sink. |

### APIKey

| Field | Type | Description |
| --- | --- | --- |
| `key` | string | Key is the API key. |
| `keyData` | string | KeyData is the base64 encoded API key. |

### ProxyTracing

| Field | Type | Description |
| --- | --- | --- |
| `enabled` | boolean | Enable tracing. **(required)** |
| `tags` | object | Additional tags to populate on the traces. |
