# setSuppressedCell **Endpoint:** `POST https://firesim.cs.gsu.edu/api/setSuppressedCell` Suppress a single cell or a straight line of cells between two points. Suppressed cells cannot burn. Omit `x2`/`y2` to suppress only the cell at (`x1`,`y1`). ## Parameters | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `userToken` | string | yes | — | Your simulation token. | | `x1` | integer | yes | — | Starting (or only) cell's row. | | `y1` | integer | yes | — | Starting (or only) cell's column. | | `x2` | integer | no | — | Ending cell's row (for line suppression). | | `y2` | integer | no | — | Ending cell's column (for line suppression). | ## Responses ### HTTP 200 Cell(s) suppressed successfully. **Example:** ```json "Updated Settings: Suppressed Cell" ``` ### HTTP 400 Bad request. Observed when: invalid userToken. **Example:** ```json "" ``` ## Examples ### Python ```python import requests base_url: str = "https://firesim.cs.gsu.edu/api/setSuppressedCell/" params: dict[str, int | str] = { "userToken": "abc123xyz", "x1": 5, "y1": 5, "x2": 5, # optional "y2": 10, # optional } response = requests.post(base_url, params=params) print(response.text) ``` ### JavaScript ```javascript /** @type {string} */ const BASE_URL = "https://firesim.cs.gsu.edu/api/setSuppressedCell/"; const params = { userToken: "abc123xyz", x1: 5, y1: 5, x2: 5, // optional y2: 10, // optional }; const url = new URL(BASE_URL); Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v)); fetch(url.toString(), { method: "POST" }) .then(res => res.text()) .then(console.log); ``` ### cURL ```bash BASE_URL="https://firesim.cs.gsu.edu/api/setSuppressedCell/" curl -s -X POST \ -G --data-urlencode "userToken=abc123xyz" \ -G --data-urlencode "x1=5" \ -G --data-urlencode "y1=5" \ -G --data-urlencode "x2=5" \ # optional -G --data-urlencode "y2=10" \ # optional "$BASE_URL" ``` ### Java ```java import java.net.URI; import java.net.http.*; String BASE_URL = "https://firesim.cs.gsu.edu/api/setSuppressedCell/"; String queryString = "userToken=abc123xyz" + "&" + "x1=5" + "&" + "y1=5" + "&" + "x2=5" + "&" + // optional "y2=10"; // optional HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL + "?" + queryString)) .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); ``` ### Go ```go import ( "fmt" "io" "net/http" "net/url" ) baseURL := "https://firesim.cs.gsu.edu/api/setSuppressedCell/" params := url.Values{} params.Set("userToken", "abc123xyz") params.Set("x1", "5") params.Set("y1", "5") params.Set("x2", "5") // optional params.Set("y2", "10") // optional resp, _ := http.PostForm(baseURL, params) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) ``` ### Rust ```rust use reqwest::blocking::Client; let base_url = "https://firesim.cs.gsu.edu/api/setSuppressedCell/"; let params = vec![ ("userToken", "abc123xyz"), ("x1", "5"), ("y1", "5"), ("x2", "5"), // optional ("y2", "10"), // optional ]; let client = Client::new(); let response = client.post(base_url).query(¶ms).send().unwrap(); println!("{}", response.text().unwrap()); ```