---
title: "Update a status check template."
method: PUT
path: "/templates/statuschecks/statuscheck"
tags: ["templates"]
---

# Update a status check template.

`PUT /templates/statuschecks/statuscheck`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/templates/statuschecks/statuscheck`
- Auth: none declared

Update a status check template by namespaced name.

## Request body

- GithubComChaosMeshChaosMeshPkgDashboardApiserverTypesStatusCheckTemplate
  - `description` string
  - `name` string
  - `namespace` string
  - `spec` GithubComChaosMeshChaosMeshApiV1alpha1StatusCheckTemplate
    - `duration` string: Duration defines the duration of the whole status check if the number of failed execution does not exceed the failure threshold. Duration is available to both `Synchronous` and `Continuous` mode. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". +optional
    - `failureThreshold` integer: FailureThreshold defines the minimum consecutive failure for the status check to be considered failed. +optional +kubebuilder:default=3 +kubebuilder:validation:Minimum=1
    - `http` GithubComChaosMeshChaosMeshApiV1alpha1HTTPStatusCheck
      - `body` string: +optional
      - `criteria` GithubComChaosMeshChaosMeshApiV1alpha1HTTPCriteria
        - `statusCode` string: StatusCode defines the expected http status code for the request. A statusCode string could be a single code (e.g. 200), or an inclusive range (e.g. 200-400, both `200` and `400` are included).
      - `headers` HttpHeader
      - `method` string: +optional +kubebuilder:validation:Enum=GET;POST +kubebuilder:default=GET
      - `url` string
    - `intervalSeconds` integer: IntervalSeconds defines how often (in seconds) to perform an execution of status check. +optional +kubebuilder:default=10 +kubebuilder:validation:Minimum=1
    - `mode` 'Synchronous' | 'Continuous'
    - `recordsHistoryLimit` integer: RecordsHistoryLimit defines the number of record to retain. +optional +kubebuilder:default=100 +kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=1000
    - `successThreshold` integer: SuccessThreshold defines the minimum consecutive successes for the status check to be considered successful. SuccessThreshold only works for `Synchronous` mode. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `timeoutSeconds` integer: TimeoutSeconds defines the number of seconds after which an execution of status check times out. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `type` 'HTTP'

## Response `200`

OK

- GithubComChaosMeshChaosMeshPkgDashboardApiserverTypesStatusCheckTemplate
  - `description` string
  - `name` string
  - `namespace` string
  - `spec` GithubComChaosMeshChaosMeshApiV1alpha1StatusCheckTemplate
    - `duration` string: Duration defines the duration of the whole status check if the number of failed execution does not exceed the failure threshold. Duration is available to both `Synchronous` and `Continuous` mode. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". +optional
    - `failureThreshold` integer: FailureThreshold defines the minimum consecutive failure for the status check to be considered failed. +optional +kubebuilder:default=3 +kubebuilder:validation:Minimum=1
    - `http` GithubComChaosMeshChaosMeshApiV1alpha1HTTPStatusCheck
      - `body` string: +optional
      - `criteria` GithubComChaosMeshChaosMeshApiV1alpha1HTTPCriteria
        - `statusCode` string: StatusCode defines the expected http status code for the request. A statusCode string could be a single code (e.g. 200), or an inclusive range (e.g. 200-400, both `200` and `400` are included).
      - `headers` HttpHeader
      - `method` string: +optional +kubebuilder:validation:Enum=GET;POST +kubebuilder:default=GET
      - `url` string
    - `intervalSeconds` integer: IntervalSeconds defines how often (in seconds) to perform an execution of status check. +optional +kubebuilder:default=10 +kubebuilder:validation:Minimum=1
    - `mode` 'Synchronous' | 'Continuous'
    - `recordsHistoryLimit` integer: RecordsHistoryLimit defines the number of record to retain. +optional +kubebuilder:default=100 +kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=1000
    - `successThreshold` integer: SuccessThreshold defines the minimum consecutive successes for the status check to be considered successful. SuccessThreshold only works for `Synchronous` mode. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `timeoutSeconds` integer: TimeoutSeconds defines the number of seconds after which an execution of status check times out. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `type` 'HTTP'

## Other responses

- `400`: Bad Request
- `500`: Internal Server Error

## Changes

- **2022-03-30** `bc67aa8597ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/chaos-mesh/apis/chaos-mesh-dashboard-api/changes/templates/statuschecks/statuscheck/put.md)

---

[API](https://skmtc.dev/chaos-mesh/apis/chaos-mesh-dashboard-api.md) - [All operations](https://skmtc.dev/chaos-mesh/apis/chaos-mesh-dashboard-api/llms.txt) - [OpenAPI document](https://skmtc.dev/chaos-mesh/apis/chaos-mesh-dashboard-api/revisions/2d6f9ed9cc7f?raw)
