Added deployments overview

This commit is contained in:
2026-04-06 22:04:50 +02:00
parent a95c76ce7e
commit 1978a31cbf
21 changed files with 1249 additions and 169 deletions
+214
View File
@@ -250,6 +250,50 @@ const docTemplate = `{
}
}
},
"/deployments/{id}": {
"get": {
"description": "Get a single deployment by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Deployments"
],
"summary": "Get deployment by ID",
"parameters": [
{
"type": "string",
"description": "Deployment ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Deployment"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/models.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
},
"/forward-rules/{id}": {
"get": {
"description": "Returns a single forward rule by ID",
@@ -832,6 +876,50 @@ const docTemplate = `{
}
}
},
"/sites/{id}/enabled": {
"patch": {
"description": "Enable or disable a site by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Sites"
],
"summary": "Toggle site enabled status",
"parameters": [
{
"type": "string",
"description": "Site ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ToggleEnabledResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/models.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
},
"/sites/{id}/forward-rules": {
"get": {
"description": "Returns all forward rules associated with the given site",
@@ -932,6 +1020,51 @@ const docTemplate = `{
}
}
}
},
"/sites/{siteId}/deployments": {
"get": {
"description": "Get a list of deployments for a specific site",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Deployments"
],
"summary": "Get deployments for a site",
"parameters": [
{
"type": "string",
"description": "Site ID",
"name": "siteId",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 100,
"description": "Maximum number of deployments to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetDeploymentsBySiteResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
}
},
"definitions": {
@@ -966,11 +1099,58 @@ const docTemplate = `{
"id": {
"type": "string"
},
"regex": {
"type": "boolean"
},
"source": {
"type": "string"
}
}
},
"models.Deployment": {
"type": "object",
"properties": {
"commit_hash": {
"type": "string"
},
"created_at": {
"type": "string"
},
"finish_time": {
"type": "string"
},
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"site_id": {
"type": "string"
},
"start_time": {
"type": "string"
},
"status": {
"$ref": "#/definitions/models.DeploymentStatus"
}
}
},
"models.DeploymentStatus": {
"type": "string",
"enum": [
"pending",
"running",
"success",
"failed"
],
"x-enum-varnames": [
"DeploymentStatusPending",
"DeploymentStatusRunning",
"DeploymentStatusSuccess",
"DeploymentStatusFailed"
]
},
"models.ForwardRule": {
"type": "object",
"properties": {
@@ -1005,6 +1185,20 @@ const docTemplate = `{
}
}
},
"models.GetDeploymentsBySiteResponse": {
"type": "object",
"properties": {
"deployments": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Deployment"
}
},
"total": {
"type": "integer"
}
}
},
"models.Header": {
"type": "object",
"properties": {
@@ -1025,6 +1219,9 @@ const docTemplate = `{
"branch": {
"type": "string"
},
"created_at": {
"type": "string"
},
"custom_headers": {
"type": "array",
"items": {
@@ -1052,6 +1249,12 @@ const docTemplate = `{
"id": {
"type": "string"
},
"index_file": {
"type": "string"
},
"name": {
"type": "string"
},
"not_found_file": {
"type": "string"
},
@@ -1063,6 +1266,17 @@ const docTemplate = `{
},
"spa": {
"type": "boolean"
},
"trailing_slash": {
"type": "boolean"
}
}
},
"models.ToggleEnabledResponse": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}