feat: add prebuild invalidation via last_invalidated_at timestamp (#20582)

Updates #17917
This commit is contained in:
Marcin Tojek
2025-11-20 17:12:25 +01:00
committed by GitHub
parent c2319e5b4e
commit d004710a74
27 changed files with 637 additions and 23 deletions
+43
View File
@@ -3788,6 +3788,49 @@ Status Code **200**
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Invalidate presets for template
### Code samples
```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/templates/{template}/prebuilds/invalidate \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`POST /templates/{template}/prebuilds/invalidate`
### Parameters
| Name | In | Type | Required | Description |
|------------|------|--------------|----------|-------------|
| `template` | path | string(uuid) | true | Template ID |
### Example responses
> 200 Response
```json
{
"invalidated": [
{
"preset_name": "string",
"template_name": "string",
"template_version_name": "string"
}
]
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------|
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.InvalidatePresetsResponse](schemas.md#codersdkinvalidatepresetsresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get user quiet hours schedule
### Code samples
+38
View File
@@ -4715,6 +4715,44 @@ Only certain features set these fields: - FeatureManagedAgentLimit|
| `day` |
| `week` |
## codersdk.InvalidatePresetsResponse
```json
{
"invalidated": [
{
"preset_name": "string",
"template_name": "string",
"template_version_name": "string"
}
]
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|---------------|-------------------------------------------------------------------|----------|--------------|-------------|
| `invalidated` | array of [codersdk.InvalidatedPreset](#codersdkinvalidatedpreset) | false | | |
## codersdk.InvalidatedPreset
```json
{
"preset_name": "string",
"template_name": "string",
"template_version_name": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|-------------------------|--------|----------|--------------|-------------|
| `preset_name` | string | false | | |
| `template_name` | string | false | | |
| `template_version_name` | string | false | | |
## codersdk.IssueReconnectingPTYSignedTokenRequest
```json