---
title: "Request squash to attach to a running container."
method: POST
path: "/debugattachment"
tags: ["debugattachment"]
---

# Request squash to attach to a running container.

`POST /debugattachment`

A debug attachment instructs squash to attach to a container. Debug attachment is made of
  - image: The container image we are debugging. this is used for extra validation, as placing breakpoints on the wrong binary can lead to unexpected results. if not provided huerisrtics will be used to identify it.
  - debugger: Type of debugger to use. "dlv" and "gdb" are supported now.
  - match_request: Whether to match this attachment to a debug request. This is used in automated use-cases to guarantee that the attachment matches a pending debug request.

## Request body

- DebugAttachment
  - `metadata` ObjectMeta
    - `name` string
    - `version` string
  - `spec` DebugAttachmentSpec, required
    - `attachment` Attachment, required
    - `debugger` string
    - `image` string
    - `process_name` string
    - `node` string
    - `match_request` boolean — If true, this attachment must match a pending debug request.
  - `status` DebugAttachmentStatus
    - `state` 'none' | 'attaching' | 'attached' | 'error'
    - `debug_server_address` string

## Response `201`

Debug attachment created

- DebugAttachment
  - `metadata` ObjectMeta
    - `name` string
    - `version` string
  - `spec` DebugAttachmentSpec, required
    - `attachment` Attachment, required
    - `debugger` string
    - `image` string
    - `process_name` string
    - `node` string
    - `match_request` boolean — If true, this attachment must match a pending debug request.
  - `status` DebugAttachmentStatus
    - `state` 'none' | 'attaching' | 'attached' | 'error'
    - `debug_server_address` string

## Other responses

- `400` — Bad request
- `404` — Not found
- `422` — Invalid input
- `503` — Service Unavailable

## Changes

- **2017-12-05** `96bf67aa2c37` — 1 info
  - endpoint added
- **2017-08-22** `7d244be4e5ca` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/solo-io/apis/squash-server/changes/debugattachment/post.md)

---

[API](https://skmtc.dev/solo-io/apis/squash-server.md) · [All operations](https://skmtc.dev/solo-io/apis/squash-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/solo-io/squash-server/revisions/03ddbf850d54/schema)
