---
title: "Primes a scenario such that when a query is received closes client connections"
method: POST
path: "/prime/{clusterId}#(close_connection)"
tags: ["prime"]
---

# Primes a scenario such that when a query is received closes client connections

`POST /prime/{clusterId}#(close_connection)`

## Path parameters

- `clusterId` string, required

## Request body

- PrimeQueryCloseConnection
  - `when` Query, required
    - `query` string, required
    - `consistency_level` Consistency[]
    - `params` object — Each property is a mapping of parameter name to paramter value. The value can be of any type as simulacron will attempt to map the json value to it's native binary format"
    - `param_types` object — Each property is a mapping of parameter name to parameter type
  - `then` CloseConnectionResult, required
    - `result` string, required
    - `delay_in_ms` integer, required — Adds delay to send response back to client.
    - `ignore_on_prepare` boolean — Whether or not this result be applied to a matching prepare statement. If not specified, defaults to true (does not apply) and applies to the execution of statements tied to that prepared statement.
    - `close_type` 'disconnect' | 'shutdown_read' | 'shutdown_write' — The kind of close operation
    - `scope` 'connection' | 'node' | 'data_center' | 'cluster' — The scope of the close operation

## Response `201`

PrimedQuery

- PrimeQueryCloseConnection
  - `when` Query, required
    - `query` string, required
    - `consistency_level` Consistency[]
    - `params` object — Each property is a mapping of parameter name to paramter value. The value can be of any type as simulacron will attempt to map the json value to it's native binary format"
    - `param_types` object — Each property is a mapping of parameter name to parameter type
  - `then` CloseConnectionResult, required
    - `result` string, required
    - `delay_in_ms` integer, required — Adds delay to send response back to client.
    - `ignore_on_prepare` boolean — Whether or not this result be applied to a matching prepare statement. If not specified, defaults to true (does not apply) and applies to the execution of statements tied to that prepared statement.
    - `close_type` 'disconnect' | 'shutdown_read' | 'shutdown_write' — The kind of close operation
    - `scope` 'connection' | 'node' | 'data_center' | 'cluster' — The scope of the close operation

## Other responses

- `400` — Unable to parse provided query

---

[API](https://skmtc.net/datastax/apis/simulacron-rest-api.md) · [All operations](https://skmtc.net/datastax/apis/simulacron-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datastax/simulacron-rest-api/versions/0a5cd5c466d5/schema)
